The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.
10-13-2023 10:46 AM
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
Solved! Go to Solution.
10-14-2023 09:09 AM
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.
10-14-2023 09:09 AM
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.
10-14-2023 01:59 PM
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?
Welcome to the Community - here is your guide to help you get started!