Update User Validity

Last Updated on : 2023-12-07 03:33:50download

Update the user’s validity period, and send the validity period information to a smart lock.

API address

PUT: /v1.0/smart-lock/devices/{device_id}/users/{user_id}/schedule

Request parameter

Parameter name Type IN Required Description
device_id String uri true The device ID.
user_id String uri true The user ID.

Description of body

Parameter name Type IN Required Description
permanent Boolean false Specifies whether the user is a permanent user.
effective_time Long false The time when the password takes effect. Unit: seconds.
expired_time Long false The time when the password expires. Unit: seconds.
schedule_details List false The details of the validity period.

Description of schedule_details

Parameter name Type IN Required Description
start_minute Long false The minute when the password takes effect in one day.
end_minute Long false The minute when the password expires in one day.
working_day Integer false Day of the week. Each value adds up. Valid values:
  • 1: Sunday
  • 2: Monday
  • 4: Tuesday
  • 8: Wednesday
  • 16: Thursday
  • 32: Friday
  • 64: Saturday
time_zone_id String false The time zone.
all_day Boolean false Indicates whether the password is valid all the day.

Return parameter

Parameter name Type Description
result Boolean Indicates whether the operation is successful.

Request example

PUT: /v1.0/smart-lock/devices/vdevo12454656****/users/130**/schedule
{ "scheduleDetails": [ { "allDay": false, "start_minute": "420", "end_minute": "1438", "workingDay": 99 } ], "effectiveTime": 1628179200, "expiredTime": 1640015999, "permanent": false }

Return example

{ "result": true, "t": 1628233659275, "success": true }

Error code

For more information, see error code.