Add a door sensor
https://euapi.ttlock.com/v3/standaloneDoorSensor/add
The standalone door sensor (DS3) can be used to monitor the opening and closing status of doors and windows. The standalone door sensor itself can report its opening and closing status after being configured with Wi-Fi.
After adding the standalone door sensor through the APP SDK, calling this interface binds the door sensor to the user in the cloud.
1 Request example
POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request POST 'https://euapi.ttlock.com/v3/standaloneDoorSensor/add' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'name=test' \
--data-urlencode 'doorSensorData=xxxxxxxxxxxxx' \
--data-urlencode 'wifiName=WIFI name' \
--data-urlencode 'date=1625025703000'2 Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| clientId | String | Y | client_id from Create application |
| accessToken | String | Y | Access token,refer to: Get access token |
| name | String | Y | Name |
| doorSensorData | String | Y | Independent door sensor data must be generated by the APP SDK initial interface. |
| wifiName | String | Y | WIFI name |
| date | Long | Y | Current time (timestamp, in milliseconds) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| doorSensorId | Int | Door sensor ID |
{
"doorSensorId": 12345
}