Showing results for 
Search instead for 
Did you mean: 

using api, can get stats but not activities

Mt. Kenya

Trying to set up a web page for my sister-in-law, using my own python code and web page as a template.

I can get her stats ok, but I get a 401 error returned when I try to get her activities. At the bottom of this message is what I get returned when I try to get her last five activities (I have replaced the Bearer code with **bleep**).

I have her client_id, client_secret, refresh_token, access_token, athelete_id, grant_type, (authorization code) and the corrected paths for her stats file, auth file and activities file in a .env file and have double, triple and quadruple checked them for accuracy- what am I missing?

I don't understand why stats works, but activities doesn't. 

My own running web page is here-

The stripped-down version with just the strava bits for Sue is here-

Her activities are currently showing some old ones of mine as placeholders..


Any help/ideas greatly appreciated.



root@odroid:/var/lib/strava/Sues# ./
Token has not expired, returning
Getting activities {'Authorization': 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
Response code = 401
Token saved




Maybe it's the common problem with the insufficient scope, see here:

Thanks Jan-Mantau- I did think about that, but I checked my own page and that is read permission only and gets both stats and activities with no problem.