Skip to main content

When I make the following call, I am expecting to see a bikes section at the bottom.
curl -X 'GET' ...athlete

All I get is this:

{
"id": xx,
"username": null,
"resource_state": 2,
"firstname": "xx",
"lastname": "xx",
"bio": "",
"city": "Toronto",
"state": "Ontario",
"country": "Canada",
"**bleep**": "M",
"premium": false,
"summit": false,
"created_at": "2016-03-22T12:11:56Z",
"updated_at": "2022-07-25T11:15:44Z",
"badge_type_id": 0,
"weight": 78.0178,
"profile_medium": xx",
"profile": ",
"friend": null,
"follower": null
}

In the sample code, I see this extra section

"bikes" : [ {
"id" : "b12345678987655",
"primary" : true,
"name" : "EMC",
"resource_state" : 2,
"distance" : 0
} ],
"shoes" : [ {
"id" : "g12345678987655",
"primary" : true,
"name" : "adidas",
"resource_state" : 2,
"distance" : 4904
} ]

For the authenticated user, I would like to get a list of bikes. Is there any reason this is not working. I have 2 bikes showing on my strava settings page under My Gear.

Another interesting side note and possible related, is that if i look at the URL for a specific bike, I see it has a query parameter that is the bike ID code. If I type this into the API to inspect the gear, it tells me that the ID is not valid.

Any thoughts on this would be helpful.

Thanks,
Marc

 

 

 

 

Maybe you're using the access token from the Strava API setup page, that is restricted to scope "read" and you get only some basic athlete information. You need the scope "profile:read_all" for the bike and shoe list to appear.


That did the trick.  I was indeed using the token from the strava api setup page.  Thx.

I am still learning this, but a followup question.  The above was using the Swagger UI test environment.   It generates the curl request with an updated bearer token.  I am testing this in Postman.  The generated bearer token from swagger is working, but how would I get that in code?

 

 

 

 
 
 

Reply