Got 200 for /athlete but 401 for /athlete/zones

75 views
Skip to first unread message

Wang Yngwie

unread,
Jan 27, 2023, 9:37:27 PM1/27/23
to Strava API
I got 200 response when I request /athlete, but when I request /athlete/zones, I got 401:

```
{
  "message": "Authorization Error",
  "errors": [
    {
      "resource": "AccessToken",
      "field": "profile:read_all_permission",
      "code": "missing"
    }
  ]
}
```
How can I get profile:read_all permission?

Jan M.

unread,
Jan 29, 2023, 6:35:43 AM1/29/23
to Strava API
You have to request an AccessToken with the appropiate right ( profile:read_all)  first, see https://developers.strava.com/docs/authentication/

Mauro Tangari

unread,
Jun 13, 2023, 12:34:36 PM6/13/23
to Strava API
Good afternoon, 
I'm basically facing the same issue as Wang.
I have read the documentation but it's not crystal clear to me if there is the need to request two Tokens - one "read" and one "activity:read_all" - or is it enough to request just one Token "activity: read_all".

Thanks for your help!

Jan M.

unread,
Jun 15, 2023, 5:21:05 AM6/15/23
to Strava API
You need only one token, but that with all the permissions.

Mauro Tangari

unread,
Jun 15, 2023, 7:01:24 PM6/15/23
to Strava API
Thanks Jan,
so my initial assumption was correct.
I'm trying to write a web application in .net and I have decided to use the StravaDotNet api (here: https://github.com/chrisbarber7/stravadotnet)


localhost:8620/default.aspx is my .net web application

2) I click on the "Authorize" button and I'm redirected to http://localhost:8620/default.aspx?exchange_token&state=&code=[TOKEN_JUST_GENERATED]&scope=read,activity:read_all

3) According to the examples i found at the  https://github.com/chrisbarber7/stravadotnet, I should be now able to create a new instance of the class:

StaticAuthentication auth = new StaticAuthentication("<token here>");
StravaClient client = new StravaClient(auth);

I'm uncertain about how to replace the "token here".
- if i pass the [TOKEN_JUST_GENERATED] i always get a 401 error even if i try to call the GetAthlete
- if i pass the Access Token (I found it in my API settings on strava website), at least i'm able to call the GetAthlete and see my first and last name (but no clubs, no followers, no friends...strange isn't it?) and always get a 401 error when i try to call the GetActivities

Do you see any error in the procedure above? Am I doing something wrong??
Thanks for your support.
Mauro

Jan M.

unread,
Jun 16, 2023, 3:26:14 AM6/16/23
to Strava API
For the scope you have only requested activity:read_all. Please try it with read_all,profile:read_all,activity:read_all

Mauro Tangari

unread,
Jun 16, 2023, 3:41:06 AM6/16/23
to Strava API
Unfortunately it seems not to be working, even if i try with "scope=read_all,profile:read_all,activity:read_all"

But my main question is always the same: what's the right token to be passed to the class intance?
- Token from the querystring
- access token
- any other idea...

Thanks!

Reply all
Reply to author
Forward
0 new messages