Open Platform
Skip to content

Clear QR code ​

https://cnapi.ttlock.com/v3/qrCode/clear

Delete all QR codes under the lock name from the cloud.

When type=0, the random QR code in the cloud is cleared. In this case, the QR code is only deleted from the cloud; after deletion, the QR code link becomes unusable, and QR code data cannot be retrieved or refreshed.

When type=1, the QR codes in the lock need to be cleared first using the APP SDK via Bluetooth. Then, this interface is called to clear the custom QR code.

When type=2, calling this interface will directly clear the custom QR code in the lock through the gateway.

Note: If both types of QR codes are generated, this interface needs to be called twice to clear the QR codes: once for type 0 and once for type 1 or 2.

1 Request example ​

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

javascript
curl --location -g --request POST 'https://cnapi.ttlock.com/v3/qrCode/clear' \
--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \
--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \
--data-urlencode 'lockId=163377' \
--data-urlencode 'date=1625025703000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
typeIntYClearing methods: 1- Clear via APP Bluetooth. You must clear via APP Bluetooth first before calling this interface. 2- Clear remotely via gateway or WiFi lock. If it is a WiFi lock or connected to a gateway, you can pass to 2 and directly call this interface to clear from the lock. 0- Cloud method. If not filled in, the default is 0, which clears from the cloud.
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
errcodeIntError code
errmsgStringError message
{
    "errcode": 0, 
    "errmsg": "none error message"
}
CopyRight © 2012-2026 TTLock.All Rights Reserved