Temporary Code

A temporary code is a time bound code that changes after a defined interval. To generate a temporary code, use the temporary code endpoint in the Connected Products API.

Requesting a Temporary Code

The following is an example request:

{
  "DeviceIdentifier": "A12345",
  "FirmwareVersion": 1234,
  "KeyNumber": 2,
  "WhenValid": "2017-10-10T20:00:00+00:00"
}

KeyNumber

If you are requesting the standard temporary code, please set this to 2. If you are requesting a configured temporary code for the Deadbolt, please set this to 4.

WhenValid

The temporary code that is returned from the API will be valid during this timestamp. The response will indicate when the code will begin and when it will expire.

Configuring the Temporary Code

By default, all lock models (sans the Deadbolt) have a 4 hour temporary code duration. The Deadbolt has a 1 hour duration. All lock models have a roll over time that starts at UTC Midnight. If this time window is not sufficient for your use case, you may wish to configure the length.

Configuring the temporary code is a premium feature. Please contact Master Lock for more information.

Configuring the temporary code will allow you to adjust the duration and the roll over time of the temporary code for each lock. See configure and confirm in the Connected Products Web API.

The configure endpoint takes several parameters:

TemporaryAccessCodeWindowSeconds

The duration of the temporary code you’d like, in seconds (default is 1 hour [3600] or 4 hours [14400] depending on lock model). The minimum value we allow is 1800 (30 minutes) and max value is 604,800 (7 days).

TemporaryAccessCodeEpochSeconds

The offset from Unix epoch you’d like the codes to start at. By default all temp codes start at 1/1/1970 UTC midnight. So you can use this setting to change the time that codes rollover based on your time zone.

Applying the Configuration to a Lock

The commandSequence returned from the configure endpoint is an array of commands that you will apply to the device via Bluetooth using the mobile frameworks. See the the iOS and Android documentation on how to apply this data to the lock.

It is important to call confirm after the BLE commands have been applied to the lock so that our system knows the settings have been updated. Without this temp codes retrieved will still be following the old settings.

When a temporary code has been reconfigured, any temporary codes that had been generated for a future date will no longer work.