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

Activities in api call is empty

ANSWERED

When I make this call in Postman

https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2022 -09 -02&sort=asc&offset=0&limit=50  

The activities array is empty.
{
    "activities": [],
    "pagination": {
        "afterDate": "",
        "limit": 50,
        "next": "",
        "offset": 0,
        "previous": "",
        "sort": "asc"
    }
}

It's also empty if I do https://api.fitbit.com/1/user/-/activities/date/2022 -09 -22.json  - I get summary data but again activities is empty, and I know there's data for that day.  I can get the user profile so I know it's getting the right user, just not showing the activities information.

Is there some time lag before the activity data is available via the api?  Am I missing something in the url?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I believe I have found the answer.  When I manually created an activity I clicked on "activity record".

RichUchytil_0-1664303794956.png

I added some more activities but used the four options under Common activities.  All of those showed up when I did the get activity log list.  I tried changing the activity I created with activity record so the name matched one of the common activities names, but it still didn't show up.

 

I'm not sure why activity record entries don't show up, but now I know why the activity I entered didn't show up.

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

I went to swagger and tried to do the activities/list.json there.  It came back with the same json but also these responses:

Responses
Code Description
200 A successful request.

400 The request had bad syntax or was inherently impossible to be satisfied.

401 The request requires user authentication.

409 Returned if the given user is already subscribed to this stream using a different subscription ID, OR if the given subscription ID is already used to identify a subscription to a different stream.

 

Any ideas how to fix these?  I am logged into my FitBit account.

Best Answer
0 Votes

Man, wish you could edit/delete replies here.  Sorry, ignore my last reply, I read the output of swagger wrong.

Best Answer
0 Votes

I believe I have found the answer.  When I manually created an activity I clicked on "activity record".

RichUchytil_0-1664303794956.png

I added some more activities but used the four options under Common activities.  All of those showed up when I did the get activity log list.  I tried changing the activity I created with activity record so the name matched one of the common activities names, but it still didn't show up.

 

I'm not sure why activity record entries don't show up, but now I know why the activity I entered didn't show up.

Best Answer
0 Votes