cancel
Showing results for 
Search instead for 
Did you mean: 

API Registration Issues

SpillerGray
Mt. Kenya

Hi! I have been trying to set up an API that will extract activity data based on dates. 

Unfortunately, I have been experiencing issues with the API registration.
I have been following the guide (in the api guidelines) step by step but I keep coming to an error at step 11 (link to steps here: https://developers.strava.com/docs/getting-started/)
When I input my version of the link (same exact link I have checked.. a lot..) shown in the screenshot (using postman), I am returned a 404 error message.
The only difference from the tutorial that I get when going through the steps is at step 6. If you look at the screenshot (right below step 6) you will see that the user has the opportunity to check a box saying "view data about your activities". I am not shown this box, I only see the first one "view data about your public profile (required)".
Some help on how to do this would be awesome!
Thanks. 
1 REPLY 1

ActivityFix
Kilimanjaro

For Step 6, the checkboxes shown will vary based on the scopes you request. I believe since the original documentation was written Strava has added additional scopes so the screenshot no longer matches the URL. Scopes are listed @ https://developers.strava.com/docs/authentication/#detailsaboutrequestingaccess. To get an equivalent set of checkboxes to the image you would need read and activity:read, so your URL would be:

http://www.strava.com/oauth/authorize?client_id=[REPLACE_WITH_YOUR_CLIENT_ID]&response_type=code&redirect_uri=http://localhost/exchange_token&approval_prompt=force&scope=activity%3Aread%2Cread

As to the 404 error, I'm not sure what to tell you on that one. I just tested it locally with postman and it worked fine for me. In case it helps, the exact steps I followed:

  1. Enter the above URL with my client ID into my browser. After clicking accept, I got "this site cannot be reached" as expected
  2. In postman:
    1. Set request type to POST
    2. URL = https://www.strava.com/oauth/token
    3. Set query params as shown in the image on the API guide. There are 4 total parameters:
      • client_id and client_secret come from https://www.strava.com/settings/api (you need to click "show" for your client_secret).
      • code is the value in the URL you ended up with after step 1.
      • grant_type = authorization_code
    4. Click send. You should get back a valid response.

One other thought, although I don't think it matters for this step, is to edit your app (in Strava) to have its Authorization Callback Domain set to localhost.