Get a passcode

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.

1 Request example

2 Request parameters

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:

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
keyboardPwdTypeIntYPasscode type,refer to section 2.1
keyboardPwdNameStringNPasscode name
startDateLongYThe time when it becomes valid (timestamp in millisecond)
endDateLongNThe time when it is expired (timestamp in millisecond)
dateLongYCurrent time (timestamp in millisecond)
2.1 Passcode type:
TypeParameter值Description
One-time1This code only valid for once within 6 hours from the Start Time
Permanent2This code must be used at least once within 24 Hours after the Start Time, Or it will be invalidated
Period3This code must be used at least once within 24 Hours after the Start Time, Or it will be invalidated
Delete4This code will delete all other codes
Weekend Cyclic5This code is valid during the time period at the weekend
Daily Cyclic6This code is valid during the time period everyday
Workday Cyclic7This code is valid during the time period on workdays
Monday Cyclic8This code is valid during the time period on Mondays
Tuesday Cyclic9This code is valid during the time period on Tuesdays
Wednesday Cyclic10This code is valid during the time period on Wednesdays
Thursday Cyclic11This code is valid during the time period on Thursdays
Friday Cyclic12This code is valid during the time period on Fridays
Saturday Cyclic13This code is valid during the time period on Saturdays
Sunday Cyclic14This code is valid during the time period on Sundays

3 Response and example

ParameterTypeDescription
keyboardPwdStringPasscode
keyboardPwdIdIntPasscode ID