cancel
Showing results for 
Search instead for 
Did you mean: 

Help with GET /activities/{id}

centrium
Shkhara

Hi all, 👋🏻

Wondering if there is any help on what I might be doing wrong, I am building an app and have implemented the OAuth with the following scopes when i user signs in and adds the app. The scopes are read, activity:read, activity:read_all and activity:write

I can use the token that I get to get a list of all my activities, but when I try to get the activity using an ID returned from one of my activities in the list I am receiving the following 401 error.

"field": "Not allowed to view unauthenticated activities",

What I don't understand is the activity is not hidden, or private, it is available to everyone.  

I am confused why I would be getting this error.

Any help or guidance as to why I might be getting this error would be appreciated.

TIA

1 ACCEPTED SOLUTION

The request was just a GET request to the following:

https://www.strava.com/api/v3/activities/<activityId>

So replace the activityId with the Id of the activity you will be allowed access to from your AccessToken.  The access token I assume you are passing in the Auth header as a Bearer.


Not sure if it helps, but heres a generated CUrl request from Postman

curl --location 'https://www.strava.com/api/v3/activities/<activityId>' \
--header 'Authorization: Bearer <accessToken>' \
--data ''

View solution in original post

5 REPLIES 5

centrium
Shkhara

Apologies, as soon as I sent the message I realised my error was how I was constructing the API request 🤦🏻‍♂️

could you share how you fixed that?

Hey, yea it was how I was making the request, I thought {id} needed to be passed into the body, but actually its just a request with id being part of the URI.  So turned out it was /activities/12345678 rather than /activities with {id} being as part of the request.  Hopefully that makes sense and helps you. 

I did the same like you but it still didnt work, I still got into this issue "field""Not allowed to view unauthenticated activities". Can you share your sample request?

The request was just a GET request to the following:

https://www.strava.com/api/v3/activities/<activityId>

So replace the activityId with the Id of the activity you will be allowed access to from your AccessToken.  The access token I assume you are passing in the Auth header as a Bearer.


Not sure if it helps, but heres a generated CUrl request from Postman

curl --location 'https://www.strava.com/api/v3/activities/<activityId>' \
--header 'Authorization: Bearer <accessToken>' \
--data ''

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