Skip to main content
Question

using api, can get stats but not activities


Forum|alt.badge.img+1

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-

https://vk7krj.com/running.html

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

https://vk7krj.com/Sues%20running.html

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

 

Any help/ideas greatly appreciated.

Ken.

****************************************************

root@odroid:/var/lib/strava/Sues# ./get_strava_activities.py
Token has not expired, returning
Getting activities
https://www.strava.com/api/v3/athlete/activities?per_page=5 {'Authorization': 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
Response code = 401
Token saved

******************************************************

Jan_Mantau
Superuser
Forum|alt.badge.img+26

Forum|alt.badge.img+1
  • Hub Rookie
  • August 7, 2023

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings