09-09-2019 09:49 - edited 09-10-2019 08:08
09-09-2019 09:49 - edited 09-10-2019 08:08
Hello, I'm thinking of subscribing to the Subscriptions API in order to get near-real-time notifications on "unusual" heart rate values coming from the device's user.
If not smaller, a 60 second time span between notifications would be enough.
Although it's an old topic, JeremiahFitbit's reply on a similar question points out that the activities endpoint, which is provided in the Subscription API, contains info about the heart rate. This is true but, it only contains the four heart rate zones, and I need a more granular representation of the values.
Is this possible at all, or am I bound to constantly poll the Web API for this?
Thanks
09-10-2019 07:21
09-10-2019 07:21
Hi @kazy28
The Web APIs can return heart rate data in 1sec and 1min intervals through our Intraday functionality. Personal application types automatically give you intraday access to the application owners heart rate data. If you need intraday from other users, you'll need to request it by filling out this form: https://dev.fitbit.com/build/reference/web-api/intraday-requests/.
However, the subscription API is not going to provide near real-time access to heart rate data. The subscription api is used to notified your application when a user has sync'd their device with their fitbit account. The device and mobile app automatically sync every 15 minutes.
If you're looking for near real-time heart rate data, my recommendation is to look at the Device SDK. The Device SDK gives you the ability to build an application for the smart watches (Ionic and Versa family) and pull the heart rate directly off the device to your server via a companion application. If you want to investigate the Device SDK, the documentation can be found here: https://dev.fitbit.com/build/reference/device-api/. Support for the Device SDK is managed through the forums at this location: https://community.fitbit.com/t5/SDK-Development/bd-p/sdk.