STRAVA_API
{
"file": /path/to/file.txt, // {File} The uploaded file.
"name": name_example, // {String} The desired name of the resulting activity.
"description": description_example, // {String} The desired description of the resulting activity.
"trainer": trainer_example, // {String} Whether the resulting activity should be marked as having been performed on a trainer.
"commute": commute_example, // {String} Whether the resulting activity should be tagged as a commute.
"dataType": dataType_example, // {String} The format of the uploaded file.
"externalId": externalId_example // {String} The desired external identifier of the resulting activity.
}
https://resmedglobal.atlassian.net/secure/CreateIssue.jspa?issuetype=2&pid=ISMS2
https://resmedglobal.atlassian.net/secure/CreateIssue.jspa?issuetype=3&pid=ISMS2
OAuth2.0 strava / pebble
1 - get activity:write authorization (once and for all)
GET https://www.strava.com/oauth/authorize?client_id=94880&response_type=code&redirect_uri=http://strava.jonget.fr&approval_prompt=force&state=bike_companion&scope=activity:write
monitor state, code and scope (as upload can be unchecked)!
code is short lived and one time usage
2 - get tokens in exchange of code
POST https://www.strava.com/oauth/token?client_id=94880&client_secret=08dc170f0fe38f39dd327bea82a28db4400e6f00&code=e0aeb60ea9f508d25974bb56ccb551be56b91470&grant_type=authorization_code
refresh & access tokens + expiry of access token (6hours) retrieved
3 - test if access token expired
4a- if not, API call
GET https://www.strava.com/api/v3/athlete with "Authorization" header ="Bearer XXXXX" XXXXX=access token
4b- if yes refresh access token with refresh token get in 2
POST https://www.strava.com/oauth/token?client_id=94880&client_secret=08dc170f0fe38f39dd327bea82a28db4400e6f00&refresh_token=XXXXXXX&grant_type=refresh_token