Open Platform
Skip to content

Get the open state of a lock ​

https://cnapi.sciener.com/v3/lock/queryOpenState

Get the open state of a lock via gateway or WiFi lock. If the lock is also bound to a door sensor, this API also returns the door sensor status

1 Request example ​

javascript
curl --location --request GET 'https://cnapi.sciener.com/v3/lock/queryOpenState?clientId=4773aa036f7f49c68d876bb4be85c80c&accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f&lockId=163377&date=1626674054000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
stateIntOpen state of lock:0-locked,1-unlocked,2-unknown
{
    "state": 1
}
CopyRight © 2012-2026 Sciener.All Rights Reserved