cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.

Users not able to register

sriviggu2002
Mt. Kenya
URL Used to authorize:
 
http://www.strava.com/oauth/authorize?client_id=XXXXXX&response_type=code&redirect_uri=http://dumy.c...

Though I get their code as response, the count of registered users doesnt increase or I am unable to get the data using API.
 
FYI: Currently I have only 1 registered users and thats me.
Max users can register is 999.
 
Can you please help.
4 REPLIES 4

ActivityFix
Superuser
Superuser

The count shown in the API page is delayed (I'm not sure by how much) so you won't see new users reflected right away.

As for getting data using the API, what error message are you receiving when you make a request? That should give some guidance on what is wrong.

https://www.strava.com/api/v3/athlete

Using this the API is returning only 1 athlete not the others who have authorized.

I am getting unauthorized error. Though I am providing valid code
 
"message": "Authorization Error",
    "errors": [
        {
            "resource": "Athlete",
            "field": "access_token",
            "code": "invalid"

Merging your two replies --

All API calls are specific to a single athlete. You have to use the access token for the athlete whose data you are trying to retrieve (or update). For example, the API call you've referenced is getLoggedInAthlete -- note that it is named "get logged in athlete" so it only applies to a single athlete. The access token you provide when making the call determines whose data you are getting. For other API calls where you provide a specific activity ID (e.g. getActivityById) you need to make sure the access_token you provide is the one for the user whose activity ID you are looking up.

Also keep in mind that access tokens expire after some time (a few hours. I forget the exact number - the expiration timestamp is given when you get the token). Once the token is expires you will need to use the refresh token to get a new access token for that athlete. The refresh token is sent when the athlete initially authorizes your app.

Since you are getting an invalid access_token error on your API call to https://www.strava.com/api/v3/athlete, my guess is that the token you're using is expired.