https://api.sciener.com/v3/keyboardPwd/add
Add a 4-9 digits custom passcode to the lock,there are two methods to do it:
You can develop your own APP based on our APP SDK,call Add passccode method to wirte a passcode into the lock,then request this API ( with addType=1) to add it to the cloud to facilitate follow-up management.
If the lock is WiFi lock or it's connected to a gateway, you can add custom passcode remotely,just request cloud API Add custom passcode ( with addType=2) , the gateway will write the passcode into the lock.
If the WiFi lock is in power-saving mode, it can perform asynchronous data transmission (addType=4). For more information on asynchronous data transmission, please refer to:WiFi lock
Due to the limited storage space of the lock, only 250 passcodes can be added at most. If the number exceeds the limit, an error code of - 3009 will be returned, indicating that the space is full. You need to delete others before adding them.
xxxxxxxxxx11POST, ContentType:application/x-www-form-urlencoded
xxxxxxxxxx101curl --location -g --request POST 'https://api.sciener.com/v3/keyboardPwd/add' \2--data-urlencode 'clientId=fd2ff35ee3xxxxxx' \3--data-urlencode 'accessToken=780f7671b6e6bxxxxxxx' \4--data-urlencode 'lockId=24451' \5--data-urlencode 'keyboardPwd=123456' \6--data-urlencode 'keyboardPwdName=Passcode for Jack' \7--data-urlencode 'startDate=1626945087000' \8--data-urlencode 'endDate=1746945087000' \9--data-urlencode 'addType=2' \10--data-urlencode 'date=1626945087000'| 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 | Int | Y | Passcode |
| keyboardPwdName | String | N | Passcode name |
| keyboardPwdType | Int | N | Keyboard password type:2-permanent, 3-period, default value is 3 |
| startDate | Long | N | The time when it becomes valid (timestamp in millisecond), must be required if keyboard password type is 3-period |
| endDate | Long | N | The time when it is expired (timestamp in millisecond), must be required if keyboard password type is 3-period |
| addType | Int | Y | Method: 1-via phone bluetooth,should call APP SDK method to add passcode first. 2-via gateway or WiFi lock,you can call this api directly if it's a WiFi lock or it's connected to gateway.If the WiFi lock is in power-saving mode, it can transmit data asynchronously (using addType = 4). The default value is 1. |
| date | Long | Y | Current time (timestamp in millisecond) |
| Parameter | Type | Description |
|---|---|---|
| keyboardPwdId | Int | Passcode ID |
xxxxxxxxxx31{2"keyboardPwdId": 242423}