Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The request could not be satisfied: 403 ERROR #228

Closed
indrajeetgour opened this issue May 16, 2021 · 27 comments
Closed

The request could not be satisfied: 403 ERROR #228

indrajeetgour opened this issue May 16, 2021 · 27 comments

Comments

@indrajeetgour
Copy link

Since I was trying to call the public API I am getting the following response, please let me know if I am making some mistake or anything that I need to fix.

code snippet for the same:(passing both pin_code and given_date in expected format)

URL = "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByPin?pincode={}&date={}".format(
    pin_code, given_date)

header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'}

result = requests.get(URL, headers=header)
print(result.text)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact 
the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: mo4dgtccAh8iMewIbrv_PrWKuqwZMbESimjzodoLLGDr0DJgM1skVw==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact 
the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: MkY_9o_Wo7dFvn-fxSLw5nnjXUy3nLROMxAR15b7SQUWt9Ckq21mWA==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
@indrajeetgour indrajeetgour changed the title he request could not be satisfied: 403 ERROR The request could not be satisfied: 403 ERROR May 16, 2021
@rohandhamapurkar
Copy link

If you have made more than 100 requests per 5 min from your IP address then the requests start getting blocked with this same 403 error.

@ninjabhishek
Copy link

ninjabhishek commented May 16, 2021

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

@indrajeetgour
Copy link
Author

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

Thanks for let me know this... I was using VPN. Now it is working fine.. Thanks

@Raxy45
Copy link

Raxy45 commented May 16, 2021

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

Thanks for let me know this... I was using VPN. Now it is working fine.. Thanks

Can you let me know what changes you made to your code ?! I'm using NodeJS and the app is deployed on heroku

@saran-surya
Copy link

saran-surya commented May 17, 2021

@indrajeetgour , Kindly let us know the steps, you added in. Were you using VPN in your local machine or did this error occur in production ?

@ninjabhishek
Copy link

@Raxy45 heroku servers are not located in India. you will not be able to hit APIs from there. you should move your code to AWS, GCP aur Azure servers in India.

@saran-surya
Copy link

@ninjabhishek , we can hit the Indian API through a server proxy, I have a package for it if you are using node JS app.

@ninjabhishek
Copy link

@saran-surya have you tried it in a prod server on any cloud providers? heroku is a PaaS and would not allow you to do these, and other cloud providers give you their public IP which I don't think you can change, since they must be having the public ip and actual server behind a routing table which would be disrupted when you use server proxy there. This is just my assumption, please let me know if I am wrong and you have done this successfully on public cloud servers.

Also, what is the package?

@saran-surya
Copy link

Yes @ninjabhishek , I have done this in HEROKU US based server, and it is working fine, Like the main idea is to use your local IP and wrap the server on top of it, Thus you have to login to the proxy room in your client and change them,

The package is https://github.com/saran-surya/cassata, Also there is documentation on setting up the server and accessing them, Hope it helps 😉

@indrajeetgour
Copy link
Author

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

Thanks for let me know this... I was using VPN. Now it is working fine.. Thanks

Can you let me know what changes you made to your code ?! I'm using NodeJS and the app is deployed on heroku

I just called my api from India hosted vm instead.

@saran-surya
Copy link

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

Thanks for let me know this... I was using VPN. Now it is working fine.. Thanks

Can you let me know what changes you made to your code ?! I'm using NodeJS and the app is deployed on heroku

I just called my api from India hosted vm instead.

Kindly elaborate the steps as they will be helpful.

@indrajeetgour
Copy link
Author

@indrajeetgour , Kindly let us know the steps, you added in. Were you using VPN in your local machine or did this error occur in production ?

I used the api call from my local machine where as I used VPN which was in Germany before I switch to India, and it is working now. I think govt has restricted the access as per country.

@saran-surya
Copy link

@indrajeetgour , Kindly let us know the steps, you added in. Were you using VPN in your local machine or did this error occur in production ?

I used the api call from my local machine where as I used VPN which was in Germany before I switch to India, and it is working now. I think govt has restricted the access as per country.

Yes they have GEO-FENCED the public data, thus they can prevent people from booking slots from other countries, for people in India,

@AkshayMathur92
Copy link

On top of this, make sure the requests are being sent from an Indian IP address. However, Indian IPs are rejected if you are using Digitalocean server as well. The above error code is because of IP not being detected as Indian origin

Yeah, I am facing the same issue. Why is this happening ?

@ninjabhishek
Copy link

@AkshayMathur92 they have done this to make sure people abroad do not put load on the api, and also because the vaccination drive is only for Indian people.

Which server or cloud are you facing this issue in?

@AkshayMathur92
Copy link

@AkshayMathur92 they have done this to make sure people abroad do not put load on the api, and also because the vaccination drive is only for Indian people.

Which server or cloud are you facing this issue in?

Apologies my question is not well-formed.
I am using Digital ocean droplet, Bangalore region. However, getting a 403 error.
My question is what can I do about it ?

@ninjabhishek
Copy link

@AkshayMathur92 if you are using node js, you can see @saran-surya comment above on his npm package to bypass this on cloud servers and access the API, if you still want to use digital ocean. if you are not using node js, I would suggest you move your code to Azure, GCP or AWS servers in Indian regions and it would work. I am using combination of python and java and my code are on azure and aws servers

@AkshayMathur92
Copy link

@AkshayMathur92 if you are using node js, you can see @saran-surya comment above on his npm package to bypass this on cloud servers and access the API, if you still want to use digital ocean. if you are not using node js, I would suggest you move your code to Azure, GCP or AWS servers in Indian regions and it would work. I am using combination of python and java and my code are on azure and aws servers

Following up on your advice , I created a server on AWS in both ap-south-1a & ap-south-1b , however both servers were facing the same issue.

@ninjabhishek
Copy link

@AkshayMathur92 can you share complete url you are trying to hit?

@AkshayMathur92
Copy link

AkshayMathur92 commented May 21, 2021

@AkshayMathur92 can you share complete url you are trying to hit?

I got the issue, I wasn't passing the user agent. Postman automatically adds the user agent by itself, but when you try to get the curl from that , it removes the user agent header.

@ninjabhishek
Copy link

@AkshayMathur92 ohh. we faced that too from our azure server in the beginning

@rcsrao
Copy link

rcsrao commented May 29, 2021

I am using Google Cloud functions and no luck with user-agent and Mumbai zone.

@ninjabhishek
Copy link

same code works on local?

@rcsrao
Copy link

rcsrao commented May 29, 2021

Yeah, same working in local and Google cloud VM instance too.

@ninjabhishek
Copy link

then cowin does not identify cloud functions ip as Indian origin. code deployed on digitalocean bangalore vm are also facing same issues. you would need to deloy on vm and send requests

@rcsrao
Copy link

rcsrao commented May 29, 2021

Yeah, I end up with deploying it in VM

@indrajeetgour
Copy link
Author

As we understood, had an issue with the geolocation other than India.

Now I am closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants