Skip to main content
Answer

Error getting access token and refresh token

  • June 18, 2024
  • 1 reply
  • 91 views

Forum|alt.badge.img+2

I'm following this tutorial here, and the step at https://www.youtube.com/watch?v=sgscChKfGyg&list=PLO6KswO64zVvcRyk0G0MAzh5oKMLb6rTW&index=1 doesn't work for me. Specifically, it's the step where we have a "code" read:all access and we exchange it for an an access token and a refresh token by sending a request of the form

https://www.strava.com/oauth/token?client_id=ID&client_secret=SECRET&code=CODE&grant_type=authorization_code

when I do this with my value of ID, SECRET, and CODE I get a page that just says "{"message":"error"}" or I get the 404 page with the red traffic light (I've tried it several times with a few variations on the scope I'm requesting).

Best answer by ActivityFix

When you do the step to exchange the code for an access token, are you using Postman or cURL to generate a POST request? If you're using Postman make sure you change the request type to POST since it defaults to GET. If you're using cURL make sure you have -X POST

https://developers.strava.com/docs/getting-started/#oauth

1 reply

ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • Answer
  • June 18, 2024

When you do the step to exchange the code for an access token, are you using Postman or cURL to generate a POST request? If you're using Postman make sure you change the request type to POST since it defaults to GET. If you're using cURL make sure you have -X POST

https://developers.strava.com/docs/getting-started/#oauth