Payload and Categories
Each notification corresponds to a data type or event, and the payload parameters are sent to your callback URL.
The following table describes the POST parameters that the Withings server will send to your callback URL in a notification request.
| Name | Type | Description |
|---|---|---|
| userid | int | data source |
| deviceid | string | event trigger source |
| appli | int | data category |
| startdate | epoch | data date |
| enddate | epoch | data date |
| date | y-m-d | data or event date |
| action | string | Value amongst:
|
Refer to the notification categories below for information about which parameters you will receive depending on the notification category you subscribe to.
Payload Example
Here's an example of payload a POST request sent to your callback URL:
foo=bar
userid=12345
appli=1
startdate=1530576000
enddate=1530698753
In this case, you can call the Measure - Getmeas service to retrieve available data:
meastypes=1,5,6,8,76,77,88,91
category=1
startdate=1530576000
enddate=1530698753
Notification categories
Below is a list of notification categories to which you can subscribe. Here's an explanation of the different columns:
- Appli: the value you must use when subscribing to the notification category.
- Scope: permission scope you request when you obtained this user's authorization
code. - Notification source: data or events that triggered the notification.
- Notification params: parameters set by the Withings server in the body of the POST call sent to the callback URL to notify your server.
- Services to call: the Health Data API services you should call to retrieve the new available data.
| Appli | Scope | Notification trigger | Notification params | Services to call | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | user.metrics | New weight-related data amongst meastypes:
| userid appli startdate (unix timestamp) enddate (unix timestamp) | Measure - Getmeas | ||||||||||||||||||||||
| 2 | user.metrics | New temperature-related data amongst meastypes:
| userid appli startdate (unix timestamp) enddate (unix timestamp) | Measure - Getmeas | ||||||||||||||||||||||
| 4 | user.metrics | New pressure related data amongst meastypes:
| userid appli startdate (unix timestamp) enddate (unix timestamp) | Measure - Getmeas | ||||||||||||||||||||||
| 16 | users.activity | New activity-related data:
| userid appli date (YMD date) | Measure v2 - GetactivityMeasure v2 - GetintradayactivityMeasure v2 - Getworkouts | ||||||||||||||||||||||
| 44 | users.activity | New sleep-related data:
| userid appli startdate (unix timestamp) enddate (unix timestamp) | Sleep v2 - GetSleep v2 - Getsummary | ||||||||||||||||||||||
| 46 | user.info | New action on user profile:
| userid appli action | No service to call | ||||||||||||||||||||||
| 50 | user.sleepevents | New bed in event (user lies on bed) | userid appli date (unix timestamp) deviceid | No service to call | ||||||||||||||||||||||
| 51 | user.sleepevents | New bed out event (user gets out of bed) | userid appli date (unix timestamp) deviceid | No service to call | ||||||||||||||||||||||
| 52 | user.sleepevents | New inflate done event (Withings sleep sensor initial inflation is done) | userid appli date (unix timestamp) deviceid | No service to call | ||||||||||||||||||||||
| 53 | n/a | No account associated: a user tried to set-up his Withings Cellular Pro device or Wthings device using the Withings Data HUB but the device is not pre-associated to a Withings account. | appli mac | User v2 - Activate or User v2 - Link to associate the device to a Withings account. | ||||||||||||||||||||||
| 54 | user.metrics | New ECG data | userid appli startdate (unix timestamp) enddate (unix timestamp) | Heart v2 - List | ||||||||||||||||||||||
| 55 | user.metrics | New ECG measure failed event | userid appli date (unix timestamp) deviceid | No service to call | ||||||||||||||||||||||
| 58 | user.metrics | New glucose data amongst meastypes:
| userid | Measure - Getmeas | ||||||||||||||||||||||
| 60 | user.data | New survey data | userid | Answers v2 - Get | ||||||||||||||||||||||
| 61 | user.metrics | New Stethoscope data | userid | Measure - Getmeas | ||||||||||||||||||||||
| 62 | user.metrics | New HRV data | userid | Measure - Getmeas |