Skip to main content
Answered

Get activity by id 404

  • May 30, 2023
  • 4 replies
  • 165 views

Forum|alt.badge.img+1

Hey, 
I have started working with Strava API and on the beginning I have problem. I authenticate from my app using scope: read_all,profile:read_all,activity:read_all, I can get all my activities but when I'm trying to get one I have 404. I use http get on 

https://www.strava.com/api/v3/athlete/activities/{id}?include_all_efforts=true where id is number which I take from previous request about list of activites. I use id property from item. I have seen in examples that id is longer than I see on my activities (for example my is 9158500198 but in examples numbers are longer like 123456778928065). What can be a problem?

Best answer by Jan_Mantau

Ah, now I see it: You have "athlete/" in the URL, that doesn't belong there.

4 replies

Jan_Mantau
Superuser
Forum|alt.badge.img+26
  • Superuser
  • May 30, 2023

Ids like 9158500198 are okay, that's in the current range of activity ids. You don't use the curly brackets in the URL though, they are only a syntax hint, that id isn't a fixed string.


Forum|alt.badge.img+1
  • Author
  • Hub Rookie
  • May 30, 2023

I don't use brackets in request. I put them as variable sign. My request url is https://www.strava.com/api/v3/athlete/activities/12345 where 12345 is my activity id from activities list. 


Jan_Mantau
Superuser
Forum|alt.badge.img+26
  • Superuser
  • Answer
  • May 30, 2023

Ah, now I see it: You have "athlete/" in the URL, that doesn't belong there.


Forum|alt.badge.img+1
  • Author
  • Hub Rookie
  • May 30, 2023

You are right! My fault. Thanks!