Hi everybody
Currently, I haven't found a solution to get all registered user's activities, does anyone have any solution?
Hope to receive help from everyone
Hi everybody
Currently, I haven't found a solution to get all registered user's activities, does anyone have any solution?
Hope to receive help from everyone
Which kind of activities do you miss?
Currently, I only receive information for 1 athlete, I want to get information for all
If you mean all users who have authorized your app, you will need to make calls to getLoggedInAthleteActivities with the auth token for each authorized athlete.
If you mean all Strava users, that is not possible. You can only retrieve activities for athletes who have authorized your app.
That's right, I only want to get the list of registered people, but the API /athlete/activities can only get the list of each person, how can I get all of it?
Thank you for your help
As I said in my previous reply, you need to make a call to getLoggedInAthleteActivities for each user. One of the parameters to the function call is the access token, so you would need to make the call with the token for each registered user. There is no way to get it all in a single call since all Strava API calls only return data for the user whose access token you are using, and getLoggedInAthleteActivities can return at most 200 results per call.
In pseudocode it looks something like this at a bare minimum
all_activities = [] //Empty array
foreach registered user:
token = get_auth_token(user) //Either from a cache if the token isn't expired, or using oauth + refresh token if it is
current_page = 0
do:
activities = getLoggedInAthleteActivities(page=current_page, per_page=200, access_token=token)
all_activities.append(activities)
current_page++
while (activities.length == 200) //Kind of a hack but it will work. It would be better to also compare the last activity timestamp against the 'after' argument
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.