Base URL: https://secure#.aladtec.com/example/api
A new and improved version of the Aladtec API has launched which includes powerful updates to the /members
routes and additional quality of life improvements. Version 1.0 will only receive security and maintenance updates going forward. Applications built prior to the release of the new version will continue to work with no changes required. Developers are encouraged to check out the new version and update their applications to take advantage of the latest features.
The Aladtec API can be used to retrieve information from the Aladtec system, specifically:
- Members - member information such as names, member IDs, certifications, and emergency contacts
- Availability - availability of all members during requested date/time range
- Time Off - all approved and pending Time Off requests during requested date/time range
- Scheduling - information relating to the schedules such as positions, time types, and members currently working during requested date/time range
- Time Clock - information relating to Time Clock records, including clock in/out, paycodes, and members currently clocked in during requested date/time range
- Events - event details, such as title, description, and location, for requested date/time range
- Shift Labels - label assigned to a schedule day, such as A/B/C or Red/Gold/Black, for the requested date range
The Aladtec API is implemented as a JSON web service that accepts authenticated HTTP requests, then returns a response with an HTTP status code and a JSON payload. No separate installation is required to use the Aladtec API.
- Date/Time is expressed in the time zone defined by the Aladtec system being accessed
- Date/Time format is YYYY-MM-DDTHH:MM, where YYYY = year, MM = month, DD = day, T = separator character, HH = hours (expressed in 24 hour notation), MM = minutes, e.g. 2018-05-01T17:30
- Date format is YYYY-MM-DD, where YYYY = year, MM = month, DD = day, e.g. 2018-05-01
- Time format is HH:MM, where HH = hours (expressed in 24 hour notation), MM = minutes, e.g. 14:30.
- Aladtec API will attempt to return an appropriate HTTP status code for every request
- Parameter keys and values are case sensitive
- Only data contained within the requested date range will be included in the response; however, a response may include additional information to indicate if the data extends outside of the requested date range
- Aladtec URLs are subject to change at the discretion of Aladtec
An Aladtec subscription provides 50 requests per minute and 2500 requests per rolling 24 hour period. Once the rate limit has been reached, a status code of 429 (Too Many Requests), will be returned until the rate limit automatically resets.
If a higher rate limit is required, please contact Aladtec Support at 888.749.5550.
Aladtec follows OAuth 2.0 standards for authentication. All API endpoints require authentication using a valid, non-expired access token. To get API tokens for an Aladtec system you must have received a client ID and a client secret for that system. The client secret must remain confidential as it allows unrestricted access to an Aladtec system's data.
All access tokens will expire seven days after they are created.
Getting an Access Token
Aladtec has implemented Client Credentials authentication for obtaining access tokens. Tokens obtained using Client Credentials will give unrestricted access to a system's data.
/oauth
/oauth/token
POST
post
Generates new API access tokens given valid credentials
Generates new API access tokens given valid credentials
Request Body
{} application/json
grant_type |
string |
required |
Possible values: 'client_credentials'
|
client_id |
string |
required |
Client ID used to identify your software interacting with Aladtec
|
client_secret |
string |
required |
Confidential secret to authenticate your software
|
Example:
{
"grant_type": "client_credentials",
"client_id": "sys-234F3SFSE",
"client_secret": "ERIOBNSLWVNUIEW3843H3B3B3B3N2MN2"
}
HTTP status code 200
Response Body
{} application/json
token
string
The new API token
expires
integer
UNIX timestamp value of when the API token expires
Example:
{
"token": "GdreEkwMnZUcU1tcmQ3aHJ1cXM1LmZDR05neUc4WklTcE44SHlyNHNwe",
"expires": 1553634604
}
<?php
/* Set your system URL, client ID, and client secret here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$client_id = 'sys-234F3SFSE';
$client_secret = 'ERIOBNSLWVNUIEW3843H3B3B3B3N2MN2';
$url = $base_url . '/oauth/token';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
) );
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( array(
'grant_type' => 'client_credentials',
'client_id' => $client_id,
'client_secret' => $client_secret
) ) );
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL, client ID, and client secret here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var client_id = 'sys-234F3SFSE';
var client_secret = 'ERIOBNSLWVNUIEW3843H3B3B3B3N2MN2';
var xhr = new XMLHttpRequest();
var url = base_url + '/oauth/token';
xhr.open( 'POST', url );
xhr.send( JSON.stringify( {
grant_type: 'client_credentials',
client_id: client_id,
client_secret: client_secret
} ) );
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Code |
Text |
Description |
200 |
Ok |
Request was successful |
400 |
Bad Request |
Request was invalid, may be due to missing or incorrect parameters |
401 |
Unauthorized |
Authentication credentials were invalid or missing, may be due to expired token |
403 |
Forbidden |
The API credentials used do not have access to the resource requested |
404 |
Not Found |
The URL path was not found |
405 |
Method Not Allowed |
An invalid HTTP method was specified for the resource. For example, a GET request was made to /oauth/token which only supports POST requests. |
429 |
Too Many Requests |
The rate limit for the Aladtec system was reached and the request cannot be completed |
500 |
Internal Server Error |
A problem has occurred on Aladtec servers, if the error continues - contact Aladtec Support for additional assistance |
The Aladtec API will include additional details in the response which can be used for troubleshooting, for example:
[{
"error": "Invalid credentials.",
"detail": "An API token was either not provided or invalid. A valid API token must be set in the Authorization Bearer header."
}]
/members
Routes for retrieving member information
/members
GET
get
Returns members and the member's associated Member Database attributes.
Returns members and the member's associated Member Database attributes.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
member_ids |
array |
optional |
IDs assigned to members in Aladtec
|
include_inactive |
boolean |
optional |
Members in Aladtec are either active or inactive. Default: 'true'.
|
include_attributes |
boolean |
optional |
Attributes from the Member Database that are configured to be API accessible. Default: 'false'.
|
HTTP status code 200
Response Body
{} application/json
member_id
integer
ID assigned to a member by Aladtec
is_active
boolean
Members in Aladtec are either active or inactive
name
string
First and last name of a member
attribute_id
integer
ID assigned to an attribute in the Member Database
value
any
Value of the Member Database attribute
Example:
[
{
"member_id": 42,
"is_active": true,
"name": "John Smith",
"attributes": [
{
"attribute_id": 1,
"value": "John"
},
{
"attribute_id": 3,
"value": "Smith"
},
{
"attribute_id": 19,
"value": [
"Morning",
"Evening"
]
}
]
},
{
"member_id": 2,
"is_active": false,
"name": "Jane Doe",
"attributes": [
{
"attribute_id": 1,
"value": "Jane"
},
{
"attribute_id": 3,
"value": "Doe"
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/members/attributes
GET
get
Returns all accessible Member Database attributes defined by the Member Database...
Returns all accessible Member Database attributes defined by the Member Database Configurator.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
HTTP status code 200
Response Body
{} application/json
attribute_group_id
integer
ID for a group of Member Database attributes
name
string
Name of a specific attribute or a group of Member Database attributes
attribute_id
integer
ID assigned to an attribute in the Member Database
type
string
Attribute type, possible values: 'text', 'singleoption', 'multioption', 'number', 'date', 'expirationdate', 'attachment'
api_accessible
boolean
Attributes that are api_accessible can be retrieved via the API
options
array
Possible values for attributes defined as a 'singleoption' or 'multioption' type
Example:
[
{
"attribute_group_id": 1,
"name": "General Information",
"attributes": [
{
"attribute_id": 1,
"type": "text",
"api_accessible": true,
"name": "First Name",
"options": []
},
{
"attribute_id": 3,
"type": "text",
"api_accessible": true,
"name": "Last Name",
"options": []
}
]
},
{
"attribute_group_id": 2,
"name": "Certifications",
"attributes": [
{
"attribute_id": 18,
"type" : "date",
"api_accessible": false,
"name": "EMT-B Course: Completed",
"options": []
},
{
"attribute_id": 19,
"type" : "multioption",
"api_accessible": true,
"name": "Preferred Shift Times",
"options": [
"Morning",
"Evening"
]
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members/attributes';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members/attributes';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/availability
Routes for retrieving Member Availability ranges
/availability
GET
get
Returns Member Availability for the requested date/time range.
Returns Member Availability for the requested date/time range.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
range_start |
datetime |
required |
|
range_stop |
datetime |
required |
|
HTTP status code 200
Response Body
{} application/json
member_id
integer
ID assigned to a member by Aladtec
type
string
Type of availability, possible values: 'Available', 'Prefer', 'Unavailable'
Example:
[
{
"member_id": 2,
"type": "Available",
"start_datetime": "2015-12-14T12:00",
"stop_datetime": "2015-12-14T20:00",
"start_timestamp": "1526267229",
"stop_timestamp": "1526267229"
},
{
"member_id": 4,
"type": "Prefer",
"start_datetime": "2015-11-19T03:00",
"stop_datetime": "2015-11-21T21:00",
"start_timestamp": "1526267229",
"stop_timestamp": "1526267229"
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/availability?' . http_build_query( array(
'range_start' => '2018-01-01T00:00',
'range_stop' => '2018-01-07T00:00'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/availability?' + new URLSearchParams( {
range_start: '2018-01-01T00:00',
range_stop: '2018-01-07T00:00'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/time-off
Routes for retrieving member Time Off information
/time-off
GET
get
Approved and pending Time Off ranges for the requested date/time range. Note: By default,...
Approved and pending Time Off ranges for the requested date/time range. Note: By default, only approved Time Off ranges are included in the response.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
range_start |
datetime |
required |
|
range_stop |
datetime |
required |
|
statuses |
array |
optional |
Time Off request statuses to filter by. Possible values: [ approved, pending ]. Defaults to: [ approved ].
|
daily_split_time |
time |
optional |
Time at which Time Off records will be split, e.g. if the daily_split_time is 07:00, a single Time Off record from 3/27 06:00 to 3/28 06:00 will be split into two: 3/27 06:00 - 3/27 07:00 and 3/27 07:00 - 3/28 06:00. Time must be expressed in an increment matching the Aladtec system, i.e. hour, half-hour, or quarter-hour increment. Default is the Aladtec system split time of day.
|
HTTP status code 200
Response Body
{} application/json
time_off_id
integer
ID assigned to a Time Off request in Aladtec
member_id
integer
ID assigned to a member by Aladtec
time_off_type
string
Name of the assigned Time Off type
status
string
Possible values: 'Approved', 'Pending'
extends_before
boolean
Indicates if the Time Off request starts before the requested start date/time range
extends_after
boolean
Indicates if the Time Off request ends after the requested end date/time range
pto_hours
number
Hours of paid Time Off time
Example:
{
"2018-05-15": [
{
"time_off_id": 387,
"member_id": 18,
"time_off_type": "Sick Leave",
"status": "Approved",
"start_datetime": "2018-05-15T12:00",
"start_timestamp": 1526403600,
"stop_datetime": "2018-05-16T07:00",
"stop_timestamp": 1526472000,
"extends_before": true,
"extends_after": false,
"pto_hours": 0
},
{
"time_off_id": 379,
"member_id": 24,
"time_off_type": "Vacation",
"status": "Approved",
"start_datetime": "2018-05-15T12:00",
"start_timestamp": 1526403600,
"stop_datetime": "2018-05-16T09:00",
"stop_timestamp": 1526479200,
"extends_before": false,
"extends_after": false,
"pto_hours": 0
}
],
"2018-05-16": [
{
"time_off_id": 378,
"member_id": 24,
"time_off_type": "Sick Leave",
"status": "Approved",
"start_datetime": "2018-05-16T09:00",
"start_timestamp": 1526479200,
"stop_datetime": "2018-05-17T09:00",
"stop_timestamp": 1526565600,
"extends_before": false,
"extends_after": true,
"pto_hours": 8.5
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-off?' . http_build_query( array(
'range_start' => '2018-01-01T00:00',
'range_stop' => '2018-01-07T00:00'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-off?' + new URLSearchParams( {
range_start: '2018-01-01T00:00',
range_stop: '2018-01-07T00:00'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/schedules
Routes for retrieving Schedule information
/schedules
GET
get
Schedule information defined in an Aladtec system. Data is sorted by the order defined on...
Schedule information defined in an Aladtec system. Data is sorted by the order defined on the Setup -> Schedules page.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
include_archived |
boolean |
optional |
Whether to include archived schedules in result. Default: 'false'.
|
HTTP status code 200
Response Body
{} application/json
schedule_id
integer
ID assigned to a schedule in Aladtec
name
string
Name of the schedule
is_archived
boolean
Schedules are either active or archived
order
integer
Sort order as defined on the Setup -> Schedules page
position_id
integer
ID assigned to a schedule position in Aladtec. Example: Firefighter #1, Firefighter #2, etc.
position_qualification_id
integer
ID assigned to a position qualification in Aladtec. Example: Firefighter, EMT, Officer, etc.
label
string
Name of the position
Example:
[
{
"schedule_id": 1,
"name": "Ambulance 1",
"is_archived": false,
"order": 1,
"positions": [
{
"position_id": 1,
"position_qualification_id": 1,
"label": "Driver",
"order": 1
},
{
"position_id": 2,
"position_qualification_id": 3,
"label": "EMT",
"order": 2
}
]
},
{
"schedule_id": 2,
"name": "Fire Crew 1",
"is_archived": false,
"order": 2,
"positions": [
{
"position_id": 3,
"position_qualification_id": 2,
"label": "Firefighter",
"order": 1
},
{
"position_id": 4,
"position_qualification_id": 2,
"label": "Firefighter",
"order": 2
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/schedules';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/schedules';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/scheduled-time
Routes for retrieving scheduled time information
/scheduled-time
GET
get
Returns scheduled time ranges for a specified period of time
Returns scheduled time ranges for a specified period of time
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
range_start |
datetime |
required |
Datetime format is YYYY-MM-DDTHH:MM
|
range_stop |
datetime |
required |
Datetime format is YYYY-MM-DDTHH:MM
|
schedule_ids |
array |
optional |
List of schedule IDs to fetch time for. Default: '[ ]'.
|
member_ids |
array |
optional |
List of member IDs to fetch time for. Default: '[ ]'.
|
position_ids |
array |
optional |
List of position IDs to fetch time for. Default: '[ ]'.
|
include_time_types |
boolean |
optional |
Whether to include Time Type names. Default: 'false'.
|
daily_split_time |
time |
optional |
Time at which scheduled shifts will be split, e.g. if the daily_split_time is 07:00, a single scheduled shift from 3/27 06:00 to 3/28 06:00 will be split into two: 3/27 06:00 - 3/27 07:00 and 3/27 07:00 - 3/28 06:00. Time must be expressed in an increment matching the Aladtec system, i.e. hour, half-hour, or quarter-hour increment. Default is the Aladtec system split time of day.
|
HTTP status code 200
Scheduled time records keyed by calendar date.
Response Body
{} application/json
member_id
integer
ID assigned to a member by Aladtec
schedule_id
integer
ID assigned to a schedule in Aladtec
position_id
integer
ID assigned to a schedule position in Aladtec
position_qualification_id
integer
ID assigned to a position qualification in Aladtec
time_type_id
integer
ID assigned to a time type in Aladtec
time_type
string
Name of the assigned time type
start_datetime
datetime
Datetime format is YYYY-MM-DDTHH:MM
stop_datetime
datetime
Datetime format is YYYY-MM-DDTHH:MM
start_timestamp
integer
Unix timestamp
stop_timestamp
integer
Unix timestamp
extends_before
boolean
Whether additional time for this "shift" exists before the requested query range
extends_after
boolean
Whether additional time for this "shift" exists after the requested query range
Example:
{
"2018-05-18" : [
{
"member_id" : 3,
"schedule_id" : 16,
"position_id" : 50,
"position_qualification_id": 1,
"time_type_id": 1,
"time_type": "Regular",
"start_datetime" : "2018-05-18T07:00",
"start_timestamp" : 1526644800,
"stop_datetime" : "2018-05-19T07:00",
"stop_timestamp" : 1526731200,
"extends_before": true,
"extends_after": false
},
{
"member_id" : 53,
"schedule_id" : 16,
"position_id" : 51,
"position_qualification_id": 1,
"time_type_id": 1,
"time_type": "Regular",
"start_datetime" : "2018-05-18T07:00",
"start_timestamp" : 1526644800,
"stop_datetime" : "2018-05-19T07:00",
"stop_timestamp" : 1526731200,
"extends_before": false,
"extends_after": false
}
],
"2018-05-19" : [
{
"member_id" : 52,
"schedule_id" : 16,
"position_id" : 50,
"position_qualification_id": 1,
"time_type_id": 1,
"time_type": "Regular",
"start_datetime" : "2018-05-19T09:00",
"start_timestamp" : 1526738400,
"stop_datetime" : "2018-05-19T17:00",
"stop_timestamp" : 1526767200,
"extends_before": false,
"extends_after": false
},
{
"member_id" : 96,
"schedule_id" : 16,
"position_id" : 53,
"position_qualification_id": 1,
"time_type_id": 1,
"time_type": "Regular",
"start_datetime" : "2018-05-19T09:00",
"start_timestamp" : 1526738400,
"stop_datetime" : "2018-05-19T17:00",
"stop_timestamp" : 1526767200,
"extends_before": false,
"extends_after": false
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/scheduled-time?' . http_build_query( array(
'range_start' => '2018-01-01T00:00',
'range_stop' => '2018-01-07T00:00'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/scheduled-time?' + new URLSearchParams( {
range_start: '2018-01-01T00:00',
range_stop: '2018-01-07T00:00'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/scheduled-time/members-scheduled-now
GET
get
Schedule and position for each member scheduled at the time of the request
Schedule and position for each member scheduled at the time of the request
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
schedule_ids |
array |
optional |
List of schedule IDs to filter by. Default: '[ ]'.
|
HTTP status code 200
Position assignments organized by schedule.
Response Body
{} application/json
schedule_id
integer
ID assigned to a schedule in Aladtec
position_id
integer
ID assigned to a position in Aladtec
member_id
integer
ID assigned to a member by Aladtec
Example:
[
{
"schedule_id": 1,
"positions": [
{
"position_id": 1,
"member_id": 42
}
]
},
{
"schedule_id": 2,
"positions": [
{
"position_id": 3,
"member_id": 27
},
{
"position_id": 4,
"member_id": 22
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/scheduled-time/members-scheduled-now';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/scheduled-time/members-scheduled-now';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/time-clock-time
Routes for retrieving Time Clock information
/time-clock-time
GET
get
Time Clock records for the requested date/time range. If a member is clocked in at the...
Time Clock records for the requested date/time range. If a member is clocked in at the time of the request, the time clock record will be excluded
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
range_start |
datetime |
required |
|
range_stop |
datetime |
required |
|
HTTP status code 200
Response Body
{} application/json
member_id
integer
ID assigned to a member by Aladtec
paycode_label
string
Name of paycode associated to the Time Clock record
clocked_in
boolean
Indicates if the member is currently clocked in
in_note
string
Note associated to Clock-In
out_note
string
Note associated to Clock-Out
Example:
[
{
"member_id": 24,
"paycode_label": "Regular",
"start_datetime": "2018-03-22T09:56",
"stop_datetime": "2018-03-22T14:22",
"start_timestamp": "1521712560",
"stop_timestamp": "1521728520",
"clocked_in": false,
"in_note": "",
"out_note": ""
},
{
"member_id": 46,
"paycode_label": "Regular",
"start_datetime": "2018-03-22T09:45",
"stop_datetime": "2018-03-22T09:56",
"start_timestamp": "1521711900",
"stop_timestamp": "1521712560",
"clocked_in": false,
"in_note": "",
"out_note": ""
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-clock-time?' . http_build_query( array(
'range_start' => '2018-01-01T00:00',
'range_stop' => '2018-01-07T00:00'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-clock-time?' + new URLSearchParams( {
range_start: '2018-01-01T00:00',
range_stop: '2018-01-07T00:00'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/time-clock-time/clocked-in-members
GET
get
Members clocked in at the time of the request.
Members clocked in at the time of the request.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
HTTP status code 200
Response Body
{} application/json
member_id
integer
ID assigned to a member by Aladtec
paycode_label
string
Name of paycode associated to the Time Clock record
in_note
string
Note associated to Clock-In
Example:
[
{
"member_id": 24,
"paycode_label": "Regular",
"in_note": ""
},
{
"member_id": 46,
"paycode_label": "Training",
"in_note": "I arrived 10 minutes late due to a personal emergency."
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-clock-time/clocked-in-members';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-clock-time/clocked-in-members';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( "load", function () {
console.log( xhr.responseText );
});
/events
Routes for retrieving Event ranges
/events
GET
get
Events for requested date/time range.
Events for requested date/time range.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
range_start |
datetime |
required |
|
range_stop |
datetime |
required |
|
daily_split_time |
time |
optional |
Time at which events will be split, e.g. if the daily_split_time is 07:00, a single event from 3/27 06:00 to 3/28 06:00 will be split into two: 3/27 06:00 - 3/27 07:00 and 3/27 07:00 - 3/28 06:00. Time must be expressed in an increment matching the Aladtec system, i.e. hour, half-hour, or quarter-hour increment. Default is the Aladtec system split time of day.
|
HTTP status code 200
Response Body
{} application/json
event_id
integer
ID assigned to an event in Aladtec
description
string
Event description
location
string
Event location
extends_before
boolean
Indicates if the event starts before the requested start date/time range
extends_after
boolean
Indicates if the event ends after the requested start date/time range
schedules
array
Event is viewable by the included schedules
public
boolean
DEPRECATED Indicates if the event is marked as publicly viewable
Example:
{
"2018-01-16": [
{
"event_id": 22,
"title": "EMS Monthly Meeting",
"description": "open to the community",
"location": "EMS Station",
"start_datetime": "2018-01-16T09:00",
"stop_datetime": "2018-01-16T11:00",
"start_timestamp": "1547629200",
"stop_timestamp": "1547636400",
"extends_before": true,
"extends_after": false,
"schedules": [
1,
2
],
"public": true
},
{
"event_id": 43,
"title": "Game Night",
"description": "Bring some games and have some fun!",
"location": "Event Hall",
"start_datetime": "2018-01-16T22:00",
"stop_datetime": "2018-01-16T00:00",
"start_timestamp": "1526526000",
"stop_timestamp": "1526533200",
"extends_before": false,
"extends_after": false,
"schedules": [
2
],
"public": false
}
],
"2018-01-17": [
{
"event_id": 43,
"title": "EMS Coverage for Football Game",
"description": "High School Football Game",
"location": "Ramer Field",
"start_datetime": "2018-01-17T18:00",
"stop_datetime": "2018-01-17T04:00",
"start_timestamp": "1547748000",
"stop_timestamp": "1547758800",
"extends_before": false,
"extends_after": true,
"schedules": [
2
],
"public": false
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/events?' . http_build_query( array(
'range_start' => '2018-01-01T00:00',
'range_stop' => '2018-01-07T00:00'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/events?' + new URLSearchParams( {
range_start: '2018-01-01T00:00',
range_stop: '2018-01-07T00:00'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
/shift-labels
Routes for retrieving Shift Label information
/shift-labels
GET
get
Shift labels for requested date range.
Shift labels for requested date range.
Headers
Authorization |
string |
required |
API access token to authenticate the request.
The token value must be prefaced with the word "Bearer" and a single space.
|
Query Parameters
start_date |
date |
required |
|
stop_date |
date |
required |
|
HTTP status code 200
Response Body
{} application/json
label
string
The shift label on that day
Example:
{
"2019-02-01": {
"label": "Black"
},
"2019-02-02": {
"label": "Gold"
},
"2019-02-03": {
"label": "Black"
},
"2019-02-04": {
"label": "Gold"
}
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/shift-labels?' . http_build_query( array(
'start_date' => '2018-01-01',
'stop_date' => '2018-01-07'
) );
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token
));
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
print( $response_body );
curl_close( $ch );
/* Set your system URL and API token here. */
var base_url = 'https://secure#.aladtec.com/example/api';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/shift-labels?' + new URLSearchParams( {
start_date: '2018-01-01',
stop_date: '2018-01-07'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});