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": "2019-03-01 13:45:01",
"UserID": "05dffbe0dd*****",
"SubscriptionId": "07bf3c71aa*****"
},
{
"CollectionType": "weight",
"MDate": "2019-03-01 13:45:01",
"UserID": "05dffbe0dd*****",
"SubscriptionId": "07bf3c71aa*****"
},
{
"CollectionType": "sleep",
"MDate": "2019-03-01 13:45:01",
"UserID": "05dffbe0dd*****",
"SubscriptionId": "07bf3c71aa*****"
}
{
"CollectionType": "heartrate",
"MDate": "2019-12-01 13:45:01,2019-12-01 13:50:01,2019-12-01 13:55:01,.....",
"UserID": "05dffbe0dd*****",
"SubscriptionId": "07bf3c71aa*****"
}
]
Field Descriptions
Parameter
|
Description
|
Options
|
CollectionType
|
Data Type
|
bp,glucose,weight,activity,
sleep,spo2,userinfo,food,
sport,temperature,heartrate
|
MDate
|
Update Time
|
|
UserID
|
User Identity
|
|
SubscriptionId
|
Push Identity
|
|
Note that there may be multiple pieces of heart rate data. MDate is separated by ","