cowinapi / developer.cowin

This group is created to facilitate technical and integration discussions related to cowin platform. API related contents can be obtained at API setu portal https://apisetu.gov.in/public/marketplace/api/cowin
115 stars 30 forks source link

403 ERROR: The Request could not be satisfied #262

Open Pratiksha1903 opened 3 years ago

Pratiksha1903 commented 3 years ago

I also used user agent but then only getting same error. var headerObj={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"};

        var apiResponse=https.get({
            url:'https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=363&date=15-05-2021',
            headers: headerObj
        });
saran-surya commented 3 years ago

Hi @Pratiksha1903 , Is your server in INDIA ? or does the IP belong to INDIA ? Was it in production or development ?

heenahussain2 commented 3 years ago

I am having the same error 403 while trying to execute from the API documentation page and also while using the python requests library

idevesh commented 3 years ago

I am having the same error 403 while trying to execute from the API documentation page and also while using the python requests library

@heenahusain96 It shows error while executing from there API documentation page. But it works fine on Application What location your server is located? Have you added Header in your requests?

Pratiksha1903 commented 3 years ago

Hi @Pratiksha1903 , Is your server in INDIA ? or does the IP belong to INDIA ? Was it in production or development ?

No...what was the steps to host the Indian server....now I am trying this code in netsuite.

ShreePrince commented 3 years ago

image

I'm getting the forbidden message when i execute the API's can anyone please help on this ??

idevesh commented 3 years ago

image

I'm getting the forbidden message when i execute the API's can anyone please help on this ??

Are you passing header value in Headers If not pass it in the headers - User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.51

ShreePrince commented 3 years ago

Yes i tried passing the User agent in the header, but no luck..

saran-surya commented 3 years ago

Hi @Pratiksha1903 , Is your server in INDIA ? or does the IP belong to INDIA ? Was it in production or development ?

No...what was the steps to host the Indian server....now I am trying this code in netsuite.

The IP must be from INDIA to access the API's

saran-surya commented 3 years ago

Yes i tried passing the User agent in the header, but no luck..

Did you try passing it with JSON.stringify() or JSON.dumps in python ?

ShreePrince commented 3 years ago

Yes i tried passing the User agent in the header, but no luck..

Did you try passing it with JSON.stringify() or JSON.dumps in python ?

Actually im developing it in Javascript on ServiceNow platform, and it is the string which im passing.

saran-surya commented 3 years ago

Yes i tried passing the User agent in the header, but no luck..

Did you try passing it with JSON.stringify() or JSON.dumps in python ?

Actually im developing it in Javascript on ServiceNow platform, and it is the string which im passing.

you should be passing a json, try using JSON.Stringify()

prannoy-py commented 3 years ago

Just pass these headers along with the params in your get request. Worked for me in python.

{ "Accept-Language": "en_US", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.51" }

jaliph commented 3 years ago

This API has to be tried from the INDIA location only. the Cloudfront gateway won't allow NON INDIA origin API calls

PrashaanthT commented 3 years ago

@ShreePrince @Pratiksha1903 were you guys able to resolve this? Im also facing the same issue in snow

saran-surya commented 3 years ago

Hey @PrashaanthT , if you are using a NODE JS server, you can try using the server proxy I created, I am currently using it in my Heroku app for the same purpose, maybe this can help, https://github.com/saran-surya/cassata

Some people using it. comment : 232