-
Notifications
You must be signed in to change notification settings - Fork 0
Strava API Calls
There are multi-steps to getting access to Strava Athlete information
-
You need to use the following API to get a user to approve access to their information : http://www.strava.com/oauth/authorize?client_id=40250&response_type=code&redirect_uri=http://localhost/exchange_token&scope=read,activity:read,activity:read_all&approval_prompt=force
-
You then need to exchange the code which comes back from this for an access code using the following api : https://www.strava.com/oauth/token?client_id=40250&client_secret=700b02392cd20d926d066de6a28601acb90772a8&code=1a7ee6bde672a19092178d00e7bd988e21cfc5fa&grant_type=authorization_code. The code is a temp one returned from 1.
This gives you an access code that lasts for 6 hours and a refresh code that can be used to refresh it as required.
You can then call the following API’s :
- Get Athlete information: https://www.strava.com/api/v3/athlete
- Get Activities for the user: https://www.strava.com/api/v3/athlete/activities
- Get the milage for a given piece of information: https://www.strava.com/api/v3/gear/b5361239
When you get back the access code for a user, you also get back a refresh code. This is used to refresh the access code when it has run out.
Full documentation for how to get and refresh the access codes can be found here: https://developers.strava.com/docs/authentication/
The full list of available API's can be found here: http://developers.strava.com/docs/reference/