Terra
Integrations
Research

Integration

API
Unified API
SDK
SDK
Authentication
Authentication
Streaming
Streaming
Blood
Blood Report API
Planned Workouts
Planned Workouts
AI Interface
AI Interface

User engagement

Graph API
Graph API
Scores
Health Scores
Rewards
Health Rewards

Use cases

Enterprise
Enterprise
Insurance
Insurance

Developers

Wearable Data
Wearable Data
Community
Community
Documentation
Documentation

Learn

Blog
Blog
Podcast
Podcast
Events
Events
Reports
Reports

Company

Customers
Customers
Careers
Careers
Partners
Partners
Support
Support
Pricing
Become an integrationGet started
IntegrationsResearch
Unified APIUnified APISDKSDKAuthenticationAuthenticationStreamingStreamingGraph APIGraph APIScoresScoresRewardsRewardsBlood Report APIBloodAI InterfaceAI Interface
EnterpriseEnterpriseInsuranceInsuranceWearable DataWearable DataCommunityCommunityDocumentationDocumentationBlogBlogPodcastPodcastEventsEventsReportsReportsCustomersCustomersCareersCareersPartnersPartnersSupportSupport
Pricing
Get startedBecome an integration


Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

Cookies Policy
zap

Latest

zap

Popular

API

Unified API

SDK

Phone SDK

Authentication

Widget

Streaming

Streaming

Graph API

Graph API

Not getting any data from Apple

All

GenerousPeacock12 months ago

⏺ Description of the issue: Hi Terra, terra doesn't seem to be retrieving any sleep or daily data for some of our customers. We are not getting any data in the payload so our webhook is not getting any data. I have some examples below

⏺ Terra user ID (user_id): 579f2524-2565-4dca-b239-37dd3b104b4d ⏺ Provider (i.e GARMIN, APPLE, FITBIT, etc.): Apple ⏺ SDK name and version: ⏺ Additional: requests made, log files, data type and etc:


```py
def main():
  print("Hello World!")

{ "data": [], "user": { "scopes": "HEART_RATE,RESPIRATORY_RATE,HEART_RATE_VARIABILITY,ACTIVE_DURATIONS,STEPS,ACTIVITY_SUMMARY,SLEEP_ANALYSIS", "active": true, "user_id": "579f2524-2565-4dca-b239-37dd3b104b4d", "last_webhook_update": "2025-05-29T14:22:34.956726+00:00", "provider": "APPLE", "created_at": null, "reference_id": "67dc2b1d962538108a396d01|Meo" }, "type": "sleep", "version": "2022-03-16" }

——

{ "user": { "created_at": null, "user_id": "579f2524-2565-4dca-b239-37dd3b104b4d", "scopes": "HEART_RATE,RESPIRATORY_RATE,HEART_RATE_VARIABILITY,ACTIVE_DURATIONS,STEPS,ACTIVITY_SUMMARY,SLEEP_ANALYSIS", "last_webhook_update": "2025-05-29T14:18:36.344377+00:00", "reference_id": "67dc2b1d962538108a396d01|Meo", "provider": "APPLE", "active": true }, "type": "daily", "data": [], "version": "2022-03-16" }

GenerousPeacock12 months ago

{
  "data": [],
  "user": {
    "scopes": "HEART_RATE,RESPIRATORY_RATE,HEART_RATE_VARIABILITY,ACTIVE_DURATIONS,STEPS,ACTIVITY_SUMMARY,SLEEP_ANALYSIS",
    "active": true,
    "user_id": "579f2524-2565-4dca-b239-37dd3b104b4d",
    "last_webhook_update": "2025-05-29T14:22:34.956726+00:00",
    "provider": "APPLE",
    "created_at": null,
    "reference_id": "67dc2b1d962538108a396d01|Meo"
  },
  "type": "sleep",
  "version": "2022-03-16"
}

GenerousPeacock12 months ago

{
  "user": {
    "created_at": null,
    "user_id": "579f2524-2565-4dca-b239-37dd3b104b4d",
    "scopes": "HEART_RATE,RESPIRATORY_RATE,HEART_RATE_VARIABILITY,ACTIVE_DURATIONS,STEPS,ACTIVITY_SUMMARY,SLEEP_ANALYSIS",
    "last_webhook_update": "2025-05-29T14:18:36.344377+00:00",
    "reference_id": "67dc2b1d962538108a396d01|Meo",
    "provider": "APPLE",
    "active": true
  },
  "type": "daily",
  "data": [],
  "version": "2022-03-16"
}

terra

Vanessaadmin12 months ago

Hi there!

In order to understand what is causing this, please follow the steps below:

  • Could you ensure the user has given the required permissions to send the requested data?
  • Could you check with the user whether the data you are requesting for the given time range is available in their Apple Health app?
  • Could you check that the user is connected using the getUserId() function? See here: https://docs.tryterra.co/health-and-fitness-api/mobile-only-sources/ios-swift#id-4.-validate-the-connection
  • Could you ensure that you are looking at the correct environment? E.g. has the user connected on the testing environment or production environment?

Please also note the following:

  • The toWebhook parameter is only used when you're manually requesting historical data using the data retrieval functions like getDaily(), getSleep(), or getActivity(). In that case, ensure toWebhook is set = true.

  • For automatic data delivery on iOS: Set schedulerOn = true when calling initConnection() to enable background delivery.

  • The iOS background delivery has specific limitations: data will only be triggered when the phone is unlocked, had network connection, and is not on battery saving mode. Only enabled data types from the Terra Dashboard will be triggered.

If you continue to have issues, please let us know and we'll go through it step by step! :)