Skip to main content

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

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


Reply