cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.

using api, can get stats but not activities

Sue
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-

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

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

2 REPLIES 2

Jan_Mantau
Superuser
Superuser

Maybe it's the common problem with the insufficient scope, see here: https://communityhub.strava.com/t5/developer-discussions/quot-field-quot-quot-activity-read-permissi...

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.

Ready, Get Set, Go!

Welcome to the Community - here is your guide to help you get started!


Know how to use Community


Understand Community Settings