DevicesV1

Create an afi login tokens for all devices owned by the current user

You can provide either valid_from and valid_to information to the request body or relative_start_time. See /.meta/v1/afi/permissions for available permissions.

post/devices/v1/login_tokens

Request

  • Base URL: https://api.danalock.com
  • URL: https://api.danalock.com/devices/v1/login_tokens
  • Auth: OAuth 2 (authorization code, authorization URL /oauth2/authorize, token URL /oauth2/token)

Query parameters

pageinteger

Requested page number

Headers

X-Assume-Userstring

Assume the identity of the user in another domain

Request body

valid_fromstring datetime

Mutually exclusive with 'relative_start_time'

valid_tostring datetime

Mutually exclusive with 'duration'

relative_start_timeinteger

Mutually exclusive with 'valid_from'

durationinteger

Mutually exclusive with 'valid_to'

permissionsstring required

See /.meta/v1/afi/permissions for available permissions.

Example request

{
  "valid_from": "2018-01-01T10:20:30+00:00",
  "valid_to": "2018-01-01T10:20:30+00:00",
  "relative_start_time": 300,
  "duration": 3600,
  "permissions": "afi_lock_operate afi_outputs_operate"
}

Response

Login tokens with metadata

blobstring byte

The low-level login token that must be transmitted to the Afi device.

broadcast_keystring byte

Key used to decrypt broadcasted information (Ble Advertising Data)

Example response

[
  {
    "device": {
      "timezone": "Europe/Copenhagen"
    },
    "blob": "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=",
    "broadcast_key": "AAECAwQFBgcICQoLDA0ODw==",
    "metadata": {
      "valid_from": "2018-01-01T10:20:30+00.00",
      "valid_to": "2018-01-01T10:20:30+00.00",
      "permissions": [
        {
          "id": "3",
          "name": "afi_lock_operate",
          "description": "Operate Lock Permission"
        }
      ]
    }
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.