Skip to content
Advertisement

Fitbit Auth 2 Api integration without Token expired

Currently, I am working/integrating Fitbit API on my Yii2 framework.

Code sample like this:

JavaScript

API Integration is currently done and working fine, but after a certain time token expired, I never want customers again and again to accept a request, I want customers to accept requests once and never expired token and not need to connect again and again.

Any Idea how to prevent token expiration?

My refresh code URL is: https://github.com/namelivia/fitbit-http-php

Advertisement

Answer

You can use URL ‘https://api.fitbit.com/oauth2/revoke’ and your existing access_token for refresh or regenerate.

JavaScript

Full Example are:

JavaScript

You should read fitbit auth2 document also for more details about parameters: https://dev.fitbit.com/build/reference/web-api/oauth2/

and check full code : https://github.com/djchen/oauth2-fitbit/tree/master/src/Provider

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement