02-21-2020 13:34
02-21-2020 13:34
Hi, I'm trying to get the food intake information for the user and display it on the watch. I am using a companion to try to do this, but can't seem to get it working (or if I even need the companion). The only way I've found to get this information was using the Web API, but I am getting an error message :
{ errorType: 'system',
fieldName: 'n/a',
message: 'Authorization Error: Invalid authorization token type' } ],
success: false }
Is there another way to pull the calorie intake (user input) without the need to use the web API. If not, any suggestions as to what could be causing this error.
PS. I am using the URL "https://api.fitbit.com/1/user/-/foods/log/date/2020-02-20.json"
02-25-2020 12:40
02-25-2020 12:40
There's a full example here https://github.com/fitbit/sdk-oauth
It includes everything you need, including documentation to correctly setup the app, plus all of the code for device, companion, and settings.