Skip to content

Locks

Get list of locks

GET/Owners/{ownerAccountId}/BoundLocks

Get a list of this owner account's locks.

Scope

read:core:entities

Parameters

Tip

The returned list can be filtered using OData query parameters.

Name Type Location Description
ownerAccountId string path The owner account's ID.

Response

200 OK
[
  {
    "lockType": {
      "id": "TK.Td30",
      "manufacturerId": 1,
      "modelName": "Td30",
      "supportedTechnologies": [
        "nfc",
        "ble"
      ]
    },
    "supportedFeatures": {
      "timeRestrictionIcalSupport": "Supported"
    },
    "healthStatuses": null,
    "id": "1",
    "physicalLockId": "AAChsgq2",
    "lockTypeId": "TK.Td30",
    "ownerAccountId": "1",
    "bindDate": "2018-12-12T12:00:00.000Z",
    "unbindDate": null,
    "title": "Entrance Door",
    "description": "A description for this lock.",
    "rclSerialNo": 3,
    "rclDate": "2018-12-24T12:00:00.000Z"
  }
]

Get lock by ID

GET/Owners/{ownerAccountId}/BoundLocks/{id}

Get the specified lock.

Scope

read:core:entities

Parameters

Name Type Location Description
ownerAccountId string path The owner account's ID.
id string path The bound lock's ID.

Response

200 OK
{
  "lockType": {
    "id": "TK.Td30",
    "manufacturerId": 1,
    "modelName": "Td30",
    "supportedTechnologies": [
      "nfc",
      "ble"
    ]
  },
  "supportedFeatures": {
    "timeRestrictionIcalSupport": "Supported"
  },
  "healthStatuses": null,
  "id": "1",
  "physicalLockId": "AAChsgq2",
  "lockTypeId": "TK.Td30",
  "ownerAccountId": "1",
  "bindDate": "2018-12-12T12:00:00.000Z",
  "unbindDate": null,
  "title": "Entrance Door",
  "description": "A description for this lock.",
  "rclSerialNo": 3,
  "rclDate": "2018-12-24T12:00:00.000Z"
}

Patch lock

PATCH/Owners/{ownerAccountId}/BoundLocks/{id}

Patch the specified lock.

The following properties can be patched:

  • title
  • description

Scope

write:core:entities

Parameters

Name Type Location Description
ownerAccountId string path The owner account's ID.
id string path The bound lock's ID.

Body

{
  "title": "Office Door",
  "description": "A new description for this lock."
}

Response

204 No Content

Get grants for lock

GET/Owners/{ownerAccountId}/BoundLocks/{id}/Grants

Get a queryable list of Grants applicable to the given lock.

Scope

read:grants

Parameters

Tip

The returned list can be filtered using OData query parameters.

Name Type Location Description
ownerAccountId string path The owner account's ID.
id string path The bound lock's ID.

Response

200 OK
[
  {
    "contact": {
      "id": "1",
      "ownerId": "1",
      "comment": "A new comment describing this contact.",
      "email": "user1@tapkey.com",
      "title": "User One"
    },
    "boundCard": null,
    "boundLock": {
      "lockType": {
        "id": "TK.Td30",
        "manufacturerId": 1,
        "modelName": "Td30",
        "supportedTechnologies": [
          "nfc",
          "ble"
        ]
      },
      "supportedFeatures": {
        "timeRestrictionIcalSupport": "Supported"
      },
      "healthStatuses": null,
      "id": "1",
      "physicalLockId": "AAChsgq2",
      "lockTypeId": "TK.Td30",
      "ownerAccountId": "1",
      "bindDate": "2018-12-12T12:00:00.000Z",
      "unbindDate": null,
      "title": "Entrance Door",
      "description": "A description for this lock.",
      "rclSerialNo": 3,
      "rclDate": "2018-12-24T12:00:00.000Z"
    },
    "id": "1",
    "boundLockId": "1",
    "contactId": "1",
    "validFrom": null,
    "validBefore": null,
    "timeRestrictionIcal": null,
    "state": "Ok",
    "active": true,
    "boundCardId": null
  }
]

Get log entries for lock

GET/Owners/{ownerAccountId}/BoundLocks/{id}/LogEntries

Get a queryable list of log entries related to the given lock.

Scope

read:logs

There are two types of log entries, Command and Event. Commands indicate, that the lock executed a command that most likely has been triggered by a user, while Events indicate, that some other kind of event, like a restart, a periodic measurement, etc. has occurred.

Commands can be one of the following:

Command name Description
not happen.
DeactivateAdminMode The owner mode has been deactivated.
Unbind The lock as been unregistered (unbound) from it's owner.
Rebind The lock has been registered (bound) to an owner.
SetTime The lock's date/time was set.
ChangeAdminMode The lock mode was changed, e.g. the owner mode was activated or deactivated.
PrepareFileUpload A file upload for a firmware upgrade was initiated.
ActivateFirmware A new firmware was installed and activated.
ExecuteCustomCommand A custom, manufacturer-specific command was executed.
TriggerLock The lock was locked/unlocked.

Events can be one of the following:

Event type Description
Provisioning The lock was born.
Bind The lock was registered (bound) to a new owner.
Unbind The lock was unregistered (unbound) from it's previous owner.
State General state information was recorded.
StorageBlockCorrupted Storage corruption was detected and repaired.
LogPageCorrupted Corruption of log data has been detected. Log entries might have been lost.
DeviceStarted The device was restarted, e.g. due to a power cycle or a firmware upgrade.

Other, undocumended command- and event types exist that should be ignored by the client.

In order to get all TriggerLock events for a lock, the following OData query can be used:

$filter=logType eq 'Command' and command eq 'TriggerLock'

Parameters

Tip

The returned list can be filtered using OData query parameters.

Warning

The returned list should always be limited using OData query parameters, e.g. $skip=10&$top=5.

Name Type Location Description
ownerAccountId string path The owner account's ID.
id string path The bound lock's ID.

Response

200 OK
[
  {
    "id": "AAChsgq2;jzyRczNAJN1=;635",
    "entryNo": 635,
    "lockTimestamp": "2018-12-29T14:00:00.000Z",
    "receivedAt": "2018-12-29T14:00:05.000Z",
    "logType": "Command",
    "command": "TriggerLock",
    "eventType": null,
    "boundCardId": null,
    "boundLockId": "1",
    "contactId": "1",
    "measurements": [],
    "grantId": "1"
  },
  {
    "id": "AAChsgq2;jzyRczNAJN1=;64",
    "entryNo": 64,
    "lockTimestamp": "2018-12-14T14:00:00.000Z",
    "receivedAt": "2018-12-14T14:00:05.000Z",
    "logType": "Command",
    "command": "TriggerLock",
    "eventType": null,
    "boundCardId": null,
    "boundLockId": "1",
    "contactId": "1",
    "measurements": [],
    "grantId": "1"
  }
]

Get details of lock

GET/Owners/{ownerAccountId}/BoundLocks/{id}/LockType

Get details about the lock type of the given lock.

This operation can be used to get more information about the type of a certain bound lock, e.g. the model name, manufacturer or which technologies it supports (Bluetooth, NFC).

Scope

read:core:entities

Parameters

Name Type Location Description
ownerAccountId string path The owner account's ID.
id string path The bound lock's ID.

Response

200 OK
{
  "id": "TK.Td30",
  "manufacturerId": 1,
  "modelName": "Td30",
  "supportedTechnologies": [
    "nfc",
    "ble"
  ]
}