Open Platform
Skip to content

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 ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
nameStringYName
doorSensorDataStringYIndependent door sensor data must be generated by the APP SDK initial interface.
wifiNameStringYWIFI name
dateLongYCurrent time (timestamp, in milliseconds)

3 Response and example ​

ParameterTypeDescription
doorSensorIdIntDoor sensor ID
{
    "doorSensorId": 12345
}
CopyRight © 2012-2026 TTLock.All Rights Reserved