Open madprime opened 5 years ago
There's a temptation to clean up with versioned files and stuff but here’s an approach I think might be lossless and a lot easier.
fitbit_urls
that stores all the relevant data from the new endpointI think this is “good enough” as I expect it’s lossless, gets the new data, and allows (further) cleanup at some later date (which I don’t expect to happen, but at least it hasn’t been rendered impossible). It should be backwards compatible as long as something using the data isn't upset by the appearance of a new key (which seems very unlikely).
Looking at this: https://github.com/OpenHumans/oh-fitbit-integration/blob/master/datauploader/tasks.py
... it seems that the endpoint is going to
https://api.fitbit.com/1/user
That prefix is still used for the following:
https://api.fitbit.com/1/user/[user-id]/activities/tracker/...
https://api.fitbit.com/1/user/[user-id]/activities/heart/...
https://api.fitbit.com/1/user/[user-id]/activities/body/...
However from the sleep documentation: https://dev.fitbit.com/build/reference/web-api/sleep/
... I see the endpoint seems to be updated to be like
https://api.fitbit.com/1.2/user/-/sleep/
. (Note the "1.2".)I was looking into this because I'd like to be collecting the sleep stages data (minute-by-minute information about which "stage" of sleep is occurring), which appears to be available in this new endpoint. (I think the old one is working but deprecated: https://dev.fitbit.com/build/reference/web-api/sleep-v1/ )