Cloud API Reference

The Lockt SecureAccess Cloud API is designed to provide customers with SecureAccess the ability to easily integrate with external systems.


This API is intended to be a simple, but powerful way for your organization to access common features of LocktSecure Access from any REST compatible client. New functions and endpoints will be added frequently. Please refer to the documentation below for reference.

Lockt SecureAccess 2.4 or higher is required to utilize the API.
Release 1.1.0
July 2022 Release - Enhancements, bug fixes, documentation updates

Release Details
Correction of bugs in relay calls. 
Expanded validation of user supplied values across all endpoints.
Addition of endpoints: /about, /maintenance, /location, /locationtype, /object, /user?missingcreds, /user?installers, /user?privileged
 
History of changes made to the API, feature adds, fixes, and other notes.


Changes


Endpoint Method Description Date
ALL ALL July release 1.1.0 baseline. 2022-07-01
/about GET Displays current release notes. 2022-07-10
/cedentialsummary GET List summary of credentials claimed and unclaimed. 2022-07-10
/doorstate GET List door battery levels. 2022-07-10
/location GET Get list of locations. 2022-07-10
/location POST Create locations. 2022-07-10
/object?listtypes GET Displays available object types. 2022-07-10
/object?type GET Displays object information using the provided object type. 2022-07-10
/acesslevel DELETE Delete access level. 2022-07-15
/credential?id GET Retreive credential by id. 2022-07-15
/credential?card_num GET Retreive credential by card_num. 2022-07-15
/ping GET Simple ping response to check connectivity and authorization. 2022-08-12
/settings GET Retrieve api settings. 2022-08-12
/site GET Retrieve basic site information. 2022-08-12
/user PUT Update user objects using only specified object properties. 2022-08-12
/user POST Bug fix for user update and delete requests. 2022-08-18
/fob PUT Reassign credentials tagged as FOBs to a different user, and update expiration date.. 2022-08-18
/doors?user_id GET Retrieves list of doors based on user_id. 2022-08-31
/user POST Performance improvements for single record operations. Reduces time needed to execute changes on single records. 2022-09-06
/doors?id_num GET Retrieves list of doors based on user id_num. 2022-09-08
/delegate GET Retrieves list of access levels tagged as delegate roles. 2022-09-08
/delegate?purge POST Purges expired delegate access levels. 2022-09-08
/delegate POST Creates delegate access level based on supplied door_id and assigns to supplied user_id. 2022-09-08
HTTPS
All requests to the Lockt Cloud API must be done so over HTTPS. All other requests will be rejected.

URL
API Urls should be constructed as follows: https://cloudapi.lockt.com/api/[version]/[endpoint]
Example: https://cloudapi.lockt.com/api/v1/users

API Versions
Version URL reference
Version 1.1.0 v1


Authentication
In order to access the Lockt Cloud API, you must provide valid api credential headers with each request. Your credentials will be supplied as both an apiuser and apikey.

Authentication Header Example
"apiuser" : "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
"apikey" : "hqx7wde64vwe987fvg6q4zaautrs3p7j"

Content-Type
All requests must present the Content-Type header with a value of 'application/json'.

Response Codes
Status Code Description
200 The request was processed successfully
400 There was an error processing your request. Details will be supplied in the response body.
401 Access to the indicated resource was denied. Details will be provided in the response body.
404 The resource was not found.
50X An unexpected error has occurred.


Expected Outputs
The following outputs may be encountered while processing create / update / delete calls.
Message Description
No data found or invalid JSON objects supplied. Could not parse input. The body of the request contained no data, or contained incorrectly structured data.
Batch size exceeds maximum of X objects. The supplied payload exceeds the currently allowed number of objects per batch.
Validation errors found. Batch has failed. Details provided. Some objects have failed validation. Details will be provided in the response body.
Unable to enumerate dependant record. Batch has been terminated and exception flagged. A communications error has occurred with your instance of Lockt SecureAccess.
Unable to locate template. Batch has been terminated and exception flagged. A communications error has occurred with your instance of Lockt SecureAccess.
The destination host is unreachable. A communications error has occurred with your instance of Lockt SecureAccess.
An Unexpected Error has occurred. Request has been terminated and exception flagged. A communications or processing error has occurred with your instance of Lockt SecureAccess.
Restriction Description
POST Operation Record Limit POST Operations are currently limited by default to 100 records per call. This may change per customer instance. Processing larger batches of records requires paging and processing in blocks of the allotted maximum size.
POST Operation Rate Limit Rate limiting is currently being implemented to prevent simultaneous and overlapping POST operations.
All response calls to the API will return in a standard format as indicated below.

GET Requests (Read)
Node Description
data The body of the response return as an array of response objects.
errors Any processing or validation errors will appear in the data node, returned as an array of error objects.
Response Format
#Standard Response
{
    "data": {
        [array of response objects]
    }
}

#Error Response
{
    "data": {
        {"error":"error message"}
    }
}

                                            


POST Requests (Write)
Node Description
process summary The number of records submitted, processed, and errors.
errors Any processing or validation errors will appear in the errors node of the data object.
Response Format
                                            
                                            
#Result if the process succeeds and no errors
{
    "data": {
        "submitted": number of records submitted,
        "inserted": number of records inserted,
        "updated": number of records updated,
        "errors": number of errors encountered
    }
}

#Result if errors are encountered
{
    "result": [Array of text messages indicating what caused the problem],
    "errors": [Array of error objects that indicate what specifically occurred]
}

#Example errors encountered updating users
{
    "error": [
        "Non-Numeric card_num found: A8914",
        "Invalid email address found: rgreswell0@@@@gravatar.com"
    ],
    "input_data": {
        "id": -1,
        "id_num": "qjwi-880329359",
        "first_name": "Rhea",
        "last_name": "Greswell",
        "card_num": "A8914",
        "email": "rgreswell0@@@@gravatar.com",
        "phone": "8184365134",
        "access_effective": "2022-01-24 00:00:00",
        "access_expires": "2022-10-29 00:00:00",
        "pin": "0986",
        "enabled": false,
        "accesslevels": [
            {
                "id": 574
            }
        ]
    }
}
                                            
                                            
Entity Model


Domain Model


Relationships
Object Description
User Users represent individual credential holders in Lockt SecureAccess. User objects contain basic information such as name, id_num, email and phone. User objects also reference other objects such as access levels and credentials. Users can be assigned to multiple access levels and can hold multiple credentials.
Fobs Fobs are special derivatives of user records that are used specifically for the purpose of managing fob devices. Like users, fob objects also reference other objects such as access levels and credentials. Fobs can be assigned to multiple access levels and can hold multiple credentials
Credential Credentials represent digital access keys and are used to uniquely identify a user in the Best Switch Mobile app. Users can hold multiple credentials. But, credentials can only be held by one user.
Access Levels Access Levels represent logical groups of doors that are tied to schedules. Access Levels are similar to security groups as they combine a collection of doors that, when assigned to a user, grant the user access to the door on the indicated schedule.
Doors Doors are individual openings over which the system governs access. Multiple doors can be assigned to access levels. Likewise, multiple access levels can reference the same door.
Schedules Schedules represent a collection of individual days and start / stop times. Schedules are applied to access levels and are used to determine which days and times to grant access to a door, via an access level.
Events Events are representations of actions that have occurred within the system. Events reference numerous objects, including several objects that are not callable through the API.
The following endpoints are available for use. Details on request and response specifics can be found in the subsequent sections.

Functional Endpoints: 42
System Endpoints: 8
Total Endpoints: 50


Functional Endpoints


Endpoint Method Purpose Comments Status
/accesslevel DELETE Delete specified access levels. Released
/accesslevel GET List all access levels in the system. Released
/accesslevel?name=[name] GET Retrieve access level with indicated name. Released
/accesslevel POST Creae access levels by assigning doors to schedules. Released
/credential DELETE Delete indicated credential. Released
/credential?user_id=[user_id] GET List all credentials in the system, for the indicated user. Released
/credential GET List all credentials in the system. Released
/credential?card_num=[card_num] GET Retrieve access level with indicated card_num. Released
/credential?id=[id] GET Retrieve access level with indicated id. Released
/credentialsummary GET List summary of credentials claimed and unclaimed. Released
/delegate GET List access levels used for delegation. Released
/delegate POST Create and assign new delegate access. Released
/delegate?purge=[purge] POST Delete all expired delegate access levels (where access_expires < current date/time). Released
/door DELETE Remove door records. Released
/door?id_num=[id_num] GET List all access-controlled doors assigned to the specified id_num across all assigned access levels. Released
/door?user_id=[user_id] GET List all access-controlled doors assigned to the specified user_id across all assigned access levels. Released
/door GET List all access-controlled doors in the system. Released
/door POST Create access-controlled doors in the system. Released
/doorstate GET List door battery levels. Released
/events GET Return maximum number of locally cached events in the system (default 5000). Released
/events?id=[id] GET Return most recent events starting with the last event id. id represents the sequential Lockt SecureAccess event internal id. Released
/fob DELETE Remove fob records. Released
/fob?card_num=[card_num] GET Get individual Fob by card_num. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/fob?id_num=[id_num] GET Get individual Fob by id_num. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Pending Release
/fob?name=[name] GET Get individual Fob by name. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/fob?id=[id] GET Get individual Fob by system assigned id. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/fob GET List credentials tagged as FOBs. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/fob POST Create credentials tagged as FOBs. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/fob PUT Reassign credentials tagged as FOBs to a different user, and update expiration date. Fob functions are specialized to handle and manipulate credential records that are specifically tagged for use as Fobs. Released
/location GET Get list of locations. Released
/location POST Create locations. Released
/locationtype GET Get list of location types. Released
/schedule GET List all schedules in the system. Released
/user DELETE Remove user records. Released
/user GET List all non-administrative, card holder users in the system. Released
/user?missingcreds GET List summary of users missing credentials. Released
/user?privileged GET List users wiith privileged (application level) access. Released
/user?installers GET List users with installer rights. Released
/user?id=[id] GET Read individual non-administrative, card holder user with the specified id. id represents the Lockt SecureAccess internal id. Released
/user?id_num=[id_num] GET Read individual non-administrative, card holder user with the specified id_num. id_num represents the user-supplied ID Number in Lockt SecureAccess. Released
/user POST Bulk create new users. Intended for use creating multiple User objects at once. Limited to maximum batch size per API account. Released
/user PUT Selective user update. Intended for updating individual user objects. Limits to one object per call. Released

System Endpoints


Endpoint Method Purpose Comments Status
/about GET Displays current release notes. Released
/anonymize?user_id=[user_id] POST Anonymizes user data contained within user, audit, and event object archives. Pending Release
/maintenance GET Displays scheduled maintenance details. Released
/object?listtypes GET Displays available object types. Released
/object?type=[type] GET Displays object information using the provided object type. Released
/ping GET Simple ping response to check connectivity and authorization. Released
/settings GET Retrieve api settings. Released
/site GET Retrieve basic site information. Released
The following validations are performed on the indicated method and object.
Endpoint Method Submethod Field Validation
accesslevel POST doors Door ID is not duplicate
accesslevel POST doors Schedule ID is valid
accesslevel POST name Already exists in system
accesslevel POST name Missing or blank
accesslevel POST id doors Door ID is valid
credential DELETE id Id is not a Fob
credential DELETE id Id is valid
credential DELETE id Missing or blank
credential DELETE id Non-Numeric
door DELETE Id is valid
door DELETE id Missing or blank
door GET user_id user_id is valid, numeric and not blank
door POST name Already exists in system
door POST name Missing or blank
fob DELETE id Id is a Fob
fob DELETE id Missing or blank
fob DELETE id Non-Numeric
fob POST access_effective Valid date format
fob POST access_expires Valid date format
fob POST card_num Already exists in system
fob POST card_num Length versus system limit
fob POST card_num Non-Numeric
fob POST id_num Missing or blank
fob POST name Already exists in system
fob POST name Already exists in system
fob POST name Missing or blank
fob PUT access_effective Valid date format
fob PUT access_expires Valid date format
fob PUT card_num Already exists in system
fob PUT card_num Length versus system limit
fob PUT card_num Non-Numeric
fob PUT id_num Missing or blank
fob PUT name Already exists in system
fob PUT name Already exists in system
fob PUT name Missing or blank
location POST locationtype Id is valid
location POST locationtype Missing or blank
location POST name Already exists in system
location POST name Missing or blank
user DELETE id Id is valid
user DELETE id Missing or blank
user DELETE id Non-Numeric
user POST INSERT access_effective Valid date format
user POST INSERT access_expires Valid date format
user POST INSERT access_levels Duplicate Assigned Access Levels
user POST INSERT access_levels Id is valid
user POST INSERT card_num Already exists in system
user POST INSERT card_num Length versus system limit
user POST INSERT card_num Non-Numeric
user POST INSERT email Already exists in system
user POST INSERT email Missing or blank
user POST INSERT email Proper email format
user POST INSERT first_name Missing or blank
user POST INSERT id Missing or blank
user POST INSERT id Non-Numeric
user POST INSERT id_num Already exists in system
user POST INSERT id_num Missing or blank
user POST INSERT last_name Missing or blank
user POST INSERT phone Missing or blank
user POST INSERT phone Proper phone format
user POST INSERT pin Length versus system limit
user POST INSERT pin Missing or blank
user POST INSERT pin Non-Numeric
user POST UPDATE access_effective Valid date format
user POST UPDATE access_expires Valid date format
user POST UPDATE access_levels Duplicate Assigned Access Levels
user POST UPDATE access_levels Id is valid
user POST UPDATE card_num Length versus system limit
user POST UPDATE card_num Non-Numeric
user POST UPDATE card_num Used for update determination
user POST UPDATE email Already exists in system
user POST UPDATE email Missing or blank
user POST UPDATE email Proper email format
user POST UPDATE first_name Missing or blank
user POST UPDATE id Missing or blank
user POST UPDATE id Non-Numeric
user POST UPDATE id Used for update determination
user POST UPDATE id_num Missing or blank
user POST UPDATE id_num Used for update determination
user POST UPDATE last_name Missing or blank
user POST UPDATE phone Missing or blank
user POST UPDATE phone Proper phone format
user POST UPDATE pin Length versus system limit
user POST UPDATE pin Missing or blank
user POST UPDATE pin Non-Numeric
The following endpoints are available for use. Details on request and response specifics can be found in the subsequent sections.

Endpoint Method Issue Correction Plan
accesslevel POST Duplication check is spanning all supplied objects. Should be looking only within individual objects Subsequent release
door DELETE valid door id's are sometimes considered to be invald Subsequent release
door POST names are not checked for duplication within the batch Subsequent release
user GET If querystring param id is supplied and is blank, full user result set is returned Subsequent release
user GET If querystring param id_num is supplied and is blank, full user result set is returned Subsequent release
user POST Duplicate PINs not validated on submit Duplicate PIN enforcement will be removed by default in Lockt SecureAccess 2.5. This can be manually reset by Lockt in SecureAccess 2.4

Purpose
List details of the current system release.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/about

Object Definition
Property Data Type Description
version string Current release version number.
release_date string Current release date.
release_notes string Overview of current release.
release_details string Additional details regarding the release.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/about"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": {
        "version": "1.1.0",
        "release_date": "Jul 10, 2022",
        "release_notes": "July 2022 Release - Enhancements, bug fixes, documentation updates",
        "release_details": "Correction of bugs in relay calls. \r\nExpanded validation of user supplied values across all endpoints.\r\nAddition of endpoints: /about, /maintenance, /location, /locationtype, /object, /user?missingcreds, /user?installers, /user?privileged\r\n \r\n"
    }
}

Purpose
List all access levels in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/accesslevel

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the access level.
name string The name of the access level.
doors array An array of abbreviated Door objects containing Door ID and Schedule ID only.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/accesslevel"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 208,
            "name": "Security",
            "doors": [
                {
                    "id": 983,
                    "name": "Office Door"
                },
                {
                    "id": 1087,
                    "name": "Front Door"
                }
            ]
        },
        {
            "id": 212,
            "name": "Administration"
        },
        {
            "id": 512,
            "name": "Cardholder"
        },
        {
            "id": 574,
            "name": "Housekeeping",
            "doors": [
                {
                    "id": 1087,
                    "name": "Front Door"
                }
            ]
        }
    ]
}

Purpose
List all access levels in the system by indicated name.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/accesslevel?name=name

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the access level.
name string The name of the access level.
doors array An array of abbreviated Door objects containing Door ID and Schedule ID only.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

name = 'Security'

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/accesslevel?name="+name

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 208,
            "name": "Security",
            "doors": [
                {
                    "id": 983,
                    "name": "Office Door"
                },
                {
                    "id": 1087,
                    "name": "Front Door"
                }
            ]
        }
    ]
}

Purpose
Creates access levels in the system using supplied door and schedule references.

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/accesslevel

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
accesslevels An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "accesslevels": [array of access level objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
name string The name of the access level.
doors array An array of abbreviated Door objects containing Door ID and Schedule ID only.


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "accesslevels": [
    {
      "name": "Access Level l",
      "doors": [
        {
          "id": 12345,
          "schedule_id": 789
        }
      ]
    },
    {
      "name": "Access Level 2",
      "doors": [
        {
          "id": 23456,
          "schedule_id": 678
        }
      ]
    }
  ]
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/accesslevel'

accesslevelnode = {}
accessleveldata = [{} for i in range(2)]

doordata = [{} for i in range(1)]
doordata[0] = {'id': 12345, 'schedule_id': 789}
accessleveldata[0] = {'name':'Access Level 1', 'doors': doordata}

doordata = [{} for i in range(2)]
doordata[0] = {'id': 23456, 'schedule_id': 567}
doordata[1] = {'id': 12345, 'schedule_id': 789}
accessleveldata[1] = {'name':'Access Level 2', 'doors': doordata}

accesslevelnode['accesslevels'] = accessleveldata

accesslevelnode['options'] = {'validate_fails_batch':'true'}
doorjson = json.dumps(doornode)

r = requests.post(url, data=doorjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response


Purpose
Remove access levels from the system.

REST Method
DELETE

Request URL
https://cloudadpi.lockt.com/v1/accesslevel

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
accesslevels An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "accesslevels": [array of credential objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the access level


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "accesslevels": [
    {
        "id": 3456
    },
    {
        "id": 6578
    }
  ],
  "options": {
        "validate_fails_batch": "false"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/accesslevels'

acecsslevelnode = {}
acecssleveldata = [{} for i in range(2)]
acecssleveldata[0] = {'id':3456}
acecssleveldata[1] = {'id':6578}
acecsslevelnode['acecsslevels'] = acecssleveldata
acecsslevelnode['options'] = {'validate_fails_batch':'true'}
acecssleveljson = json.dumps(acecsslevelnode)

r = requests.delete(url, data=acecssleveljson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "deleted": number of records deleted,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 2,
        "errors": 0
    }
}

Purpose
List access levels used for delegation.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/delegate

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the delegate access level.
name string The name of the door
access_effective timestamp The date/time when access is enabled for this fob.
access_expires timestamp The date/time when access is disabled for this fob.
doors array An array of abbreviated Door objects containing Door ID and Name only.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/delegates"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 647929,
            "name": "delegate_af5abaf069caec3a33047702bfa6128a",
            "access_effective": "2022-09-08 11:00:00",
            "access_expires": "2022-09-08 12:00:00",
            "doors": [
                {
                    "id": 187,
                    "name": "Test Door"
                }
            ]
        },
        {
            "id": 647936,
            "name": "delegate_0f1fae3f0df3f2526aefddf814ef3056",
            "access_effective": "2022-09-08 11:00:00",
            "access_expires": "2022-09-08 12:00:00",
            "doors": [
                {
                    "id": 187,
                    "name": "Test Door"
                }
            ]
        }
    ]
}

Purpose
Delete all expired delegate access levels (where access_expires < current date/time).

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/delegate?purge

Behaviors
Context Element Behavior
PURGE access_level Access levels that are marked for delegation will be ignored if their access_expires date/time is still valid.
PURGE access_level All access levels where access_expires is before the current date/time will be deleted automatically.
PURGE response No objects are supplied in the response. Only a processing summary.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/delegates?purge"

r = requests.post(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 0,
        "errors": 0
    }
}

Purpose
Create and assign new delegate access.

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/delegate

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
deelgates An array of deelgate objects to be created.


Request Body Format
{
  "delegates": [array of delegate objects]  
}


Object Definition
Property Data Type Description
from_user_id integer The user_id of the individual granting delegate access.
to_user_id integer The user_id of the individual receiving delegate access.
access_effective date-time The date/time when access is enabled for this delegate.
access_expires date-time The date/time when access is disabled for this delegate.
doors array An array of doors which the delegating user is assigning access to the receiving user.


Behaviors
Context Element Behavior
CREATE doors The system will only allow users to delegate doors to which they currently have access. Any doors that are granted via delegation are ignored.
CREATE processing_options No processing options are supplied for this endpoint. Errors will always result in batch failure.
CREATE batch_size This endpoint is limited to 1 object per call.


Example Request Body
{
    "delegates": [
        {
            "from_user_id": "613950", 
            "to_user_id": "614111", 
            "access_effective": "2022-09-07 22:20:00",
            "access_expires": "2022-09-07 22:53:00",
            "doors": [
                {"id": 187},
                {"id": 446}
            ]
        }
    ]
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/delegate'

delegatenode = {}
delegatedata = [{} for i in range(1)]
delegatedata[0] = {'from_user_id':613950,'to_user_id':614111,'access_effective':'2022-09-07 22:20:00','access_expires':'2022-09-07 22:53:00'}
doordata = [{} for i in range(2)]
doordata[0] = {'id':187}
doordata[1] = {'id':446}
delegatedata[0]['doors'] = doordata
delegatenode['delegates'] = delegatedata
delegatejson = json.dumps(delegatenode)
r = requests.post(url, data=delegatejson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response - Success
{
    "data": {
        "submitted": 1,
        "processed": 1,
        "errors": 0
    }
}


Example Response - Errors
{
    "result": [
        "Validation errors found. Batch has failed. Details provided."
    ],
    "errors": [
        {
            "error": [
                "Door id 1876 is not available to delegate",
                "Invalid access_effective date: 2022-09-07 12:00:00, must be before access_expires",
                "Invalid access_expires date: 2022-09-07 12:00:00, cannot be in past"
            ],
            "input_data": {
                "from_user_id": "613950",
                "to_user_id": "614111",
                "access_effective": "2022-09-08 11:00:00",
                "access_expires": "2022-09-07 12:00:00",
                "doors": [
                    {
                        "id": 1876
                    }
                ]
            }
        }
    ]
}

Purpose
List all credentials in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/credential

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the credential.
card_num string The card number assigned to the credential.
name string The name of the credential.
credential_key string The credential registration key assigned to the user.
claim_status string Indicates if credential is claimed.
user object Abbreviated object for the user to which the credential is assigned.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/credential"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 335,
            "card_num": "1003",
            "credential_key": "AAAA-BBBB-1111-2222",
            "claim_status": "Claimed",
            "user": [
                {
                    "id": 300,
                    "name": "User, Test"
                }
            ]
        },
        {
            "id": 129813,
            "card_num": "1234",
            "credential_key": "CCCC-DDDD-5555-6666",
            "claim_status": "Unclaimed",
            "user": [
                {
                    "id": 244,
                    "name": "Greswell, Rhea"
                }
            ]
        }
    ]
}

Purpose
List all credentials in the system, filtered by supplied user_id.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/credential?user_id=user_id

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the credential.
card_num string The card number assigned to the credential.
name string The name of the credential.
credential_key string The credential registration key assigned to the user.
claim_status string Indicates if credential is claimed.
user object Abbreviated object for the user to which the credential is assigned.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}

user_id = 12345

url = "https://cloudapi.lockt.com/api/v1/credential?user_id="+str(user_id)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 12345,
            "card_num": "8001",
            "credential_key": "AAAA-BBBB-1111-2222",
            "claim_status": "Claimed",
            "user": [
                {
                    "id": 300,
                    "name": "User, Test"
                }
            ]
        }
    ]
}

Purpose
List all credentials in the system, filtered by supplied card_num.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/credential?user_id=card_num

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the credential.
card_num string The card number assigned to the credential.
name string The name of the credential.
credential_key string The credential registration key assigned to the user.
claim_status string Indicates if credential is claimed.
user object Abbreviated object for the user to which the credential is assigned.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}

card_num = 8001

url = "https://cloudapi.lockt.com/api/v1/credential?card_num="+str(card_num)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 335,
            "card_num": "8001",
            "credential_key": "AAAA-BBBB-1111-2222",
            "claim_status": "Claimed",
            "user": [
                {
                    "id": 300,
                    "name": "User, Test"
                }
            ]
        }
    ]
}

Purpose
Remove credentials from the system.

REST Method
DELETE

Request URL
https://cloudadpi.lockt.com/v1/credential

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
credentials An array of credential objects to be deleted.
options Contains processing instructions for the operation.


Request Body Format
{
  "credentials": [array of credential objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the credential


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "credentials": [
    {
        "id": 237809
    },
    {
        "id": 236578
    }
  ],
  "options": {
        "validate_fails_batch": "false"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/credential'

credentialnode = {}
credentialdata = [{} for i in range(2)]
credentialdata[0] = {'id':237809}
credentialdata[1] = {'id':236578}
credentialnode['credentials'] = credentialdata
credentialnode['options'] = {'validate_fails_batch':'true'}
credentialjson = json.dumps(credentialnode)

r = requests.delete(url, data=credentialjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "deleted": number of records deleted,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 2,
        "errors": 0
    }
}

Purpose
Display summary of claimed and unclaimed credentials in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/credentialsummary

Object Definition
Property Data Type Description
credentials integer Total number of credentials issued in the system.
claimed string The number of credentials that have been claimed.
unclaimed string The number of credentials that have not been claimed.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/credentialsummary"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "credentials": 31,
            "claimed": 13,
            "unclaimed": 18
        }
    ]
}

Purpose
List all doors in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/door

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the door.
type string Text description of the door type
name string The name of the door
location string The location of the door.
enabled boolean Indicates whether the door is currently enabled or disabled.
controller string The name of the controller to which the door is attached.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/door"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 166,
            "type": "Access Controlled Door",
            "name": "Office Supplies",
            "location": "Main Hall",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 174,
            "type": "Access Controlled Door",
            "name": "Hall Entrance",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 603,
            "type": "Access Controlled Door",
            "name": "Maintenance Office",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        }
    ]
}

Purpose
List all doors assigned to the indicated user_id.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/door?user_id=user_id

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the door.
name string The name of the door


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
user_id = 12345
url = "https://cloudapi.lockt.com/api/v1/door?user_id=" + str(user_id)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 166,
            "type": "Access Controlled Door",
            "name": "Office Supplies",
            "location": "Main Hall",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 174,
            "type": "Access Controlled Door",
            "name": "Hall Entrance",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 603,
            "type": "Access Controlled Door",
            "name": "Maintenance Office",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        }
    ]
}

Purpose
List all doors assigned to the indicated id_num.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/door?id_num=id_num

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the door.
name string The name of the door


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
id_num = 'ZZ123'
url = "https://cloudapi.lockt.com/api/v1/door?id_num=" + id_num

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 166,
            "type": "Access Controlled Door",
            "name": "Office Supplies",
            "location": "Main Hall",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 174,
            "type": "Access Controlled Door",
            "name": "Hall Entrance",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        },
        {
            "id": 603,
            "type": "Access Controlled Door",
            "name": "Maintenance Office",
            "location": "",
            "enabled": true,
            "controller": "BEST Switch™ API"
        }
    ]
}

Purpose
Creates doors in the system. Specifically, creates Switch™Tech doors linked to the Switch™Tech controller.

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/door

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
doors An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "doors": [array of door objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
name text The name of the door


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "doors": [
    {
        "name": "Door 1"
    },
    {
        "name": "Door 2"
    }
  ],
  "options": {
        "validate_fails_batch": "false"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/door'

doornode = {}
doordata = [{} for i in range(2)]
doordata[0] = {'name':'Door 1'}
doordata[1] = {'name':'Door 2'}
doornode['doors'] = doordata
doornode['options'] = {'validate_fails_batch':'true'}
doorjson = json.dumps(doornode)

r = requests.post(url, data=doorjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response - Success
{
    "data": {
        "submitted": 1,
        "inserted": 1,
        "updated": 1,
        "errors": 0
    }
}


Example Response - Errors
{
    "result": [
        "Validation errors found. Batch has failed. Details provided."
    ],
    "errors": [
        {
            "error": [
                "Door Name Already Exists: Door 1"
            ],
            "input_data": {
                "name": "Door 1"
            }
        }
    ]
}

Purpose
Remove doors from the system.

REST Method
DELETE

Request URL
https://cloudadpi.lockt.com/v1/door

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
doors An array of door objects to be deleted.
options Contains processing instructions for the operation.


Request Body Format
{
  "doors": [array of door objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique system assigned id of the door.


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "doors": [
    {
      "id": 32871
    },
    {
      "id": 45612
    }
  ],
    "options": {
        "validate_fails_batch": "true"
    }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/door'

doornode = {}
doordata = [{} for i in range(2)]
doordata[0] = {'id':32871}
doordata[1] = {'id':45612}
doornode['doors'] = doordata
doornode['options'] = {'validate_fails_batch':'true'}
doorjson = json.dumps(doornode)

r = requests.delete(url, data=doorjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "deleted": number of records deleted,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 2,
        "errors": 0
    }
}

Purpose
List all doors states in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/doorstate

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the door.
name string The name of the door
battery_level decimal The battery level of the door expressed as a decimal, if applicable.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/doorstate"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 187,
            "name": "Room 1",
            "battery_level": 0.64
        },
        {
            "id": 446,
            "name": "Room 2",
            "battery_level": 0.74
        },
        {
            "id": 611127,
            "name": "Room 3",
            "battery_level": 0.99
        }
    ]
}

Purpose
Read all available events, up to a maximum of 5000 records.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/events

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the event
device string The name device causing the event
code integer The integer representation of the event code
code_text string The text rerpresentation of the event code
subcode integer The integer representation of the event sub-code
subcode_text string The text rerpresentation of the event sub-code
schedule string The name of the schedule, if applicable
controller string The name of the controller, if applicable
location string The name of the location where the device is assigned, if applicable
card_num string The card number assigned to the user
user string The name of the user
category integer The integer representation of the event category
category_text string The text representation of the event category
event_time date-time The event timestamp received from the device
db_time date-time The timestamp when the event was recorded in the system


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/events"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 865,
            "device": "Core 1",
            "code": 49,
            "code_text": "Access Denied",
            "subcode": 104,
            "subcode_text": "Battery Missing",
            "schedule": "",
            "controller": "Switch™ Bridge",
            "location": "Main Hall",
            "card_num": "1000",
            "user": "Jones, Adam",
            "category": 2,
            "category_text": "Door Access Denied",
            "hw_time": "2021-11-18T16:15:28.000Z",
            "db_time": "2021-11-19T00:47:09.651Z"
        },
        {
            "id": 864,
            "device": "Core 1",
            "code": 49,
            "code_text": "Access Denied",
            "subcode": 104,
            "subcode_text": "Battery Missing",
            "schedule": "",
            "controller": "Switch™ Bridge",
            "location": "Main Hall",
            "card_num": "1000",
            "user": "Smith, Sally",
            "category": 2,
            "category_text": "Door Access Denied",
            "hw_time": "2021-11-18T16:15:25.000Z",
            "db_time": "2021-11-19T00:44:06.950Z"
        },
        {
            "id": 837,
            "device": "Core 2",
            "code": 48,
            "code_text": "Access Granted",
            "schedule": "",
            "controller": "Switch™ Bridge",
            "location": "",
            "card_num": "1001",
            "user": "Jackson, Kelly",
            "category": 1,
            "category_text": "Door Access Granted",
            "hw_time": "2021-11-17T13:58:01.000Z",
            "db_time": "2021-11-17T13:58:07.035Z"
        }
    ]
}

Purpose
Retrieve a list of event objects after the specified id.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/events?id=id

Request Parameters
Name Description Data Type Optional / Required
id A numeric id representing the unique record identifier in Lockt SecureAccess integer required


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the event
device string The name device causing the event
code integer The integer representation of the event code
code_text string The text rerpresentation of the event code
subcode integer The integer representation of the event sub-code
subcode_text string The text rerpresentation of the event sub-code
schedule string The name of the schedule, if applicable
controller string The name of the controller, if applicable
location string The name of the location where the device is assigned, if applicable
card_num string The card number assigned to the user
user string The name of the user
category integer The integer representation of the event category
category_text string The text representation of the event category
event_time date-time The event timestamp received from the device
db_time date-time The timestamp when the event was recorded in the system


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
lastid = 17249

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/events?id=" + str(lastid)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 865,
            "device": "Core 1",
            "code": 49,
            "code_text": "Access Denied",
            "subcode": 104,
            "subcode_text": "Battery Missing",
            "schedule": "",
            "controller": "Switch™ Bridge",
            "location": "Main Hall",
            "card_num": "1000",
            "user": "Jones, Adam",
            "category": 2,
            "category_text": "Door Access Denied",
            "hw_time": "2021-11-18T16:15:28.000Z",
            "db_time": "2021-11-19T00:47:09.651Z"
        },
        {
            "id": 864,
            "device": "Core 1",
            "code": 49,
            "code_text": "Access Denied",
            "subcode": 104,
            "subcode_text": "Battery Missing",
            "schedule": "",
            "controller": "Switch™ Bridge",
            "location": "Main Hall",
            "card_num": "1000",
            "user": "Smith, Sally",
            "category": 2,
            "category_text": "Door Access Denied",
            "hw_time": "2021-11-18T16:15:25.000Z",
            "db_time": "2021-11-19T00:44:06.950Z"
        }
    ]
}

Purpose
List all fobs in the system. Fobs are credential objects that are specifically tagged to be used as Fobs.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/fob

Object Definition
Property Data Type Description
id_num text Unique id number to identify the fob. Supplied by external system.
name string The name of the fob.
card_num string The card number assigned to the fob.
credential_key string The credential registration key assigned to the fob.
enabled boolean Indicates whether the fob is enabled.
access_effective date-time The date/time when access is enabled for this fob.
access_expires date-time The date/time when access is disabled for this fob.
accesslevels array An array of access level assignment objects associated with this fobs.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/fob"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 443,
            "id_num": "10000",
            "name": "Office Floor 1 FOB 1",
            "card_num": "10000",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "enabled": false,
            "access_effective": "2022-07-10T09:00:00.000Z",
            "access_expires": "2022-07-10T12:00:00.000Z",
            "accesslevels": []
        },
        {
            "id": 232,
            "id_num": "10000",
            "name": "Office Floor 2 FOB 1",
            "card_num": "11000",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "enabled": false,
            "access_effective": "2022-07-10T09:00:00.000Z",
            "access_expires": "2022-07-10T12:00:00.000Z",
            "accesslevels": []
        }
  ]
}

Purpose
Read specific Fob record by indicated id.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/fob?id=id

Object Definition
Property Data Type Description
id_num text Unique id number to identify the fob. Supplied by external system.
name string The name of the fob.
card_num string The card number assigned to the fob.
credential_key string The credential registration key assigned to the fob.
enabled boolean Indicates whether the fob is enabled.
access_effective date-time The date/time when access is enabled for this fob.
access_expires date-time The date/time when access is disabled for this fob.
accesslevels array An array of access level assignment objects associated with this fobs.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
id = 443
url = "https://cloudapi.lockt.com/api/v1/fob?id="+str(id)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 443,
            "id_num": "10000",
            "name": "Office Floor 1 FOB 1",
            "card_num": "10000",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "enabled": false,
            "access_effective": "2022-07-10T09:00:00.000Z",
            "access_expires": "2022-07-10T12:00:00.000Z",
            "accesslevels": []
        }
  ]
}

Purpose
Read specific Fob record by indicated id_num.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/fob?id_num=id_num

Object Definition
Property Data Type Description
id_num text Unique id number to identify the fob. Supplied by external system.
name string The name of the fob.
card_num string The card number assigned to the fob.
credential_key string The credential registration key assigned to the fob.
enabled boolean Indicates whether the fob is enabled.
access_effective date-time The date/time when access is enabled for this fob.
access_expires date-time The date/time when access is disabled for this fob.
accesslevels array An array of access level assignment objects associated with this fobs.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
id_num = "10000"
url = "https://cloudapi.lockt.com/api/v1/fob?id_num="+str(id_num)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 443,
            "id_num": "10000",
            "name": "Office Floor 1 FOB 1",
            "card_num": "10000",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "enabled": false,
            "access_effective": "2022-07-10T09:00:00.000Z",
            "access_expires": "2022-07-10T12:00:00.000Z",
            "accesslevels": []
        }
  ]
}

Purpose
Read specific Fob record by indicated card_num.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/fob?card_num=card_num

Object Definition
Property Data Type Description
id_num text Unique id number to identify the fob. Supplied by external system.
name string The name of the fob.
card_num string The card number assigned to the fob.
credential_key string The credential registration key assigned to the fob.
enabled boolean Indicates whether the fob is enabled.
access_effective date-time The date/time when access is enabled for this fob.
access_expires date-time The date/time when access is disabled for this fob.
accesslevels array An array of access level assignment objects associated with this fobs.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
card_num = "10000"
url = "https://cloudapi.lockt.com/api/v1/fob?card_num="+str(card_num)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 443,
            "id_num": "10000",
            "name": "Office Floor 1 FOB 1",
            "card_num": "10000",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "enabled": false,
            "access_effective": "2022-07-10T09:00:00.000Z",
            "access_expires": "2022-07-10T12:00:00.000Z",
            "accesslevels": []
        }
  ]
}

Purpose
Creates new Fob records. Fobs are credential objects that are specifically tagged to be used as Fobs.

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/fob

Request Body Format
{
  "fobs": [array of fob objects]
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the fob
id_num string Unique id number to identify the fob. Supplied by external system.
name string The name of the fob.
card_num string The card number assigned to the fob.
access_effective date-time The date/time when access is enabled for this fob.
access_expires date-time The date/time when access is disabled for this fob.


Example Request Body
{
   "fobs": [
   {
    "name": "Fob 1",
    "id_num": "ABC123",
    "card_num": 5599,
    "access_effective": "2022-05-05 05:00:00",
    "access_expires": "2022-05-25 08:00:00"
   }
  ]
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/fob'

fobnode = {}
fobdata = [{} for i in range(1)]
fobdata[0] = {'name':'Fob 1','id_num':'ABC123','card_num':'5599','access_effective':'','access_expires':''}
fobnode['fobs'] = fobdata
fobjson = json.dumps(fobnode)

r = requests.post(url, data=fobjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "inserted": number of records inserted,
        "updated": number of records updated,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 1,
        "inserted": 1,
        "updated": 0,
        "errors": 0
    }
}

Purpose
Reassigns a Fob to an indicated User record, thereby inheriting access rights. Fobs are credential objects that are specifically tagged to be used as Fobs.

REST Method
PUT

Request URL
https://cloudapi.lockt.com/api/v1/fob

Request Body Format
{
  "fobs": [array of fob objects]
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the fob
user_id string The unique, system assigned id of the user record to which tis fob will be assigned
access_effective timestamp The date/time when access is enabled for this fob.
access_expires timestamp The date/time when access is disabled for this fob.


Behaviors
Context Element Behavior
REASSIGN user_id If 0 is supplied, the system will take this as a signal to remove any existing user assignments from this FOB.


Example Request Body
{
   "fobs": [
   {
    "id": "613297",
    "user_id": "613188",
    "access_effective": "2022-06-10 05:00:00",
    "access_expires": "2022-06-10 08:00:00"
   }
  ]
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/fob'

fobnode = {}
fobdata = [{} for i in range(1)]
fobdata[0] = {'id':12345,'user_id':87654}
fobnode['fobs'] = fobdata
fobjson = json.dumps(fobnode)

r = requests.put(url, data=fobjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "inserted": number of records inserted,
        "updated": number of records updated,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 1,
        "inserted": 1,
        "updated": 0,
        "errors": 0
    }
}

Purpose
Remove Fobs from the system.

REST Method
DELETE

Request URL
https://cloudadpi.lockt.com/v1/fob

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
locations An array of location objects to be deleted.
options Contains processing instructions for the operation.


Request Body Format
{
  "fobs": [array of fob objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique system assigned id of the location.


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "fobs": [
    {
      "id": 7134
    },
    {
      "id": 6398
    }
  ],
    "options": {
        "validate_fails_batch": "true"
    }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/fob'

locationnode = {}
locationdata = [{} for i in range(2)]
locationdata[0] = {'id':7134}
locationdata[1] = {'id':6398}
locationnode['locations'] = locationdata
locationnode['options'] = {'validate_fails_batch':'true'}
locationjson = json.dumps(locationnode)

r = requests.delete(url, data=locationjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "deleted": number of records deleted,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 2,
        "errors": 0
    }
}

Purpose
List all locations in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/location

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the location.
name string The name of the location
type string The type of the location.
enabled boolean Indicates whether the location is currently enabled or disabled.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/location"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 123456,
            "name": "North Region",
            "type": "Region",
            "enabled": false
        },
        {
            "id": 123457,
            "name": "Headquarters",
            "type": "Campus",
            "enabled": false
        },
        {
            "id": 123458,
            "name": "University",
            "type": "Campus",
            "enabled": false
        }
    ]
}

Purpose
Creates locations in the system.

REST Method
POST

Request URL
https://cloudapi.lockt.com/api/v1/location

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
locations An array of location objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "locations": [array of location objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
name string The name of the location.
locationtype integer Reference to the id of the location type for this location


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "locations": [
    {
      "name": "Main Campus",
      "locationtype": 175
    },
    {
      "name": "Back Warehouse",
      "locationtype": 192
    }
  ],
    "options": {
        "validate_fails_batch": "true"
    }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/location'

locationnode = {}
locationdata = [{} for i in range(2)]
locationdata[0] = {'name':'Main Campus','locationtype': 175}
locationdata[1] = {'name':'Back Warehouse', 'locationtype': 192}
locationnode['locations'] = locationdata

locationnode['options'] = {'validate_fails_batch':'true'}
doorjson = json.dumps(doornode)

r = requests.post(url, data=doorjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response


Purpose
List all location types in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/locationtype

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the location type.
name string The name of the location type


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/locationtype"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 23981,
            "name": "Building"
        },
        {
            "id": 1345,
            "name": "Floor"
        }
    ]
}

Purpose
List all objects in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/object?listtypes

Object Definition
Property Data Type Description
object string Name of the object.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/object?listtypes"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "object": "accesslevel"
        },
        {
            "object": "accesslevel_create"
        },
        {
            "object": "credential"
        },
        {
            "object": "door"
        },
        {
            "object": "door_create"
        },
        {
            "object": "doorstate"
        },
        {
            "object": "event"
        },
        {
            "object": "fob"
        },
        {
            "object": "location"
        },
        {
            "object": "locationtype"
        },
        {
            "object": "maintenance"
        },
        {
            "object": "schedule"
        },
        {
            "object": "user"
        },
        {
            "object": "user_create"
        },
        {
            "object": "user_delete"
        }
    ]
}

Purpose
Get object by type.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/object?type=type

Object Definition
Property Data Type Description
property string Property name of the object.
datatype string Pata type of the property.
description string Description of the property


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/object?type=location"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "property": "id",
            "datatype": "integer",
            "description": "The unique, system assigned id of the location."
        },
        {
            "property": "name",
            "datatype": "string",
            "description": "The name of the location"
        },
        {
            "property": "type",
            "datatype": "string",
            "description": "The type of the location."
        },
        {
            "property": "enabled",
            "datatype": "boolean",
            "description": "Indicates whether the location is currently enabled or disabled."
        }
    ]
}

Purpose
List all schedules in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/schedule

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the schedule.
name string The name of the schedule.
d0 bit Will be set to 1 if the schedule includes day 0 (typically Monday).
d1 bit Will be set to 1 if the schedule includes day 1 (typically Tuesday).
d2 bit Will be set to 1 if the schedule includes day 2 (typically Wednesday).
d3 bit Will be set to 1 if the schedule includes day 3 (typically Thursday).
d4 bit Will be set to 1 if the schedule includes day 4 (typically Friday).
d5 bit Will be set to 1 if the schedule includes day 5 (typically Saturday).
d6 bit Will be set to 1 if the schedule includes day 6 (typically Sunday).
start time The time the schedule starts in format HH:MM:SS
stop time The time the schedule stops in format HH:MM:SS


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/schedule"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 543,
            "name": "0800-1700 M-F, 1200-1500 Sat",
            "d0": 1,
            "d1": 1,
            "d2": 1,
            "d3": 1,
            "d4": 1,
            "d5": 0,
            "d6": 0,
            "start": "08:00:00",
            "stop": "16:59:59"
        },
        {
            "id": 1404,
            "name": "Weekend Cleaners",
            "d0": 0,
            "d1": 0,
            "d2": 0,
            "d3": 0,
            "d4": 0,
            "d5": 1,
            "d6": 1,
            "start": "06:40:00",
            "stop": "19:49:59"
        }
    ]
}

Purpose
List all non-administrative, card holder users in the system.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user"

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 5678,
            "id_num": "",
            "name": "Fob 1",
            "card_num": "10000",
            "credential_key": "",
            "enabled": false,
            "access_effective": "",
            "access_expires": "",
            "accesslevels": []
        },
        {
            "id": 6789,
            "id_num": "",
            "name": "Fob 2",
            "card_num": "10001",
            "credential_key": "",
            "enabled": false,
            "access_effective": "2022-05-05T09:00:00.000Z",
            "access_expires": "2022-05-05T12:00:00.000Z",
            "accesslevels": []
        }
    ]
}

Purpose
Read individual non-administrative, card holder user with the specified id.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user?id=id

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.
credentials array An array of credential objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
id = 1693

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user?id=" + str(id)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 1693,
            "id_num": "329359",
            "last_name": "Brown3",
            "first_name": "Susan3",
            "card_num": "8769",
            "pin": "8822",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "email": "susan.brown@web.place",
            "phone": "33344455555",
            "access_effective": "",
            "access_expires": "",
            "enabled": true,
            "accesslevels": [
                {
                    "unid": 364,
                    "name": "Office Doors"
                }
            ],
            "credentials": [
                {
                    "id": 613832,
                    "name": "8769",
                    "card_num": "8769",
                    "credential_key": "XXXX-XXXX-XXXX-XXXX",
                    "fob": false
                },
                {
                    "id": 614010,
                    "name": "Fob 1A",
                    "card_num": "10050",
                    "credential_key": "YYYY-YYYY-YYYY-YYYY",
                    "fob": true
                }
            ]
        }
    ]
}

Purpose
Read individual non-administrative, card holder user with the specified idnum.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user?id_num=id_num

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.
credentials array An array of credential objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
idnum = "ABC123-98765"

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user?idnum=" + str(idnum)

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 1693,
            "id_num": "329359",
            "last_name": "Brown3",
            "first_name": "Susan3",
            "card_num": "8769",
            "pin": "8822",
            "credential_key": "XXXX-XXXX-XXXX-XXXX",
            "email": "susan.brown@web.place",
            "phone": "33344455555",
            "access_effective": "",
            "access_expires": "",
            "enabled": true,
            "accesslevels": [
                {
                    "unid": 364,
                    "name": "Office Doors"
                }
            ],
            "credentials": [
                {
                    "id": 613832,
                    "name": "8769",
                    "card_num": "8769",
                    "credential_key": "XXXX-XXXX-XXXX-XXXX",
                    "fob": false
                },
                {
                    "id": 614010,
                    "name": "Fob 1A",
                    "card_num": "10050",
                    "credential_key": "YYYY-YYYY-YYYY-YYYY",
                    "fob": true
                }
            ]
        }
    ]
}

Purpose
List all non-administrative, card holder users in the system that are missing credentials.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user?missingcreds

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
id = 1693

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user?missingcreds

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 5678,
            "id_num": "",
            "name": "Fob 1",
            "card_num": "10000",
            "credential_key": "",
            "enabled": false,
            "access_effective": "",
            "access_expires": "",
            "accesslevels": []
        },
        {
            "id": 6789,
            "id_num": "",
            "name": "Fob 2",
            "card_num": "10001",
            "credential_key": "",
            "enabled": false,
            "access_effective": "2022-05-05T09:00:00.000Z",
            "access_expires": "2022-05-05T12:00:00.000Z",
            "accesslevels": []
        }
    ]
}

Purpose
List all users with installer rights.

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user?installers

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
id = 1693

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user?installers

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 5678,
            "id_num": "",
            "name": "Fob 1",
            "card_num": "10000",
            "credential_key": "",
            "enabled": false,
            "access_effective": "",
            "access_expires": "",
            "accesslevels": []
        },
        {
            "id": 6789,
            "id_num": "",
            "name": "Fob 2",
            "card_num": "10001",
            "credential_key": "",
            "enabled": false,
            "access_effective": "2022-05-05T09:00:00.000Z",
            "access_expires": "2022-05-05T12:00:00.000Z",
            "accesslevels": []
        }
    ]
}

Purpose
List all privileged users (with access to the system).

REST Method
GET

Request URL
https://cloudapi.lockt.com/api/v1/user?privileged

Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
credential_key string The credential registration key assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
accesslevels array An array of access level assignment objects associated with this user.


Code Examples
import json
import requests

apiuser = "9r8ehveyb5h8mnwwet4yf9ugjynz8pkn"
apikey =  "hqx7wde64vwe987fvg6q4zaautrs3p7j"
id = 1693

headers = {"Content-type": "application/json", "apiuser":apiuser ,"apikey":apikey}
url = "https://cloudapi.lockt.com/api/v1/user?privileged

r = requests.get(url, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Example Response
{
    "data": [
        {
            "id": 5678,
            "id_num": "",
            "name": "Fob 1",
            "card_num": "10000",
            "credential_key": "",
            "enabled": false,
            "access_effective": "",
            "access_expires": "",
            "accesslevels": []
        },
        {
            "id": 6789,
            "id_num": "",
            "name": "Fob 2",
            "card_num": "10001",
            "credential_key": "",
            "enabled": false,
            "access_effective": "2022-05-05T09:00:00.000Z",
            "access_expires": "2022-05-05T12:00:00.000Z",
            "accesslevels": []
        }
    ]
}

Purpose
Create/update users in the system.

REST Method
POST

Request URL
https://cloudadpi.lockt.com/v1/user/

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
users An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "users": [array of user objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
id_num string Unique id number to identify the user. Supplied by external system.
first_name string The first name of the user.
last_name string The last name of the user.
card_num string The card number assigned to the user.
email string The email address associated with the user.
phone string The phone number associated with the user.
pin integer The pin number associated with the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
enabled boolean Flag to enable / disable the user.
accesslevels array An array of access level assignment objects associated with this users.


Access Level Object Definition
Property Data Type Description
id integer The unique, system assigned id of the access level.


Behaviors
Context Element Behavior
INSERT id On initial insert, this value must be -1.
INSERT/UPDATE id, id_num, email A valid id is required for the system to consider an update. Once an update is determined, it will check the id_num and email for validity. Note: Previously, the system would consider any match of these fields to be a trigger for update. This has been updated as the previous method could result in inconsistent matches.
UPDATE card_num If a value of -1 is supplied, the system will consider that as an signal to remove all existing, non-FOB credentials from the user.
INSERT/UPDATE card_num A supplied card_num will be used only if the record is 1) being inserted, 2) has no existing card, 3) value is -1 (see above). Otherwise, card_num will be ignored during updates.
UPDATE access_levels If access_levels are provided, and replace_privileges=false, the system will consider that as the access_levels being addative to the current access_level set.
UPDATE access_levels If access_levels are provided, and replace_privileges=true, the system will consider that as signal to replace the users current access_levels with the supplied values.
UPDATE access_levels If access_levels are provided as an empty object, and replace_privileges=true, the system will consider that as signal to remove all existing access_levels from the user.
UPDATE update_existing If update_existing=false, records that are determined to be updates of existing records will be ignored.
UPDATE validate_fails_batch If validate_fails_batch=false, and validation errors are found, records not containing errors will be processed.


Processing Options Object Definition
Property Data Type Description
update_existing boolean If set to false, any user objects submitted with a matching id_num or email address will be ignored. If set to true, the system will attempt to update existing records by matching id_num and email address. This property defaults to false if not presented.
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.
replace_privileges boolean If set to false, privileges will be added to the user's existing privileges. If set to true, the existing privileges will be deleted and the new privileges added. This property defaults to true if not presented.


Example Request Body
{
  "users": [
    {
        "id": 4432,
        "id_num": "ABC123",
        "last_name": "Peters",
        "first_name": "Toby",
        "card_num": "8769",
        "credential_key": "",
        "email": "toby.peters@web.place",
        "pin": "1234",
        "phone": "33344455555",
        "access_effective": "",
        "access_expires": "",
        "enabled": "true",
        "accesslevels": [
                {"id": 123},
                {"id": 789}
        ]
    },
    {
        "id": 7612,
        "id_num": "DEF567",
        "last_name": "Wilson",
        "first_name": "Dana",
        "card_num": "8769",
        "credential_key": "",
        "email": "dana.wilson@web.place",
        "pin": "4567",
        "phone": "33344455555",
        "access_effective": "",
        "access_expires": "",
        "enabled": "true",
        "accesslevels": [
                {"id": 123},
                {"id": 789}
        ]
    }
  ],
  "options": {
        "update_existing": "true",
        "validate_fails_batch": "false",
        "replace_privileges": "true"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/user'

usernode = {}
userdata = [{} for i in range(2)]
userdata[0] = {'id':4432,'id_num':'ABC123','last_name':'Peters','first_name':'Toby','card_num':'5588','credential_key':'','email':'toby.peters@web.place','phone':'33344455555','access_effective':'','access_expires':'','enabled':'true'}
userdata[1] = {'id':7612,'id_num':'DEF567','last_name':'Wilson','first_name':'Dana','card_num':'9900','credential_key':'','email':'dana.wilson@web.place','phone':'33344455555','access_effective':'','access_expires':'','enabled':'true'}
usernode['users'] = userdata
usernode['options'] = {'update_existing':'true','validate_fails_batch':'true','replace_privileges':'true'}
userjson = json.dumps(usernode)

r = requests.post(url, data=userjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "inserted": number of records inserted,
        "updated": number of records updated,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 1,
        "inserted": 0,
        "updated": 1,
        "errors": 0
    }
}

Purpose
Update users individually.

REST Method
PUT

Request URL
https://cloudadpi.lockt.com/v1/user/

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
users An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "users": [array of user objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user
card_num string The card number assigned to the user.
access_effective date-time The date/time when access is enabled for this user.
access_expires date-time The date/time when access is disabled for this user.
enabled boolean Flag to enable / disable the user.
accesslevels array An array of access level assignment objects associated with this users.


Access Level Object Definition
Property Data Type Description
id integer The unique, system assigned id of the access level.


Behaviors
Context Element Behavior
UPDATE id Required.
UPDATE card_num If a value of -1 is supplied, the system will consider that as an signal to remove all existing, non-FOB credentials from the user.
UPDATE card_num A supplied card_num will be used only if the record 1) has no existing card, 2) value is -1 (see above). Otherwise, card_num will be ignored during updates.
UPDATE access_levels If access_levels are provided, and replace_privileges=false, the system will consider that as the access_levels being addative to the current access_level set.
UPDATE access_levels If access_levels are provided, and replace_privileges=true, the system will consider that as signal to replace the users current access_levels with the supplied values.
UPDATE access_levels If access_levels are provided as an empty object, and replace_privileges=true, the system will consider that as signal to remove all existing access_levels from the user.
UPDATE access_effective / access_expires access_effective must be before access_expires. access_expires cannot be in the past.
UPDATE all All properties but id are optional. The system will act upon only the supplied object properties.


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.
replace_privileges boolean If set to false, privileges will be added to the user's existing privileges. If set to true, the existing privileges will be deleted and the new privileges added. This property defaults to true if not presented.


Example Request Body
## Full Object
{
    "users": [
    {
        "id": "618395",
        "enabled": true,
        "access_effective": "",
        "access_expires": "2022-09-20 08:00:00",
        "card_num": "123456",
        "accesslevels": [{"id":188}]
    }
], "options": {
        "validate_fails_batch": "true",
        "replace_privileges": "true"
  }
}

## Selective Update Example 1
##
## The system will process only the supplied values
##
{
    "users": [
    {
        "id": "618395",
        "card_num": "123456"
    }
], "options": {
        "validate_fails_batch": "true",
        "replace_privileges": "true"
  }
}

## Selective Update Example 2
##
## The system will process only the supplied values
##
{
    "users": [
    {
        "id": "618395",
        "accesslevels": [{"id":188}]
    }
], "options": {
        "validate_fails_batch": "true",
        "replace_privileges": "true"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/user'

usernode = {}
userdata = [{} for i in range(2)]
userdata[0] = {'id':4432,'card_num':'5588'}
usernode['users'] = userdata
usernode['options'] = {'validate_fails_batch':'true','replace_privileges':'true'}
userjson = json.dumps(usernode)

r = requests.put(url, data=userjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
  "users": [array of user objects],
  "options": {processing options}  
}


Example Response
{
    "data": {
        "submitted": 1,
        "inserted": 0,
        "updated": 1,
        "errors": 0
    }
}

Purpose
Delete users from the system.

REST Method
DELETE

Request URL
https://cloudadpi.lockt.com/v1/user/

Request Body Parameters
The body of the operation contains the following nodes:
Node Description
users An array of user objects to be created.
options Contains processing instructions for the operation.


Request Body Format
{
  "users": [array of user objects],
  "options": {processing options}  
}


Object Definition
Property Data Type Description
id integer The unique, system assigned id of the user


Processing Options Object Definition
Property Data Type Description
validate_fails_batch boolean If set to false, validation errors will be returned in the response body and records passing validation will be processed. If set to true, a validation error will fail the entire batch. This property defaults to true if not presented.


Example Request Body
{
  "users": [
    {
        "id": 4432
    },
    {
        "id": 7612
    }
  ],
  "options": {
        "validate_fails_batch": "false"
  }
}


Code Examples
import json
import requests

apiuser = '9r8ehveyb5h8mnwwet4yf9ugjynz8pkn'
apikey =  'hqx7wde64vwe987fvg6q4zaautrs3p7j'

headers = {'Content-type': 'application/json', 'apiuser':apiuser ,'apikey':apikey}
url = 'https://cloudapi.lockt.com/api/v1/user'

usernode = {}
userdata = [{} for i in range(2)]
userdata[0] = {'id':4432}
userdata[1] = {'id':7612}
usernode['users'] = userdata
usernode['options'] = {'validate_fails_batch':'true'}
userjson = json.dumps(usernode)

r = requests.delete(url, data=userjson, headers=headers)
data = r.json()
if r.status_code == 200:        
    #process the response    
else:
    #check for failed response



Response Body Format
{
    "data": {
        "submitted": number of records submitted,
        "deleted": number of records deleted,
        "errors": number of errors encountered
    }
}


Example Response
{
    "data": {
        "submitted": 2,
        "deleted": 2,
        "errors": 0
    }
}