Skip to main content
Question

Strava API Streaming

  • January 5, 2024
  • 4 replies
  • 120 views

Forum|alt.badge.img+2

Howdy folks! I have an issue I simply cannot figure out. 
I am trying to stream data from an activity. I am using postman to test my queries. 

As we can see, the activity is real and works. The key has read all and read permissions for activities via 

scope=read,read_all,activity:read_all,activity:read,profile:read_all

However, the stream query is not working. 

Any insights would be super appreciated.

4 replies

ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • January 6, 2024

The error message you've received says "Authorization Error" which means there's a problem with the token you're passing to the request. Looking at the URL in your get request, it appears there's an extra ? before the access_token parameter which is probably what is causing your problem. I'm not actually sure why your getActivity call worked as that has the same issue.


Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • January 6, 2024

It doesn't work without the question mark


Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • January 6, 2024

Update: 

This gives me a stream of distance, and does so with different parameters or without the parameters, as long as I have the code. But if I remove the forward slash prefacing the parameters, it doesn't work at all.


ActivityFix
Superuser
Forum|alt.badge.img+24
  • Superuser
  • January 11, 2024

This worked for me:

https://www.strava.com/api/v3/activities/<ACTIVITY_ID_HERE>/streams?keys=time,distance,watts&key_by_type=true&access_token=<YOUR_ACCESS_TOKEN>

Make sure your access token is valid and not expired.