Problem with obtaining GET all athlete activities in Strava API v3

4.2k Views Asked by At

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()
1

There are 1 best solutions below

0
On BEST ANSWER

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