Get features
This endpoint returns the features you enabled or disabled for a given user and device model.
Use it to check the current state before calling enablefeature or disablefeature, or to reconcile your own configuration with the one stored by Withings.
Endpoint Overview:
- Endpoint:
https://wbsapi.withings.net/v2/device - Method:
GETorPOST
Parameters
To retrieve the features, your API call must include:
action: Must take the valuegetfeatures.client_id: Your unique identifier provided by Withings.signature: Your request signature for authentication.nonce: A unique, random number for request validation.userid: The user ID associated with the device.model: The model of the device, e.g., "Body Pro 2 = 17".
Example Request
To list the features set for a user on a Body Pro 2:
{
"action": "getfeatures",
"client_id": "YourClientID",
"signature": "YourSignature",
"nonce": "YourNonce",
"userid": "UserID",
"model": 17
}
Response from the API
{
"status": 0,
"body": {
"features": [
{
"feature_name": "feature_eyes_closed_mode",
"active": true
},
{
"feature_name": "feature_pwv",
"active": false
}
]
}
}
What the response contains
feature_name: The name of the feature, as used in Enable features.active:trueif the feature is currently enabled for this user and model,falseif it is disabled.
The response only lists the features for which a choice has been recorded for your program, either at the device model level or at the program level. A feature you never enabled or disabled is not returned, and keeps its default state as described in the Available Features table. When both a program-level and a model-level choice exist for the same feature, the model-level one is returned.
An empty list is a valid answer:
{
"status": 0,
"body": {
"features": []
}
}
Possible Errors
503(invalid params): themodeldoes not exist, or theuseriddoes not exist or does not belong to your program.277(unauthorized): the signature is invalid, or your client is not allowed to call this endpoint.