Gatekeeper API

Base URL: /gatekeeper_api/v2, Version: 2.0.0

The Gatekeeper API using basic authentication to verify 3rd party integration, please contact gymmaster support for username and apikey (password). You need to replace the following curl examples with actual GM_SITE_NAME and API_KEY

Default response content-types: application/json
Schemes: https

Summary

Path Operation Description
/doors GET

get current doors settings

/log_swipe POST

Log swipe entry

/members GET

Get members information

/membershiptypes GET

Get membership types

/swipe POST

Process key tag swipe

/system GET

Get the current system settings

/time GET

Get the current time stamp from the server

Security

BasicAuth

Type: basic

Paths

get current doors settings

GET /doors

This provides all the information about the doors.

Example:

curl -u $GM_SITE_NAME:$API_KEY https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/doors

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"doors": [
{
"auto_addtoclass": false,
"booking_checkin": 1,
"check_booking_resources": [],
"checkout": false,
"companyid": 2,
"concessionhandling": 0,
"detect_tailgate": false,
"door_sublocationid": null,
"exit_door_id": null,
"exrlink": false,
"gatekeeperid": 3,
"id": 16,
"last_status_id": null,
"lastupdate": {
"__datetime__": null,
"day": 22,
"hour": 12,
"microsecond": 887514,
"minute": 27,
"month": 2,
"second": 36,
"year": 2018
},
"mac_address": "api",
"name": "Example Door",
"optional_args": null,
"overhead_camera": "None",
"profile_camera": "None",
"reader_type": null,
"record_duration": null,
"resourceid": null,
"restricted_door": false,
"sentry_com_port": null,
"sentry_ip_address": null,
"sentry_mac_address": null,
"showlastvisits": true,
"siteid": 2,
"status": 1,
"swipe_enter_delay": null,
"update_user_name": "exampleuser",
"womenonly": false
}
],
"error": null
}
doors: object[]

The doors list

error: string

Error message in case of an error

BasicAuth
Log swipe entry

POST /log_swipe

This end point logs a swipe visit to the database.

Example:

curl -u $GM_SITE_NAME:$API_KEY -H "Content-Type: application/json" -X POST -d '{"swipe":[{"membershipid": 8296815, "tagserial_short": "Mx9e428c","comment": null, "tagid": 2, "tagserial": "Mx03009e428c29ac", "when": "2019-09-03 18:04:38", "doorid": 113, "access": 1, "memberid": 1987137248, "debug": false}]}' https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/log_swipe

The swipe log entries

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"error": null,
"response": 1
}
response: integer

Number of successfully processed swipe log

error: string

Error message in case of an error

BasicAuth
Get members information

GET /members

This end point shows all the members that have got tags as well as the memberships that that the members have, this shows member and membership specific data (e.g. member owing amount, start date, end date, visit count, tag serial). Member's tag number can be assigned by click the get tag button which will try to get the last swipe tag that is not assigned to any member.

Example:

curl -u $GM_SITE_NAME:$API_KEY https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/members

memberid

The specified member's ID for synchronisation, optional, none means all current members.

query integer
timestamp

The timestamp from the lastsync field of last call to this endpoint, none means full synchronisation

query number
last_id

The last memberid of the return list from last call to this endpoint, none means the first call to this endpoint.

query integer
companyid

Filter the members list by company, only members from this company will be returned.

query integer

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"lastsync": 1519305582.50599,
"members": [
{
"membership": [
{
"extensions": [],
"memberid": 35,
"tagid": 50024469,
"membershiptypeid": 843,
"cancel_reason": null,
"canceled_at": null,
"priority": 0,
"visit": 30,
"startdate": {
"__date__": null,
"year": 2017,
"month": 10,
"day": 5
},
"enddate": null,
"tagserial_short": "BAR50024469",
"membershipid": 64306,
"incomplete": false,
"tagserial": null,
"expired": false
}
],
"name": "Tic Toe",
"memberid": 35,
"owingdeadline": null,
"siteid": 2,
"bookings": [],
"id": 35,
"stopatgate": false,
"gender": "M",
"company_name": "Site 1 Name",
"dob": "1999-12-31",
"code": "current",
"has_payment_plan": false,
"entryexit": [],
"passcode": null,
"card": [
{
"cardserial": "BAR50024469",
"memberid": 35,
"cardid": 50024469
}
],
"owe": {
"__decimal__": "0.000"
}
}
]
}
members: object[]

The membership types list

lastsync: number

The timestamp for this synchronisation, should be used as timestamp parameters next time

hasmore: boolean

Has more members to load?

error: string

Error message in case of an error

BasicAuth
Get membership types

GET /membershiptypes

This end point lists all the programmes/membership types that a member can have assigned to them. programmes/membershiptypes provide all the details and limitations for access to doors.

Example:

curl -u $GM_SITE_NAME:$API_KEY https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/membershiptypes

membershiptypeid

The specified membership type ID for synchronisation, optional, none means all membership types.

query integer

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"error": null,
"membershiptypes": [
{
"basis": "Club Visit Pack",
"basisid": 3,
"benefitenabled": true,
"concessionlimit": 11,
"door": [
{
"doorid": 1,
"id": 442,
"rosterid": 6215
}
],
"id": 62,
"membershiptypeid": 62,
"multisite": false,
"name": "FOUND - Sunbed Course 10pk",
"priority": 100,
"siteid": 2,
"swipe_cpv": true
}
]
}
doors: object[]

The membership types list

error: string

Error message in case of an error

BasicAuth
Process key tag swipe

POST /swipe

This end point process key tag swipe in the database, and return the result of the swipe. This differs from /log_swipe as this end point will tell you whether GymMaster thinks you should grant or deny access to the id card. /log_swipe is GymMaster being told whether access was granted.

Example:

curl -u $GM_SITE_NAME:$API_KEY -H "Content-Type: application/json" -X POST -d '{"doorid":1,"cardserial":"Mxce9b2a"}' https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/swipe

The card serial number

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"granted": false
}
granted: boolean

If the key tag is granted access to the system.

error: string

Error message in case of an error, optional.

BasicAuth
Get the current system settings

GET /system

This shows database configuration type data that is system wide (e.g. site independent) this includes open hours of gyms, warning limits, GymMaster version number, etc.

Example:

curl -u $GM_SITE_NAME:$API_KEY https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/system

Uses default content-types: application/json

200 OK

successful response

BasicAuth
Get the current time stamp from the server

GET /time

This endpoint synchronise timing information from the server to store time correction to the local access control system

Example:

curl -u $GM_SITE_NAME:$API_KEY https://$GM_SITE_NAME.gymmasteronline.com/gatekeeper_api/v2/time

Uses default content-types: application/json

200 OK

successful response

Example for application/json
{
"current_date": "2018-02-22",
"current_time": "12:23:40.877828+13",
"dow": 4.0,
"epoch": 1519255420.87783,
"ts": "2018-02-22 12:23:40.877828"
}
BasicAuth

Schema definitions

Date: object

year: integer

Year

month: integer

Month

day: integer

Day

Door: object

booking_checkin: integer

whether the access should be checked automatically into a booking, 0 false, else true

checkout: boolean

whether is a checkout only door

companyid: integer

the companyid of the door

concessionhandling: boolean

whether the door counts visits when used

door_sublocation: string

unused

exit_door_id: integer

doorid of the exit door

gatekeeper: integer

the id of the gatekeeper that controls the door

id: integer

the id of the door

lastupdate: Timestamp

the last update timestamp for the door record

mac_address: string

mac address of associated gatekeeper

name: string

door name

optional_args: string

override arguments for the door software

reader_type: string

type of reader used

resourceid: integer

ID of the resource associated with the door

restricted_door: boolean

whether the door has restricted access

sentry_com_port: string

gatekeeper socket for the reader

sentry_ip_address: string

IP address of network reader

sentry_mac_address: string

mac address of network reader

showlastvisits: boolean

Show swipes in the visitor log

siteid: integer

the site id of the door

status: integer

current status of the door

update_user_name: string

username of last update user

womenonly: boolean

is the door female only.

Member: object

card: object[]

List of the cards that the member has (is the same as tag)

object
cardid: integer

ID of the cards (is the same as tagid)

cardserial: string

Serials of the cards (is the same as the tagserial)

gender: string

gender of the member, M=Male, F=Female

dob: Date

The date of birth of the member

memberid: integer

the ID of the member

code: string

The code is a string that represets the status the member has, based on what memberships and holds they have currently. It is updated daily.

passcode: integer

If you have a keypad reader, this is their unique passcode to get into the door.

membership: object[]

A list of the members' memberships

object
accountid: integer

the membership account

balance: string

The balance of the member account.

visit: integer

The number of visits the member has made

startdate: Date

The start date of the membership

enddate: Date

The end date of the membership

expired: boolean

Whether the membership is expired

incomplete: boolean

Whether the membership has been completed

membershipid: integer

The ID of the membership

membershiptypeid: integer

The ID of the membership type.

refreshdate: Date

The day the balance of the account gets refreshed.

tagid: integer

The ID of the tag.

tagserial: string

The serial of the tag

tagserial_short: string

The short version of the tag.

name: string

The name of the member.

owe: number

The amount the member owes.

owingdeadline: Date

The date that the member has to pay the owing amount by (e.g. is allowed in, even if owing is above the stop threshold, up to the date specified)

company_name: string

The name of the site that the member belongs to. It will match siteid.

siteid: integer

The site that the member belongs to. The number represents the club/company that the member belongs to has their home club.

stopatgate: boolean

Whether a stop at gate task is active

MembershipType: object

basis: string

The membership type basis name

basisid: integer

the membership type basis id

benefitenabled: boolean

whether the membership type is using the benefit system

concessionlimit: integer

Specifies a lmit on how many visits are used

door: object[]

specifies a list of doors that the membership type has access to

object
doorid: integer

doorid of the membership type?

id: integer

the benefit ID

programmeid: integer

The ID of the membership type.

rosterid: integer

The ID of the roster associated with the door access times

membershiptypeid: integer

the membership type id

mulitisite: boolean

Specifies if this membership type has multisite access

name: string

Name of the membership type

priority: integer

The priority of the membership

siteid: integer

The ID of the site the membership belongs to

RosterTime: object

name: string

Name of roster

rosterid: integer

Roster ID

siteid: integer

Site ID

dow: integer

Day of the week. 0 is Sunday and 6 is Saturday

starttime: Time

Roster start time

endtime: Time

Roster end time

SwipeLog: object

doorid: integer

The ID of door

tagid: integer

The ID of keytag

memberid: integer

The ID of the member

membershipid: integer

The ID of the membership that the member is used

when: string

When the swipe happen, format YYYY-MM-DD HH:mm:ss

comment: string

Comment/notes for the check in

tagserial: string

Keytag serial number

tagserial_short: string

Keytag serial number (short)

access: integer

access status code, access=1 if granted, otherwise denied

checkout: boolean

Is this swipe a checkout instead of check in

SystemInfo: object

multiclub_hostlist: string

The website host for the other clubs, separated by commas

roster: object[]

contains the roster defining the hours of the gym

schemaversion: integer

The GymMaster Database Version.

stop: string

Stop on owe amount. If the member owes over this value than deny them from entering. (w/ currency symbol)

stop_incomplete: boolean

Whether to stop members with incomplete memberships.

warn: string

warn on owe amount. If the member owes more than this value, warn them at the gate. (w/ currency symbol)

Time: object

hour: integer

Hour of day

minute: integer

Minute

second: integer

Second

microsecond: integer

Microsecond

TimeInfo: object

current_date: string

Current date of the datebase

current_time: string

Current time of the database

dow: integer

Current day of the week

epoch: number

Seconds since the unix epoch

ts: string

Current timestamp

Timestamp: object

year: integer

Year

month: integer

Month

day: integer

Day

hour: integer

Hour of day

minute: integer

Minute

second: integer

Second

microsecond: integer

Microsecond