Delete by passcode
https://euapi.ttlock.com/v3/keyboardPwd/deleteByCode
Delete a random passcode or custom passcode,there are two methods to do it:
(1)Delete by APP nearby the lock via bluetooth:
You can develop your own APP based on our APP SDK,call Delete passcode method to delete the passcode from the lock,then request this API ( with deleteType=1) to delete it from the cloud.
(2)Delete by cloud API via gateway or WiFi lock:
If the lock is WiFi lock or it's connected to a gateway, you can delete the passcode remotely,just request this API ( with deleteType=2) .
1 Request example
POST, ContentType:application/x-www-form-urlencodedjavascript
curl --location -g --request POST 'https://euapi.ttlock.com/v3/keyboardPwd/deleteByCode' \
--data-urlencode 'clientId=fd2ff35ee3xxxxxx' \
--data-urlencode 'accessToken=780f7671b6e6bxxxxxxx' \
--data-urlencode 'lockId=24451' \
--data-urlencode 'keyboardPwd=123456' \
--data-urlencode 'deleteType=2' \
--data-urlencode 'date=1626945087000'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 |
| lockId | Int | Y | Lock ID, generated by Lock init |
| keyboardPwd | String | Y | Passcode |
| deleteType | Int | Y | Method: 1-delete with App via Bluetooth, you should delete via bluetooth first 2-delete via WiFi gateway, you can call this api directly if it's a WiFi lock or it's connected to gateway. |
| date | Long | Y | Current time (timestamp in millisecond) |
3 Response and example
| Parameter | Type | Description |
|---|---|---|
| errcode | Int | Error code |
| errmsg | String | Error message |
{
"errcode": 0,
"errmsg": "none error message"
}