Resources

Organizations can have various resources associated with them. Currently supported resources are doors and computers. APIs for resources and their lock status are documented below.

All the endpoints and how to interface them are documented below

/masslock

Lock or unlock doors in bulk, either through a door group or all doors in an organization. Requires assurance.

Resource Methods

/POST

This will lock all doors in a given resource group ID or all doors in an organization by default.

Parameters:
  • lock_state – (Required) lock or unlock event for the door.

  • group_id – (Optional) resource_group_id of the door. If not given default to all doors in the org

  • unlock_time – (Optional) time in seconds to unlock the door for (if unlocking). Times can only be 5-60 seconds and will be automatically corrected if given is out of range.

  • force_lock – (Optional) force lock the door even if it is already locked. Defaults to false.

  • lock_wait – (Optional) is zero by default since this is an emergency lock

Returns:

{"success: message"}, 200 success on state change
{"error: message"}, !200 on failure

/multipleresources

GET the list of all the resources in the organization. Requires authentication to call.

Resource Methods

/GET
Parameters:

type – (Optional) What type of resource should be returned?

Supported resource types are [‘COMPUTER’, DOOR’]

Returns:

[
    {
        "groups": [ ["Doors"], ... ],
        "name": "Downstairs Door",
        "org_id": 1, # Organization ID
        "policies": [ [ "Guest Policy" ], ... ],
        "public_key": "-----BEGIN CERTIFICATE-----",
        "resource_id": 203,
        "resource_status_id": 1360, #?
        "resource_subtype": null, # this field is currently unused
        "resource_type": "DOOR",
        "resource_info": { ... resource information ... }
        "resource_status": { lock_status, online_status }
        "seen": "2021-12-05 10:08:05",
        "status": "ACTIVE",
        "unique_id": 203,
        "updated": "2021-12-05 10:08:05", # Last time this resource received a new configuration
        "uuid": "750b2428-6b1d-4f16-9fc4-3eae469a10l1" # Resource UUID
    },
    <more resources>
], 200
{"error": "error message"}, !200 on failure

/resource

API endpoint for a single resource. You can get a resource, modify it’s name, and delete it through this endpoint. Adding a resource to allthenticate should be done through the AddResource API endpoint instead.

Resource Methods

/DELETE

Delete a resource from the organization. If there are any policies or schedules directly tied to the resource (ie not through a group), the delete call will fail. If the resource is in a group it will be deleted from the group and any corresponding policies or schedules that apply to the group. Requires assurance.

Parameters:

resource_id – (Required) The id of the resource you want to delete.

Returns:

{
    "success": f"Resource {resource_name} was successfully deleted from your organization."
}, 200
{"error": "error message"}, !200 on failure

/GET

Return a single resource’s info given the resource_id.

Parameters:

resource_id – (Required) The resource_id of the resource you want to get.

Returns:

{
    "resource_id": 2,
    "org_id": 1,
    "name": "Computer 1",
    "uuid": "ae1308d0-1fd3-443e-b2d4-2abb0995e6d9",
    "public_key": "computer_key",
    "resource_type": "COMPUTER",
    "resource_subtype": null,
    "status": "ACTIVE",
    "resource_info": { ... resource information ... }
    "resource_status": { lock_status, online_status }
    "resource_status_id": null,
    "updated": null,
    "seen": null,
    "groups": [],
    "policies": [
        [
            "computer_policy"
        ]
    ],
    "unique_id": 2
}, 200

{"error": "error message"}, !200 on failure
/POST

Change a resource’s name given the resource_id and the new name.

Parameters:
  • resource_id – (Required) The resource_id of the resource you want to change.

  • resource_name – (Required) The new name of the resource.

Returns:

{
    "success": "Resource name successfully updated to {resource_name}"
}, 200
{"error": "error message"}, !200 on failure

/setlock

Get/Set the lock state on a resource. Post will be used to set lock status Get will be used to get lock status

Resource Methods

/POST

Call to request a lock_state change for a resource.

args:
  • uuid: (Required) String UUID of the resource that will have its lock state changed.

  • lock_state: (Required) Boolean value determining if resource will be locked or unlocked. True = locked.

  • unlock_time: (Optional) Int how long you want the door to stay unlock for, in seconds

return:
  • {“error”/”success”: message}, http_code