cancel
Showing results for 
Search instead for 
Did you mean: 

Bikes Section Not Appearing with GET Athlete call

nbt1032
Mt. Kenya

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

 

 

 

 

1 ACCEPTED SOLUTION

Jan_Mantau
Denali

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.

View solution in original post

2 REPLIES 2

Jan_Mantau
Denali

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?

 

 

 

 
 
 
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