Closed AdityaMitra5102 closed 3 years ago
@AdityaMitra5102, the function call works fine for me. However, when I try the url you have pasted above, it does not work since there is a public
missing as part of the url and also the date format should be 04-05-2021
(DD-MM-YYYY
). Trying the following in the browser does return the correct result
https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByPin?pincode=700091&date=04-05-2021
@backtrackbaba, the url is probably incorrect in the constants file and worked for me maybe by chance. The correct url can be found here. Shall I create a pull request to update the line from
availability_by_pin_code_url = f"{base_url}/appointment/sessions/calendarByPin"
to
availability_by_pin_code_url = f"{base_url}/appointment/sessions/public/calendarByPin"
?
Yeah it would be better then
@AdityaMitra5102, I updated my comment above, your date format is also incorrect.. can you try rerunning with the correct date format ?
Hi @DragonWarrior15, great work on finding the bug. Please go ahead and create a PR. I found the solution to the same issue from your comment. Thanks!
401 Client Error: Unauthorized for url: https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByPin?pincode=700091&date=04-05-21
Error when get availability by pincode method is run