iHealth Subscriptions API (PubSub)

Subscription notifications are only available for users that authorize the partner app for data access through OAuth. When one of these events are created or deleted, a notification is pushed to the registered webhook.

The webhook URL is set on the application configuration page when you edit your application. Setting a webhook URL and selecting “Enable” will enable the callback notification service for your application.

The webhook must return a 200 response code on receiving a callback successfully. If the callback to webhook does not result in a successful response, two additional retries will be attempted. A notification is dropped after three tries.

A list of events that have been affected will be sent. Note that these events will not be time ordered.

Sample JSON payload expected with callback:

[
  {
    "CollectionType": "bp", 
    "MDate": "2010-03-01 13:45:01", 
    "UserID": "05dffbe0dd*****", 
    "SubscriptionId": "1234"
  }, 
  {
    "CollectionType": "weight", 
    "MDate": "2010-03-02 07:39:57", 
    "UserID": "05dffbe0dd*****", 
    "SubscriptionId": "1234"
  }, 
  {
    "CollectionType": "sleep", 
    "MDate": "2010-03-01 13:48:31", 
    "UserID": "05dffbe0dd*****", 
    "SubscriptionId": "2345"
  }
]

Field Descriptions

Parameter

Description

Options

CollectionType

Data Type

bp,weight,glucose,spo2,activity,sleep,userinfo,food

MDate

Update Time

UserID

User Identity

SubscriptionId

Push Identity