@Hellangel1987 said in Fitbit:
@kckndrgn
dont know exactly but im also interested in your cronjob solution, can you inform us about your steps ? im tired getting every day that setupaccess working :(
I haven’t done it, yet, just thinking about it since it was mentioned. I think I’ve narrowed down the issue though:
{"message": {"401": {"errors": [{"message": "Access token expired: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0NU5QMzUiLCJhdWQiOiIyMjdRVjkiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3aHIgd3BybyB3bnV0IHdzbGUgd3dlaSB3c29jIHdhY3Qgd3NldCB3bG9jIiwiZXhwIjoxNDcxNzAxNjYzLCJpYXQiOjE0NzE2NzI4NjN9.VvLWtyYYvVShgrWC4UOVMXfdv0uiy7Nic-WDj7RMiKA. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.", "errorType": "expired_token"}], "success": false}}, "type": "error"}
{"message": "Getting a new access token", "type": "status"}
{"message": "Error getting new access token", "type": "error"}
{"message": {"400": {"errors": [{"message": "Refresh token invalid: 4292cf037821b9441122e432bdd92a238fac61028dfbd6be982d2e6b73474c32. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.", "errorType": "invalid_grant"}], "success": false}}, "type": "error"}
First got an “expired” token notice, then the process tries to get a new token (possibly using the “refresh” token, I’m not sure at this point). But refresh tokens are valid for one use only, so it’s like the updated token is getting updated in the token.ini file.