User v2 - Activate
Creates a Withings user, links the devices related to the provided mac_addresses and activates the cellular devices service and invoicing.
Please refer to the Access and refresh tokens section to learn how to use the authorization code you'll get in return of this service in order to fetch user data. The authorization code is only valid for 10 minutes.
Important:
- Please note that to activate the Withings HUB cellular service, the mac_address of the Withings HUB needs to be passed included in the input mac_addresses along with the other Withings devices.
- Please note that the devices need to be authorized to be linked by API by the Partner. Please contact Withings for more information on device authorization.
This service is part of Withings Pro Solutions. You won't be able to use it if you did not sign a contract with Withings. Use this service only if you're integrating Withings Cellular Solutions with bulkshipment.
Request
- Base URLhttps://wbsapi.withings.net
- Authnone declared
Query parameters
Service action name. Must take the string value activate.
Id of the client
A random token used to prevent replay attacks (Cf. Signature v2 - Getnonce)
Hash of params (Cf. Signature hash protocol).
Specifies if customer accepted Withings commercial contacts.
Unix timestamp of user's birthdate
User measures (Cf. Measures model).
0: man, 1: woman
User language preference. Examples: en_EN / en_US / de_DE / es_ES / fr_FR / it_IT / ja_JA / ko_KR / nl_NL / pt_PT / ru_RU / zh_CN
Unit pref (cf. Unit preferences model).
User's email address
User's timezone. Examples: "Europe/Paris" / "America/New_York". A complete list of all possible timezones can be found on the "TZ database name" column of this page : https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3 characters representing the end user (ex: for a user named Robert, you could set the shortname param to ROB). These characters will be displayed on device screens when used.<br>Shortname must respect the following regex: /^[a-zA-Z0-9]{3}$/ (either letters or numbers, special characters and spaces are not allowed).
Unique identifier used by the partner to identify the end-user.
List of Withings device MAC addresses that will be linked to the created user. Example: ["00:24:e4:xx:xx:xx","00:24:e4:xx:xx:xx"]
User's firstname (if not set, will take the same value as shortname)
User's lastname (if not set, will take the same value as shortname)
Phone number in E.164 format. End user will receive a verification code on this phone number for 2 factor authentication if they wish to securely access the data of their program in the withings app in the future (recommended)
Recovery code can be used by end user as a 2nd authentication factor in the withings app if they wish to securely access the data of their program in the future. You will be responsible of securely providing this recovery code to your user if he asks for it.
Goals (cf. Goals model).
The URI we should redirect the user to after choosing to authorize or not your app. This URI must be set as Callback Url in your partner application. It is possible to use multiple URLs by separating them with a comma.
Examples:
- Callbacks: https://mydomain.com/
- Callback: https://mydomain.com/,https://mydomain2.com/
- Valid URL: https://mydomain.com/relative_path?args=value
Response
(Click to unfold)
Example response
{
"body": {
"user": {
"code": "490ed603fe9bd2ce10027bdba0c932069cd27085",
"external_id": "3b7a6db0-ec7e-479b-9675-2a3d8d6a7e51"
},
"devices": [
{
"mac_address": "00:24:e4:69:b2:30",
"type": "Scale",
"model": "Body Cardio",
"model_id": 6,
"battery": "medium",
"deviceid": "892359876fd8805ac45bab078c4828692f0276b1",
"timezone": "Europe/Paris",
"last_session_date": 1594159644,
"serial_number": "SN-001122334455"
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.