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

expired_token on some request but not others

ANSWERED

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.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I corrected my error for the "expired_token" issue.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

I corrected my error for the "expired_token" issue.

Best Answer
0 Votes