Change passcode

https://api.sciener.com/v3/keyboardPwd/change

There are two methods to change the passcode:

(1)Change by APP nearby the lock via bluetooth:

You can develop your own APP based on our APP SDK,call Modify Keyboard Password method to change the passcode in the lock,then request this API ( with changeType=1) to sync it to cloud.

(2)Change by cloud API via gateway or WiFi lock

If the lock is WiFi lock or it's connected to a gateway, you can change the passcode remotely,just request this API ( with changeType=2) .

 

With this API, you can change the name, valid period or passcode itself.

When you want to change passcode name, only keyboardPwdName parameter is needed, changeType is noot needed;

When changing valid period startDate and endDate parameters are required;

When changing passcodenewKeyboardPwd parameter is required.

1 Request example

2 Request parameters

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
keyboardPwdIdIntYPasscode ID
keyboardPwdNameStringNNew passcode name
newKeyboardPwdStringNThe new passcode
startDateLongNThe start time of the new passcode (timestamp in millisecond)
endDateLongNThe end time of the new passcode (timestamp in millisecond)
changeTypeIntYMethod:
1-via phone bluetooth, you should call APP SDK method 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
The default value is 1.
dateLongYCurrent time (timestamp in millisecond)

3 Response and example

ParameterTypeDescription
errcodeIntError code
errmsgStringError message