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

How to generate bearer token for the public APIs #206

Open kprageet opened 3 years ago

kprageet commented 3 years ago

I am trying to use "https://cdn-api.co-vin.in/api/v2/auth/public/generateOTP", looks like it expects the bearer token. Could you please share endpoint to generate the token.

kprageet commented 3 years ago

When I try to run curl -X POST "https://cdn-api.co-vin.in/api/v2/auth/public/generateOTP" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"mobile\":\"9741234786\"}" I am getting Forbidden response. {"message":"Forbidden"}

Could you please share the endpoint for bearer token generation

gautam404 commented 3 years ago

@kprageet You need to pass User Agent

kichappa commented 3 years ago

@kprageet this is undocumented at API Setu. Public APIs don't seem to work for generateOTP. Use protected, production ones.