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

Refresh token endpoint - Access Token always expires in 28800

Hi Support,

 

When asking for refreshing Access Token, it seems we always get a 28800 Access Token lifetime even asking for only 3600, like in the following request :

 

        url:        "https://api.fitbit.com/oauth2/token",
        method:     "POST",
        headers: {  "Content-Type": "application/x-www-form-urlencoded",
             "Authorization": "Basic 111222333444555AAABBBCCCDDDEEEEXAMPLE"
                  },  
        data:      'grant_type=refresh_token&expires_in=3600&refresh_token=refresh_token'
 
Am I wrong ?
 
Thanks,
 
Charles
                  

 

Best Answer
0 Votes
1 REPLY 1

Hi @Chuil,

 

When using the Authorization Code Grant Flow, access tokens have a default lifetime of 28800 seconds (8 hours).

 

expires_in optional

Specify the desired access token lifetime. Defaults to 28800.

3600 for 1 hour
28800 for 8 hours
Type: integer

 

See: https://dev.fitbit.com/build/reference/web-api/oauth2/#access-token-request

 

On a side note, 3600 is actually no longer supported. Our documentation is currently in the process of being revamped and will be removed in the future. 

 

I hope this helps! Let me know if you have any additional questions.

Best Answer