02-15-2020 16:59
02-15-2020 16:59
Is there a tutorial how to display my active alarm (i.e. 7:30a.m.) on the clockface? I've been fiddling with the companion app, but i've had no success.
Im trying to make the GET call to the devices as per these instructions here:
https://dev.fitbit.com/build/reference/web-api/devices/#alarms
But i get an error: {"errors":[{"errorType":"system","fieldName":"n/a","message":"Authorization Error: Invalid authorization token type"}],"success":false}
This is my code:
let url = "https://api.fitbit.com/1/user/-/devices.json";
fetch(url).then(function(response) {
return response.text();
}).then(function(text) {
console.log("Got JSON response from server: " + text); });
Am i going in the right direction? Any direction would be appreciated.
02-15-2020 17:51
02-15-2020 17:51
You're going to have to get through the oauth stuff. The Settings API oauth button may help, as might this example.