'Problem with obtaining GET all athlete activities in Strava API v3
I would like to access my own activities using the Strava API in Python. I've researched the responses to the question below, but am still bumping into errors. Who can help me retrieve the data?
Problem with access token in Strava API v3 GET all athlete activities
I have tried the suggested answer, but am still getting an error. I've gone through steps 1-3 suggested, obtaining an access_token
when I've set scope=activity:read_all
in step 1. When trying to obtain all my activities, I get thrown the following error: {'message': 'Authorization Error', 'errors': [{'resource': 'Athlete', 'field': 'access_token', 'code': 'invalid'}]}
The code I'm using after step 3 is:
activities_url = "https://www.strava.com/api/v3/athlete/activities"
access_token = res.json()['access_token']
header = {'access_token': access_token}
activities = requests.get(activities_url, headers=header).json()
Solution 1:[1]
Give a look at the official documentation, section C. How to Make a cURL request
.
For every request you have to send an authorization header of this type:
Bearer YOURACCESSTOKEN
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |