Receive data updates
Learn how to receive data update events to your app as soon as the user's data syncs to the cloud
Last updated
Was this helpful?
Learn how to receive data update events to your app as soon as the user's data syncs to the cloud
Last updated
Was this helpful?
In order to receive events, you'll need to
If you missed any of the steps above, please refer to the respective guides.
Once you have the above set up, you'll be ready to receive events.
Authentication events occur when a user connects/disconnects their health & fitness data account
Data events occur when new data is available on the user's account
Whenever a has new data available on the respective platform they use, you will receive a data update under one of the following categories
Whenever receiving an event for a which constitutes a duplicate, based on the data type's unique identifier (detailed in each section below), the received data will always be a superset of any previous data received.
This means you should always overwrite data stored on your end with the most up-to-date version.
Use the unique identifier for each payload (detailed below) to overwrite data appropriately upon receiving an update
Data updates will take the following form:
For testing out the different event types mentioned above, you may also use the payload simulator in the Terra Dashboard. See the tutorial below for a step by step guide.
If your destination returns an error code (e.g. your server responds to a webhook event with a 5XX http status code), not to worry! Terra retries to send that event, with exponential backoff, over a period of a little over 24 hours. This ensures that if your server experiences downtime of up to a day, you will still receive any missed data, hence maintaining data integrity.
Terra sends data automatically as soon as it is available on a data source's cloud. That means that if the wearable hasn't synced to the respective app on the end user's phone, or if the app has not synced to the cloud, Terra will be unable to retrieve that data. Wait a bit longer, or try to force a sync (using a "pull down to sync" feature or equivalent available in most apps)
In order to verify if the data has synced to the respective cloud, you may instruct the user to go on their web dashboard for their device using a browser to verify the data is present.
Some users may inquire about missing data, and you may not be sure what's going on.
Here are a few common issues & debugging steps.
Some users may have logged in with the wrong account. In order to verify the account that they're using matches with the Terra user ID that they've generated, you may follow the following procedure for the integrations below.
For FreestyleLibre, a user's profile URL takes the form https://www.libreview.com/patient/{provider_user_id}/profile.
Often enough, users will have logged into an account with little data, really old data, or no data at all by mistake, without realizing it. You can then share a screenshot of that view with your user in order to help them log into the correct account instead.
Launch your Fitbit app (make sure you're using the latest Fitbit app version), click your Fitbit avatar in the top left corner, then click your Fitbit display name to view your profile. Then Click "Personal" and go to the next page, your Fitbit User ID is located at the bottom.
Using the provider_user_id
obtained above, navigate to https://www.myfitnesspal.com/food/diary/{provider_user_id} .
Seeing a page like this:
indicates that the username entered by the end user is invalid. In the case above, the user accidentally entered their email instead of their username. Have them log in once more, following the "how-to" guide presented in the login screen
The page below:
Indicates the user failed to enable diary sharing/disabled it since they authenticated through Terra. In order to remediate this, have the user re-enable diary sharing with the same password used during initial authentication, or have them re-authenticate after having enabled diary sharing as per the "how-to" guide in the login screen
In those cases the first step is always to ensure that the data is showing up in the partner app (e.g. Garmin Connect, Fitbit, etc..).
Next would be to check if the data is correctly synchronized with the partner cloud, by using their web portal.
Ensure that the data is showing up in the Garmin connect web dashboard. If not, then pull down from the top in the Garmin connect mobile app, and hit the circle arrow until everything refreshes. If the data shows up in the web dashboard for Garmin Connect, but not through the API after 1-2 minutes, please contact support.
The most likely culprit would be background app refresh being turned on/background updates not working as expected. In order to verify this, first request a backfill (requires TerraiOS >= 1.6.12) through your Terra Dashboard, in Tools > Debug > Users for that specific user_id
.
If data does come through, this means that background delivery is not operating as expected. To Troubleshoot, follow the steps below.
For this, have the user go to Settings > Battery, and make sure "Low Power Mode" is turned OFF
For this, have the user visit Settings > General > Background App Refresh, and verify that your app is toggled on
Go inside the Google Fit app, and ensure that your data is up to date on the display. Thereafter, pull down from the top of the screen to synchronize with the cloud. Please note that even after that, there can be some delay for Google to make the data available through their API. You should be able to see that data after at most 30-60 minutes in most cases.
Ensure background app refresh is turned on for Google Fit
Unique identifier (per ): metadata.summary_id
See for the full Schema & descriptions of each field
Unique identifier (per ): metadata.start_time
See for the full Schema & descriptions of each field
Unique identifier (per ): metadata.start_time
See for the full Schema & descriptions of each field
Unique identifier (per ): metadata.summary_id
See for the full Schema, example, & descriptions of each field
Unique identifier (per ): metadata.start_time
See for the full Schema, example, & descriptions of each field
Any other event types & their explanations will be found in the reference
Terra always a user_id
for each connection. To get the user ID that the provider (e.g. Garmin, Fitbit etc) uses, you can use the endpoint in order to retrieve that, which will be under the field provider_user_id
. Once you have obtained that, follow the guidelines below for each provider.
If we have connected your users to your own Libreview practice, you may simply substitute provider_user_id
with the one retrieved from the endpoint and visit the link above. You'll then be able to see the user's account email, name, and data present on their account, by clicking on the "Glucose History" tab.
Check to make sure your user's Fitbit user ID matches the one retrieved by the endpoint
Unique identifier (per ): metadata.summary_id