Door Access API

Door Access API

How to enable the Door Access API

In your Hive admin, visit Settings -> External Door API. Enable the Door Access API and configure the API key. The base endpoint url will be displayed below the API key. Every Hive's API base endpoint url is unique.

About the API

The API is a restful http api. Responses from the API will use standard http status codes and return a json body.

Authenticating requests to the API

Every call to the API must be authenticated with your unique API key. Set the "X-DOOR-API-KEY" http header on all requests with your API key.

API Responses

The API response body will be a json object with a minimum set of status indication fields for success (boolean) to explicitly indicate whether the result operation was successful and message (string/text) which will include any response message for the operation (typically used for error messages when success is false).



Specific Endpoints

/test

If you would like to test the API to verify that you are able to authenticate and parse the response body, create a call to /test on your base endpoint url.


Example Response Body:

{
  "success": true,
  "message": ""
}


/doors

This endpoint will provide a list of doors in the response. Use the http GET method.

Response will contain standard response fields (success and message) along with an array of objects with the following fields:

Field NameDescription
door_idalphanumeric max length 191 chars, used to identify a specific door
nameName for the door
activeboolean, true/false, true indicates the door is enabled for use. If false, door should not be allowed to use
membership_type_idsAn array of unique membership type ids that have access to this door.
allow_instructorsboolean, true/false, true indicates that an instructor should be allowed access to this door regardless of membership.

Example Response Body:

{
  "success": true,
  "message": "",
  "doors": [
    {
      "door_id": "asdf123",
      "name": "Front Door",
      "active": true,
      "membership_type_ids": [1,2,3],
      "allow_instructors": true,
    },
    {
      "door_id": "fdsa321",
      "name": "Back Door",
      "active": true,
      "membership_type_ids": [],
      "allow_instructors": true,
    }
  ]
}


/access

This endpoint will allow you check access and register entry of a user to a specific door. Use the http POST method with a application/x-www-form-urlencoded post body containing the fields below.

Note: If check_only parameter is omitted or falsey, the system will record that the user entered the facility through that specific door id.

You must pass at least one of the following fields to identify the user: id, door_access_id and/or barcode_id. If you pass more than one of those fields, all the fields will be used to match a user (ie if all of them do not match for a specific user, then it will not grant access, success will be false).

Field NameRequired/optionalDescription
idoptional if door_access_id or barcode_id field is passed, otherwise required. numericUnique user id that was assigned to this user by the Hive platform
door_access_idoptional if id or barcode_id field is passed, otherwise required. alphanumeric max length 191 charsWill perform a lookup of user by door access id in the database. This can be any value that would map to the door access method (key card, rfid fob, etc)
barcode_idoptional if id or door_access_id is passed, otherwise required. alphanumeric max length 191 charsWill perform a lookup of user by the assigned barcode id in the Hive platform
door_idrequired (alphanumeric max length 191 chars)ID of the door the user is accessing, useful to limit access if there are multiple doors and the user should not have access to all doors.
check_onlyoptional (boolean, true/false)If the option is omitted or it is passed as falsey, a checkin/access log will be recorded for that user on that door.

Response will contain standard response fields (success and message, success will be false if the user does not have access for any reason, message will explain why the user does not have access) along with the following additional fields:

Field NameDescription
user -> idNumeric User id from the Hive platform, unique amongst all users
user -> door_access_idAlphanumeric max length 191 chars
user -> barcode_idAlphanumeric max length 191 chars
user -> first_nameUser's first name on record
user -> last_nameUser's last name on record
user -> emailUser's email (if enabled on api settings)
user -> phoneUser's phone number(if enabled on api settings), provided as best attempt at E.164 parsed/formatted value. Blank string if we do not have their phone number
user -> is_instructorBoolean, true/false, false if user is not an instructor, true if the user is considered an instructor or staff.
user -> membershipsAn array of memberships that the user has on their account that can access a door. A user may have one or more memberships.

Example Response Body:

{
  "success": true,
  "message": "",
  "user": {
    "id": 201,
    "door_access_id": "FFCC8899.....",
    "barcode_id": "123456789abc",
    "first_name": "test",
    "last_name": "testerson",
    "is_instructor": false,
    "memberships": [
      {
        "membership_id": 1234,
        "membership_type_id": 1,
        "membership_type_name": "Standard Monthly",
        "expires": 1762369732,
        "door_ids": ["asdf123"],
     },
      {
        "membership_id": 1235,
        "membership_type_id": 3,
        "membership_type_name": "Unlimited Access",
        "expires": 1762369732,
        "door_ids": ["asdf123"],
      }
    ]
  }
}

Explanation of the fields for membership:

Field NameDescription
membership_idNumeric, unique to that user's membership instance, never repeated on any other membership
membership_type_idNumeric, designates the type of the membership, shared amongst all the memberships of the same type
membership_type_nameString, name of the membership type for this membership.
expiresUnix timestamp (seconds since epoch) for when the membership may expire, terminate or renew next
door_idsArray of door ids that the membership grants access to


/users

This endpoint will provide a paginated list of users who have access to at least one door. This endpoint is only available when it is enabled on the api settings. Each page will list 100 results. Use the http GET method. To request a specific page, pass query parameter ?p=pagenumber on the request url.

Response will contain standard response fields (success and message) along with an array of user objects containing the same fields as the /access endpoint:

Field NameDescription
usersArray of users (see /access endpoint above for fields)
pageInteger, the current page number for the results
next_pageInteger or false, if there is another page of results it will be the page number of the next set of results, otherise it will be false.

Example Response Body:

{
  "success": true,
  "message": "",
  "users": [
    {
      ... see return fields from /access endpoint for user object
    },
    {
      ... see return fields from /access endpoint for user object
    }
  ],
  "page": 1,
  "next_page": false
}

 


    • Related Articles

    • 24-Hour Door Access

      24-Hour Door Access FitHive is set up to allow your gym to offer 24-Hour access to your members. We're currently integrated with 2 strategic partners, Hybrid AF and Passport Technologies. Hybrid AF currently only offers app-based entry, so your ...
    • Zapier Integration

      Configuring a Zapier Zap using your Hive is fairly straightforward. You will want to make sure to enable the External API Integrations on your Hive so that Zapier will be able to connect to your Hive. See API documentation. After the API is ...
    • Stripe Settings

      This article will show you how to access/edit the Stripe settings in your Hive. Before we begin, we'd like to remind you that your Stripe account is configured and connected to your Hive during your onboarding process, so this area should only be ...
    • External API Integrations

      What is an API? An API will allow you to connect certain applications or have a developer create code to feed/pull data from your Hive. How to enable the external API In your Hive admin, visit Settings -> External API Integrations. Enable the API and ...
    • Settings: Classes Available: How to Set Up Classes

      This article will guide you through the process of Creating Default Classes in your Hive. To begin, go to Settings >> scroll down to the Class Schedule section and select Classes Available >> then select Add Class. From here, you’ll set the default ...