API Quickstart

This section will be a quickstart guide to using the Allthenticate API.

API Key

  • Obtain an API Key from the admin portal if you don’t already have one. This is required to make API calls.

  • This can be done by visiting the admin portal -> Settings -> API Keys -> Generate a new key
    • You can set a custom expiry time for the key if you wish, or leave it at 0 to never expire.

  • You will need to add this key in your Web Request s in order to make API calls.

Retrieve all Users

  • To retrieve all users in your organization, make a GET request to the /multipleusers endpoint.
    email:

    (Optional) Boolean flag if you want the email of each user included in the name field.

    user_tag:

    (Optional) Use GUEST to get the guest users

    return:
    [
        {
            "ad_status": "ACTIVE", # Authentication Device Status
            "active_date": "2020-03-20 01:30:34",
            "confirmed": "2020-03-20 01:30:16",
            "created": "2020-03-20 01:30:05",
            "device_added": "2023-01-23 23:46:35",
            "email": "joe@developer.com",
            "email_id": 1,
            "email_status": "CONFIRMED",
            "first_name": "Chad",
            "groups": [ [ "Employees" ], ...],
            "last_name": "Spensky",
            "name": "Joe Developer"
            "user_id": 1,
            "username": "cspensky",
            "unique_id": Unique identifier
            "name": first_name + last_name
        },
        <more users>
    ]
    
  • The response will contain a list of all users in your organization.

Invite Users

  • In order to use Allthenticate, you will need to invite users to your organization.

  • To make the API call, do the following:
    • Make a POST request to the /invites endpoint with the following parameters:
      emails:

      (Required) List of email addresses to invite to the organization

      smartcards:

      (Optional) List of smartcard arrays mapped directly to the emails in the same order

      groups:

      (Optional) List of group objects that should contain the properties ‘id’ and ‘name’,

      no_email:

      (Optional) If this is set to ‘true’ no emails will be sent to the invited users

      which each invited user will be added to

      return:
      {
          "success": "Success! All members have been invited to join your organization.",
          "added": added,
          "invited": invited,
          "exists": exists,
          "invalid": invalid,
          "failed_invite": failed_invited,
          "add_ids": add_ids,
          "group_names": group_names,
          "send_email": send_email,
      }, 200
      
      {"error": "error message"}, [400 or 500] on failure
      
    • The user will receive an email with a link to create an account and set their password.

Managing Groups

  • You can create groups and include users for efficient management.

  • To make a new group, do the following:
    • Make a POST request to the /groups endpoint with the following eters:
      type:

      (Required) The type of group to create. Either “users” or “resources”

      name:

      (Required) The name of the group to create

      add_ids:

      (Required) A list of IDs to add to the group. For users ids are from the email_id returned in a get request to the user endpoint. For resources ids are from the resource_id returned in a get request to the resource endpoint. Formatted as [1, 2,…]

      resource_type:

      (Optional) The type of resource to create. Only used if type is “resources”. Either “COMPUTER” or “DOOR”

      return:
      {success: "Group has been successfully created!", group_id: 2}, 200
      
      {"error": "error message"}, !200 on failure
      
    • The response will contain the ID of the group you created.

  • To modify the users of a group, do the following:
    • Make a PUT request to /groups with the following eters:
      type:

      (Required) String users or resources

      group_id:

      (Required) Int representing the group id of the group being modified

      add_ids:

      (Optional) list of ids that will be added to the group

      del_ids:

      (Optional) list of ids that will be deleted from the group

      return:
      {success: "Group has been successfully updated!"}, 200
      
      {"error": "error message"}, !200 on failure
      

Create PIN/SmartCard for users

  • To assign a PIN or SmartCard to a user, you will need to make an API call.

  • To make the API call, do the following:
    • Make a PUT request to the /modifysmartcards endpoint with the following parameters:
      • api_key required - The API key you generated in step 1.

      • email_id required - The ID of the user you wish to assign the smartcard to.

      • smartcards required - A Serialized JSON array of smartcards you wish to assign to the user.

      [ {"number": "<integer string>", (optional) "label": "<label string>" }, ... ]
      
      • allow_duplicates optional - A boolean value that determines whether to allow duplicate smartcards.

Locking and Unlocking Doors

  • To lock or unlock a door, you will need to make an API call.

  • To make the API call, do the following:
    • Make a POST request to the /setlockstatus endpoint with the following parameters:
      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
      
    • The response will contain a message indicating the status of the door.