https://api.sciener.com/v3/keyboardPwd/get
Get a 6-9 digits random passcode from the cloud, The password is generated by an algorithm in the cloud and can be obtained without having a gateway.the passcode is randomly generated and can't be cutomized, if you need a custom passcode, refer to cloud API: Add a custom passcode.
The lenght of the passcode is generally decided by it's period, it's decided by the algorithm and can't be changed.
Random passcodes's valid period can only be accruate to Hours, if the startDate is set to timestamp of 19:20, then the real start time will be 19:00, we suggest you to set the startDate and endDate on hour.
When period passcode exceed one year, it's valid period can only be accruate to month, it means the day and time of the startDate of endDate must be the same, for example:2020-10-18 00:00:00 to 2022-10-18 00:00:00.
xxxxxxxxxx11POST, ContentType:application/x-www-form-urlencoded
xxxxxxxxxx91curl --location -g --request POST 'https://api.sciener.com/v3/keyboardPwd/get' \2--data-urlencode 'clientId=fd2ff35ee3xxxxxx' \3--data-urlencode 'accessToken=780f7671b6e6bxxxxxxx' \4--data-urlencode 'lockId=24451' \5--data-urlencode 'keyboardPwdType=3' \6--data-urlencode 'keyboardPwdName=test' \7--data-urlencode 'startDate=1626945087000' \8--data-urlencode 'endDate=1636945087000' \9--data-urlencode 'date=1626945087000'Note: When setting the password to a recurring type, please pass the timestamp of the most recent day of the recurring type for startDate and endDate. The system will take the set start date and time period, and determine whether the current day matches the recurring type of the password, thus deciding whether it takes effect. Example:
To set a Weekend Cyclic, 8:00 AM - 5:00 PM, with the nearest weekend (Saturday and Sunday) being 03/01/2026, the parameters should be: keyboardPwdType = 5, startDate = 1767398400000 (8:00 AM,03/01/2026), endData = 1767430800000 (5:00 PM, 03/01/2026). The system will then start checking if a day is a weekend from 03/01/2026. If it is a weekend, the password will be valid from 8:00 AM to 5:00 PM; if it is a weekday, the password will be invalid.
| 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 |
| keyboardPwdType | Int | Y | Passcode type,refer to section 2.1 |
| keyboardPwdName | String | N | Passcode name |
| startDate | Long | Y | The time when it becomes valid (timestamp in millisecond) |
| endDate | Long | N | The time when it is expired (timestamp in millisecond) |
| date | Long | Y | Current time (timestamp in millisecond) |
| Type | Parameter值 | Description |
|---|---|---|
| One-time | 1 | This code only valid for once within 6 hours from the Start Time |
| Permanent | 2 | This code must be used at least once within 24 Hours after the Start Time, Or it will be invalidated |
| Period | 3 | This code must be used at least once within 24 Hours after the Start Time, Or it will be invalidated |
| Delete | 4 | This code will delete all other codes |
| Weekend Cyclic | 5 | This code is valid during the time period at the weekend |
| Daily Cyclic | 6 | This code is valid during the time period everyday |
| Workday Cyclic | 7 | This code is valid during the time period on workdays |
| Monday Cyclic | 8 | This code is valid during the time period on Mondays |
| Tuesday Cyclic | 9 | This code is valid during the time period on Tuesdays |
| Wednesday Cyclic | 10 | This code is valid during the time period on Wednesdays |
| Thursday Cyclic | 11 | This code is valid during the time period on Thursdays |
| Friday Cyclic | 12 | This code is valid during the time period on Fridays |
| Saturday Cyclic | 13 | This code is valid during the time period on Saturdays |
| Sunday Cyclic | 14 | This code is valid during the time period on Sundays |
| Parameter | Type | Description |
|---|---|---|
| keyboardPwd | String | Passcode |
| keyboardPwdId | Int | Passcode ID |
xxxxxxxxxx41{2"keyboardPwd": "0563456",3"keyboardPwdId": 102364}