Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Daily activity summary - friends

I am unable to get daily activity summary of friends on my fitbit account. I am using the end point as 

https://api.fitbit.com/1/user/[userID]/activities/date/[date].json., this works perfect for me. But, when i try to get my friends summary, i get an exception (API client is not authorized by the resource owner to access the resource requested). From the earlier posts in the forum, i understand that for the Intraday summary, i have to request permissions. 

 

Are there any special permissions/access to be requested for accessing friends daily summary through web API?

Best Answer
0 Votes
12 REPLIES 12

I also have the same issue and last 2 days activity summary not being populated correctly. 

API: https://api.fitbit.com/1/user/<user_id>/activities/date/today.json

 

Best Answer
0 Votes

@KKN127 You can't access other users' data, they have to give permission by authorizing your app. Once they authorize, then you can make requests on their behalf.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

This is working again! For few days it didn't work and now back again. 

Anything going on with the API services?

Best Answer
0 Votes

@gajen.sunthara It doesn't look like there's been any recent incidents: http://www.fitbitstatus.com/

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

A little late here, but I'm also having the same problem. Requests for my own data (https://api.fitbit.com/1/user/-/activities/steps/date/today/1w.json) work fine, but requesting data for any of my Fitbit friends (https://api.fitbit.com/1/user/123456/activities/steps/date/today/1w.json) does not work and returns a 403 "API client is not authorized by the resource owner...".

 

The users have authorized my app and according to the other posts here it should work after that. Though I'm curious about specifically what "on their behalf" actually means? Any ideas would be very helpful.

 

For more context, what I'm trying to do is within my app, compare the logged in user's step data with any of their friends who have authorized the app. They click on their friends name and it shows their step data side by side along with their friends.

 

 

Best Answer

@KKN127 were you able to get this working? I am still not able to.

Best Answer
0 Votes

@solidsnake If they have authorized your app (and allowed whatever scopes you need), then it's likely that you're using the incorrect access token when requesting their data. Each user authorization creates a unique access token, which can then be used to make requests.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@AndrewFitbit Thanks for your reply! I think I may not be understanding something here. So in a situation where I am authorized, is it possible for me to view my stats alongside my friends, who has also authorized the same application?

 

When you say "each user authorization creates a unique access token..." it sounds like a user can access only their own data using the access token that they get after authorizing? Is that true?

 

 

Best Answer
0 Votes

@AndrewFitbit not sure if you saw my reply but any help here would be greatly appreciated!

Best Answer
0 Votes

@solidsnake You can't access other users' accounts with your own token because that token is specifically for the account that authorized the app (yours), you need to use their access token (or another user's access token) if you want to access data other than your own. Access tokens are obtained when a user authorizes your app.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

@AndrewFitbit thanks for your reply.

Best Answer
0 Votes

Hello, I believe Im having a related issue. I am able to complete a request with the access token, but the activity values for today and all previous days are empty when the fitbit is in fact working. Similarly heart rate and other activity details are all zeros.

 

Here's my request and output
curl -X GET 'https://api.fitbit.com/1/user/{user_id}/activities/date/today.json' -H 'Authorization: Bearer eyJhbGciOiJ.....'
{"activities":[],"goals":{"activeMinutes":30,"caloriesOut":2865,"distance":8.05,"floors":10,"steps":10000},"summary":{"activeScore":-1,"activityCalories":0,"caloriesBMR":1007,"caloriesOut":1007,"distances":[{"activity":"total","distance":0},{"activity":"tracker","distance":0},{"activity":"loggedActivities","distance":0},{"activity":"veryActive","distance":0},{"activity":"moderatelyActive","distance":0},{"activity":"lightlyActive","distance":0},{"activity":"sedentaryActive","distance":0}],"elevation":0,"fairlyActiveMinutes":0,"floors":0,"lightlyActiveMinutes":0,"marginalCalories":0,"sedentaryMinutes":826,"steps":0,"veryActiveMinutes":0}}

 

 

 

Best Answer
0 Votes