11-10-2016 08:36 - edited 11-11-2016 09:38
11-10-2016 08:36 - edited 11-11-2016 09:38
I am polling data from the api for about dozen users Most users' data poll just fine (my code loops through each user polling daily data), but two users have issues.
For a few days at the start date of the polling the api returns "{"errors":[{"errorType":"expired_token","message":"Access token expired: ..."
And then a majority of the time the data that is returned from the api is just zeros. I have checked with the person wearing the fitbit and there should be data there, not just zeros and is not isolated to just sleep data. Zeros are being returned for activities, etc. as well.
Example json:
{"sleep":[],"summary":{"totalMinutesAsleep":0,"totalSleepRecords":0,"totalTimeInBed":0}}
How can an auth token be invalid for one request but then bad for the next? My code calls for a refresh token and makes the request and then loops to the next user (I have the loop set slow enough so I'm not hitting the api limits), so it is the same code that does the request each time.
Any insight is appreciated.
Answered! Go to the Best Answer.
11-10-2016 18:03
11-10-2016 18:03
I corrected my error for the "expired_token" issue.
11-10-2016 18:03
11-10-2016 18:03
I corrected my error for the "expired_token" issue.