Open Platform
Skip to content

Set allow opening the privacy lock ​

https://euapi.ttlock.com/v3/lock/setOpenPrivacyLock

Set the "allow opening the privacy lock" attribute for an unlock method (IC card, keypad password). It is disabled (0) by default.

Setting method (setType):

  1. APP Bluetooth method: only updates the cloud record. The setting must first be completed on the lock side via APP/SDK Bluetooth before calling this API.
  2. Gateway method: if the lock is connected to a gateway or is a WiFi lock, the command will be issued remotely to the lock, and the cloud will save it only after the issuance succeeds.

The gateway method can only be used when the lock firmware supports unlock method user attributes (feature value support); otherwise, error code -4043 is returned.

1 HTTP request method and example ​

POST, ContentType:application/x-www-form-urlencoded

javascript
curl --location -g --request POST 'https://euapi.ttlock.com/v3/lock/setOpenPrivacyLock' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'lockId=3001' \
--data-urlencode 'openType=6' \
--data-urlencode 'openTypeId=123456' \
--data-urlencode 'openPrivacyLock=1' \
--data-urlencode 'setType=2' \
--data-urlencode 'date=1626945087000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID
openTypeIntYUnlock method type: 2-IC card, 6-keypad password
openTypeIdIntYUnlock method ID: when openType=6, it is the keyboardPwdId returned by the Passcode list API; when openType=2, it is the cardId returned by the IC card list API
openPrivacyLockIntYAllow opening the privacy lock: 1-allowed, 0-not allowed (disabled)
setTypeIntYSetting method: 1-APP Bluetooth (only updates the cloud record; the lock-side setting must first be completed via APP/SDK Bluetooth), 2-gateway (issued remotely to the lock; can be called directly for WiFi locks or locks already connected to a gateway)
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
errcodeIntError code
errmsgStringError message
descriptionStringError description
{
    "errcode": 0,
    "errmsg": "none error message",
    "description":"表示成功或是"
}
CopyRight © 2012-2026 TTLock.All Rights Reserved