Base URL: https://secure#.aladtec.com/example/api/v2
The Aladtec API can be used to retrieve, create, or update information contained in an Aladtec system, specifically:
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.
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 can create multiple API profiles for your organization, each with access to different data. Not all data is available by default.
If you would like to configure API profiles, 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 by contacting Aladtec Support. 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.
Aladtec has implemented Client Credentials authentication for obtaining access tokens. Tokens obtained using Client Credentials will give unrestricted access to a system's data.
Generates new API access tokens given valid credentials
Description
Generates new API access tokens given valid credentials
{} 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"
}
{} 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/v2';
$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/v2';
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 |
201 | Created | Resource was created successfully |
204 | No Content | Request was successful and no response content was returned |
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."
}]
Routes for retrieving and updating Member Database information
Returns members and the member's associated Member Database attributes. Attributes must be...
Creates a new member in the Member Database.
Description
Returns members and the member's associated Member Database attributes. Attributes must be accessible through the API or the value will be null. Contact Aladtec Support (support@aladtec.com, 888.749.5550) to make attributes accessible through the API.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
member_ids | array | optional | IDs assigned to members by Aladtec |
include_inactive | boolean | optional | Members in Aladtec are either active or inactive. Default: 'false'. |
limit | integer | optional | Number of members to return in the result |
offset | integer | optional | Paginate the members returned in the result. Default: '0'. |
attribute_ids | array | optional | Limits custom attribute values returned by IDs of Attributes |
Successful response with member data. Results sorted by last name ascending.
{} application/json
member_id integer
ID assigned to a member by Aladtec
is_active boolean
Members are either active or inactive
formatted_name string
First and last name of the member
first_name string
Member given name
last_name string
Member family name
login string
Member login name
mobile_phone string
Mobile phone number
primary_email string
Primary email address
secondary_emails array
Email addresses not considered the primary_email
date_hired string
Date the member was hired
employee_type_id integer
ID of the employee type assigned to the member
work_group_id integer
ID of the work group assigned to the member
schedule_ids array
List of schedule IDs the member is qualified to work on
position_qualification_ids array
List of position qualification IDs a member is qualified for
custom_attributes array
Attributes in the Member Database, defined per Aladtec system. Each attribute contains an attribute_id (integer) and a value. The attribute can be Text (string), Date (string), Number (int), Attachment (int), Single Option (array of IDs), or Multi Option (array of IDs).
Example:
[
{
"member_id": 3,
"is_active": true,
"formatted_name": "John Smith",
"first_name": "John",
"last_name": "Smith",
"login": "johnsmith",
"primary_email": "jsmith@company.com",
"secondary_emails": [
"jsmith@example.com"
],
"employee_type_id": 7,
"work_group_id": 5,
"date_hired": "2019-01-01",
"schedule_ids": [
1,
2
],
"position_qualification_ids": [
1,
2,
3
],
"custom_attributes": [
{
"attribute_id": 11,
"value": ""
},
{
"attribute_id": 10,
"value": [
2,
3
]
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members?limit=10';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members?limit=10';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Description
Creates a new member in the Member Database.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
is_active | boolean | optional | Members are either active or inactive |
first_name | string | required | Member given name |
last_name | string | required | Member family name |
login | string | required | Member login name |
mobile_phone | string | optional | Mobile phone number |
primary_email | string | required | Primary email address |
secondary_emails | array | optional | Email addresses not considered the primary_email |
date_hired | string | optional | Date the member was hired |
employee_type_id | integer | optional | ID of the employee type assigned to the member |
work_group_id | integer | required | ID of the work group assigned to the member |
schedule_ids | array | optional | List of schedule IDs the member is qualified to work on |
position_qualification_ids | array | optional | List of position qualification IDs a member is qualified for |
custom_attributes | array | optional | Attributes in the Member Database, defined per Aladtec system. Each attribute contains an attribute_id (integer) and a value. The attribute can be Text (string), Date (string), Number (int), Single Option (array of IDs), or Multi Option (array of IDs). Note: Any attribute IDs or option IDs that are invalid will be ignored and won't be saved. |
Example:
{
"is_active": true,
"first_name": "John",
"last_name": "Smith",
"login": "johnsmith",
"primary_email": "jsmith@company.com",
"secondary_emails": [
"jsmith@example.com",
"jsmith2@example.com"
],
"employee_type_id": 7,
"work_group_id": 5,
"date_hired": "2019-01-01",
"schedule_ids": [
1,
2
],
"position_qualification_ids": [
1,
2,
3
],
"custom_attributes": [
{
"attribute_id": 11,
"value": ""
},
{
"attribute_id": 10,
"value": [
2,
3
]
}
]
}
Successful response with new member.
{} application/json
member_id integer
ID assigned to a member by Aladtec
is_active boolean
Members are either active or inactive
formatted_name string
First and last name of the member
first_name string
Member given name
last_name string
Member family name
login string
Member login name
mobile_phone string
Mobile phone number
primary_email string
Primary email address
secondary_emails array
Email addresses not considered the primary_email
date_hired string
Date the member was hired
employee_type_id integer
ID of the employee type assigned to the member
work_group_id integer
ID of the work group assigned to the member
schedule_ids array
List of schedule IDs the member is qualified to work on
position_qualification_ids array
List of position qualification IDs a member is qualified for
custom_attributes array
Attributes in the Member Database, defined per Aladtec system. Each attribute contains an attribute_id (integer) and a value. The attribute can be Text (string), Date (string), Number (int), Attachment (int), Single Option (array of IDs), or Multi Option (array of IDs).
Example:
{
"member_id": 3,
"is_active": true,
"formatted_name": "John Smith",
"first_name": "John",
"last_name": "Smith",
"login": "johnsmith",
"primary_email": "jsmith@company.com",
"secondary_emails": [
"jsmith@example.com",
"jsmith2@example.com"
],
"employee_type_id": 7,
"work_group_id": 5,
"date_hired": "2019-01-01",
"schedule_ids": [
1,
2
],
"position_qualification_ids": [
1,
2,
3
],
"custom_attributes": [
{
"attribute_id": 11,
"value": ""
},
{
"attribute_id": 10,
"value": [
2,
3
]
}
]
}
Error response containing one or more errors returned as a result of invalid payload data.
{} application/json
Example:
[
{
"error": "Example error message."
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$new_member = array(
'first_name' => 'John',
'last_name' => 'Doe',
'login' => 'johndoe',
'primary_email' => 'example@email.com',
'work_group_id' => 1 // Set the ID of the appropriate work group for this new member.
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $new_member ) );
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members';
xhr.open( 'POST', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var new_member = {
first_name: 'John',
last_name: 'Doe',
login: 'johndoe',
primary_email: 'email@example.com',
work_group_id: 1 // Set the ID of the appropriate work group for this new member.
};
xhr.send( JSON.stringify( new_member ) );
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Updates an existing member using a subset of attributes or the entire member.
Description
Updates an existing member using a subset of attributes or the entire member.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
member_id | integer | optional | ID assigned to a member by Aladtec |
{} application/json
is_active | boolean | optional | Members are either active or inactive |
first_name | string | optional | Member given name |
last_name | string | optional | Member family name |
login | string | optional | Member login name |
mobile_phone | string | optional | Mobile phone number |
primary_email | string | optional | Primary email address |
secondary_emails | array | optional | Email addresses not considered the primary_email |
date_hired | string | optional | Date the member was hired |
employee_type_id | integer | optional | ID of the employee type assigned to the member |
work_group_id | integer | optional | ID of the work group assigned to the member |
schedule_ids | array | optional | List of schedule IDs the member is qualified to work on |
position_qualification_ids | array | optional | List of position qualification IDs a member is qualified for |
custom_attributes | array | optional | Attributes in the Member Database, defined per Aladtec system. Each attribute contains an attribute_id (integer) and a value. The attribute can be Text (string), Date (string), Number (int), Single Option (array of IDs), or Multi Option (array of IDs). Note: Any attribute IDs or option IDs that are invalid will be ignored and won't be saved. |
Example:
{
"is_active": true,
"first_name": "John",
"last_name": "Smith",
"login": "johnsmith",
"primary_email": "jsmith@company.com",
"secondary_emails": [
"jsmith@example.com",
"jsmith2@example.com"
],
"employee_type_id": 7,
"work_group_id": 5,
"date_hired": "2019-01-01",
"schedule_ids": [
1,
2
],
"position_qualification_ids": [
1,
2,
3
],
"custom_attributes": [
{
"attribute_id": 11,
"value": ""
},
{
"attribute_id": 10,
"value": [
2,
3
]
}
]
}
Successful response with updated member.
{} application/json
member_id integer
ID assigned to a member by Aladtec
is_active boolean
Members are either active or inactive
formatted_name string
First and last name of the member
first_name string
Member given name
last_name string
Member family name
login string
Member login name
mobile_phone string
Mobile phone number
primary_email string
Primary email address
secondary_emails array
Email addresses not considered the primary_email
date_hired string
Date the member was hired
employee_type_id integer
ID of the employee type assigned to the member
work_group_id integer
ID of the work group assigned to the member
schedule_ids array
List of schedule IDs the member is qualified to work on
position_qualification_ids array
List of position qualification IDs a member is qualified for
custom_attributes array
Attributes in the Member Database, defined per Aladtec system. Each attribute contains an attribute_id (integer) and a value. The attribute can be Text (string), Date (string), Number (int), Attachment (int), Single Option (array of IDs), or Multi Option (array of IDs).
Example:
{
"member_id": 3,
"is_active": true,
"formatted_name": "John Smith",
"first_name": "John",
"last_name": "Smith",
"login": "johnsmith",
"primary_email": "jsmith@company.com",
"secondary_emails": [
"jsmith@example.com",
"jsmith2@example.com"
],
"employee_type_id": 7,
"work_group_id": 5,
"date_hired": "2019-01-01",
"schedule_ids": [
1,
2
],
"position_qualification_ids": [
1,
2,
3
],
"custom_attributes": [
{
"attribute_id": 11,
"value": ""
},
{
"attribute_id": 10,
"value": [
2,
3
]
}
]
}
Successful response when no changes were saved.
No response content.
Error response containing one or more errors returned as a result of invalid payload data.
{} application/json
Example:
[
{
"error": "Example error message."
}
]
Error response when member ID is not found.
{} application/json
Example:
[
{
"error": "Member not found."
}
]
<?php
/* Set your system URL, API token, and Member ID here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$member_id = 2;
$url = $base_url . '/members/' . $member_id;
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$update_fields = array(
'date_hired' => '2019-02-03'
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $update_fields ) );
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var member_id = 2;
var xhr = new XMLHttpRequest();
var url = base_url + '/members/' + member_id;
xhr.open( 'PATCH', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var update_fields = {
date_hired: '2019-02-03'
};
xhr.send( JSON.stringify( update_fields ) );
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Returns all employee types. These can be customized per Aladtec system. Examples: part...
Description
Returns all employee types. These can be customized per Aladtec system. Examples: part time, full time, volunteer.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
Successful response with Employee Type objects
{} application/json
employee_type_id integer
ID of the employee type
name string
Name assigned to the employee type
Example:
[
{
"employee_type_id": 1,
"name": "Full Time"
},
{
"employee_type_id": 2,
"name": "Part Time"
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members/employee-types';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members/employee-types';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Returns all customer created Member Database attribute definitions
Description
Returns all customer created Member Database attribute definitions
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
attribute_group_id integer
ID for a group of Member Database attributes
name string
Name assigned to a group, attribute, or option
attributes array
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'
required boolean
Whether the attribute is required to have a value
options array
Possible values for attributes defined as a 'singleoption' or 'multioption' type
option_id integer
ID of the attribute option
Example:
[
{
"attribute_group_id": 2,
"name": "Certifications",
"attributes": [
{
"attribute_id": 18,
"type" : "date",
"name": "EMT-B Course: Completed",
"required": true,
"options": []
},
{
"attribute_id": 19,
"type" : "multioption",
"name": "Preferred Shift Times",
"required": false,
"options": [
{
"option_id": 34,
"name": "Morning"
},
{
"option_id": 35,
"name": "Evening"
}
]
}
]
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/members/custom-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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/members/custom-attributes';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Routes for retrieving Member Availability ranges
Returns Member Availability for the requested date/time range.
Description
Returns Member Availability for the requested date/time range.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
range_start | datetime | required | |
range_stop | datetime | required |
{} application/json
member_id integer
ID assigned to a member by Aladtec
type string
Type of availability, possible values: 'Available', 'Prefer', 'Unavailable'
start_datetime datetime
stop_datetime datetime
start_timestamp integer
stop_timestamp integer
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/v2';
$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/v2';
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 );
});
Routes for retrieving member Time Off information
Approved and pending Time Off ranges for the requested date/time range. Note: By default,...
Description
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.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
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. |
{} 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'
start_datetime datetime
stop_datetime datetime
start_timestamp integer
stop_timestamp integer
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/v2';
$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/v2';
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 );
});
Routes for retrieving Schedule information
Schedule configuration defined in an Aladtec system. Data is sorted by the order defined...
Description
Schedule configuration defined in an Aladtec system. Data is sorted by the order defined on the Setup -> Schedules page.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
include_archived | boolean | optional | Whether to include archived schedules in result. Default: 'false'. |
{} 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
positions array
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/v2';
$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/v2';
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 );
});
Returns a list of unique position qualifications.
Description
Returns a list of unique position qualifications.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
limit | integer | optional | Number of qualifications to return in the result. Maximum value is 500. Default: '50'. |
offset | integer | optional | Paginate the qualifications returned in the result. Default: '0'. |
{} application/json
position_qualification_id int
ID assigned to a position qualification in Aladtec
name string
Name assigned to the qualification
Example:
[
{
"position_qualification_id": 1,
"name": "Driver"
},
{
"position_qualification_id": 2,
"name": "Firefighter"
},
{
"position_qualification_id": 3,
"name": "EMT"
}
]
<?php
/* Set your system URL and API token here. */
$BASE_URL = 'https://secure#.aladtec.com/example/api/v2';
$API_TOKEN = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$resource_url = '/schedules/position-qualifications';
$limit = 50;
$offset = 0;
$data = [];
do {
$paginated_url = $BASE_URL . $resource_url . '?' . http_build_query( array(
'limit' => $limit,
'offset' => $offset
) );
$ch = curl_init( $paginated_url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $API_TOKEN
) );
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
$get_next_dataset = false;
if ( $error ) {
echo 'Error: ' . $error . PHP_EOL;
} elseif ( $response_body != '[]' ) {
$data = array_merge( $data, json_decode( $response_body, true ) );
$offset += $limit;
$get_next_dataset = true;
}
curl_close( $ch );
} while ( $get_next_dataset );
var_export( $data ) . PHP_EOL;
/* Set your system URL and API token here. */
var BASE_URL = 'https://secure#.aladtec.com/example/api/v2';
var API_TOKEN = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
loadPaginatedData( '/schedules/position-qualifications', 50, function( data ) {
console.log( data );
} );
function loadPaginatedData( resourceUrl, limit, successCallback, offset = 0, data = [] ) {
var paginated_url = BASE_URL + resourceUrl + '?' + new URLSearchParams( {
limit: limit,
offset: offset
} );
var xhr = new XMLHttpRequest();
xhr.open( 'GET', paginated_url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + API_TOKEN );
xhr.send();
xhr.addEventListener( 'load', function() {
if ( xhr.status >= 400 ) {
// Error encountered
console.log( 'Error making api request.' );
console.log( xhr.responseText );
} else if ( xhr.responseText !== '[]' ) {
// Add the returned data to the result array
data = data.concat( JSON.parse( xhr.responseText ) );
// Fetch the next set of records
loadPaginatedData( resourceUrl, limit, successCallback, offset + limit, data );
} else {
// Successfully fetched all records from the paginated endpoint
successCallback( data );
}
} );
}
Routes for retrieving scheduled time information
Returns scheduled time ranges for a specified period of time
Description
Returns scheduled time ranges for a specified period of time
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
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 ID's to fetch time for. Default: '[ ]'. |
member_ids | array | optional | List of member ID's to fetch time for. Default: '[ ]'. |
position_ids | array | optional | List of position ID's to fetch time for. Default: '[ ]'. |
time_type_ids | array | optional | List of Time Type ID's 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. |
Scheduled time records keyed by calendar date.
{} 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/v2';
$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/v2';
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 );
});
Returns time ranges where no member is scheduled. Typically used for finding shifts...
Description
Returns time ranges where no member is scheduled. Typically used for finding shifts needing coverage. Up to one month can be retrieved in a single request.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
range_start | datetime | required | Datetime format is YYYY-MM-DDTHH:MM |
range_stop | datetime | required | Datetime format is YYYY-MM-DDTHH:MM |
include_only_shift_time | boolean | optional | Whether to only include time ranges that exist within the boundaries of schedule shifts. For example, if a schedule has one shift (7am - 3pm), Open Time ranges from 3pm - 7am (next day) would be excluded. Shift boundaries are defined on the Setup -> Schedules page. Default: 'true'. |
schedule_ids | array | optional | List of schedule IDs to fetch time for |
position_ids | array | optional | List of position IDs to fetch time for |
daily_split_time | time | optional | Time at which ranges will be split, e.g. if the daily_split_time is 07:00, a single range 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. |
Open Time ranges keyed by calendar date.
{} application/json
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
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
Example:
{
"2018-05-18": [
{
"schedule_id": 2,
"position_id": 1,
"position_qualification_id": 1,
"start_datetime": "2018-05-18T07:00",
"start_timestamp": 1526644800,
"stop_datetime": "2018-05-19T07:00",
"stop_timestamp": 1526731200
},
{
"schedule_id": 16,
"position_id": 51,
"position_qualification_id": 2,
"start_datetime": "2018-05-18T07:00",
"start_timestamp": 1526644800,
"stop_datetime": "2018-05-19T07:00",
"stop_timestamp": 1526731200
}
],
"2018-05-19": [
{
"schedule_id": 16,
"position_id": 50,
"position_qualification_id": 1,
"start_datetime": "2018-05-19T09:00",
"start_timestamp": 1526738400,
"stop_datetime": "2018-05-19T17:00",
"stop_timestamp": 1526767200
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/scheduled-time/open-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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/scheduled-time/open-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 );
});
Schedule and position for each member scheduled at the time of the request
Description
Schedule and position for each member scheduled at the time of the request
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
schedule_ids | array | optional | List of schedule IDs to filter by. Default: '[ ]'. |
Position assignments organized by schedule.
{} application/json
schedule_id integer
ID assigned to a schedule in Aladtec
positions array
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/v2';
$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/v2';
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 );
});
Returns Schedule Notes organized by calendar date. Up to one year can be retrieved in a...
Description
Returns Schedule Notes organized by calendar date. Up to one year can be retrieved in a single request.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
start_date | date | required | Date format is YYYY-MM-DD |
stop_date | date | required | Date format is YYYY-MM-DD |
schedule_ids | array | optional | List of schedule IDs to fetch notes for. Default: '[ ]'. |
Schedule notes keyed by calendar date. Results sorted by ascending dates, then by ascending schedule IDs.
{} application/json
schedule_id integer
ID assigned to a schedule in Aladtec
date string
YYYY-MM-DD date the note is for
member_id integer
ID of the member who last updated the note
content string
Text content of the note. Line breaks are specified by the "\n" escape string.
modified_datetime datetime
Datetime string of when the note was last updated
modified_timestamp integer
Unix timestamp of when the note was last updated
Example:
{
"2019-01-01": [
{
"schedule_id": 1,
"date": "2019-01-01",
"member_id": 2,
"content": "Chris and Steve are running the drills",
"modified_datetime": "2020-09-22T15:43",
"modified_timestamp": 1600807403
},
{
"schedule_id": 2,
"date": "2019-01-01",
"member_id": 1,
"content": "Tire pressure checks on K1 and K2 needed today.",
"modified_datetime": "2020-09-22T15:43",
"modified_timestamp": 1600807403
}
],
"2019-01-02": [
{
"schedule_id": 2,
"date": "2019-01-02",
"member_id": 1,
"content": "Weather is predicted to be especially hot and dry. Prepare for an influx of calls today.\nJoe is on standby if needed.",
"modified_datetime": "2020-09-22T15:36",
"modified_timestamp": 1600807000
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/scheduled-time/notes?' . 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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/scheduled-time/notes?' + 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 );
});
Routes for retrieving extra hours information
Returns extra hours ranges for a specified period of time in the past
Description
Returns extra hours ranges for a specified period of time in the past
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
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_qualification_ids | array | optional | List of position qualification IDs to fetch time for. Default: '[ ]'. |
time_type_ids | array | optional | List of Time Type IDs to fetch time for. Default: '[ ]'. |
statuses | array | optional | Extra Hours request statuses to filter by. Possible values: [ approved, pending ]. Defaults to: [ approved ]. |
daily_split_time | time | optional | Time at which ranges will be split, e.g. if the daily_split_time is 07:00, a single extra hours 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. |
Extra hours records keyed by calendar date.
{} application/json
member_id integer
ID assigned to a member by Aladtec
schedule_id integer
ID assigned to a schedule 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
status integer
The status of the extra hours record (Pending, Approved)
extends_before boolean
Indicates if the extra hours request starts before the requested query range
extends_after boolean
Indicates if the extra hours request ends after the requested query range
Example:
{
"2018-05-18": [
{
"member_id": 3,
"schedule_id": 16,
"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,
"status": "Pending",
"extends_before": true,
"extends_after": false
},
{
"member_id": 53,
"schedule_id": 16,
"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,
"status": "Approved",
"extends_before": false,
"extends_after": false
}
],
"2018-05-19": [
{
"member_id": 52,
"schedule_id": 16,
"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,
"status": "Pending",
"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,
"status": "Approved",
"extends_before": false,
"extends_after": true
}
]
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/extra-hours?' . 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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/extra-hours?' + 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 );
});
Routes for retrieving Time Clock information
Returns a list of unique, active Paycodes which can be applied to time clock time.
Description
Returns a list of unique, active Paycodes which can be applied to time clock time.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
paycode_id integer
ID of the Aladtec paycode
name string
A name associated with the paycode
Example:
[
{
"paycode_id": 24,
"name": "Regular"
},
{
"paycode_id": 46,
"name": "Training"
}
]
Error response containing one or more errors returned as a result of invalid payload data
{} application/json
Example:
[
{
"error": "Example general error message."
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-clock/paycodes?';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-clock/paycodes';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( "load", function () {
console.log( xhr.responseText );
});
Returns a list of unique, active Kiosks used to clock in and out.
Description
Returns a list of unique, active Kiosks used to clock in and out.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
kiosk_id integer
ID of the Aladtec time clock kiosk
name string
A name associated with the time clock kiosk
is_enabled boolean
True if the time clock kiosk is enabled in the system
Example:
[
{
"kiosk_id": 1,
"name": "Station",
"is_enabled": true
},
{
"kiosk_id": 2,
"name": "Break Room",
"is_enabled": true
}
]
Error response containing one or more errors returned as a result of invalid payload data
{} application/json
Example:
[
{
"error": "Example general error message."
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-clock/kiosks?';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-clock/kiosks';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( "load", function () {
console.log( xhr.responseText );
});
Routes for retrieving and updating Time Clock records
Time Clock records for the requested date/time range. If a member is clocked in at the...
Description
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
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
range_start | datetime | required | |
range_stop | datetime | required |
{} application/json
member_id integer
ID assigned to a member by Aladtec
paycode_label string
Name of paycode associated to the Time Clock record
start_datetime datetime
stop_datetime datetime
start_timestamp integer
stop_timestamp integer
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/v2';
$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/v2';
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 );
});
Members clocked in at the time of the request.
Description
Members clocked in at the time of the request.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} 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/v2';
$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/v2';
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 );
});
Clocks a member in given a valid member ID.
Description
Clocks a member in given a valid member ID.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
member_id | integer | required | ID assigned to a member by Aladtec |
kiosk_id | integer | required | ID of an authenticated time clock kiosk |
clock_in_datetime | datetime | required | Date and time the member is clocking in, format is YYYY-MM-DDTHH:MM. The date and time is limited to up to 5 minutes in the future. |
paycode_id | integer | required | ID of an associated paycode, optional if paycodes are turned off in the system. |
Example:
{
"member_id": 46,
"kiosk_id": 18,
"clock_in_datetime": "2021-10-12T07:02",
"paycode_id": 2
}
{} application/json
member_id integer
ID of the Aladtec member clocking into the system
kiosk_id integer
ID of the authenticated kiosk for the member clocking into the system
clock_in_datetime datetime
Date and time the member is clocking in, format is YYYY-MM-DDTHH:MM
paycode_id integer
ID of the paycode for the member clocking into the systems
Example:
{
"member_id": 24,
"kiosk_id": 12,
"clock_in_datetime": "2021-10-12T07:02",
"paycode_id": 2
}
Error response containing one or more errors returned as a result of invalid payload data
{} application/json
Example:
[
{
"error": "Example general error message.",
"detail": "A more detailed error message."
}
]
<?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/clock-in';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$clock_in = array(
'member_id' => 46,
'kiosk_id' => 18,
'clock_in_datetime' => '2021-10-12T08:09',
'paycode_id' => 1
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $clock_in ) );
$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/clock-in';
xhr.open( 'POST', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var clock_in_json = {
member_id: 46,
kiosk_id: 18,
clock_in_datetime: '2021-10-12T07:02',
paycode_id: 2
};
xhr.send( JSON.stringify( clock_in_json ) );
xhr.addEventListener( "load", function () {
console.log( xhr.responseText );
});
Clocks a member out given a valid member ID.
Description
Clocks a member out given a valid member ID.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
member_id | integer | required | ID assigned to a member by Aladtec |
kiosk_id | integer | required | ID of an authenticated time clock kiosk |
clock_out_datetime | datetime | required | Date and time the member is clocking out, format is YYYY-MM-DDTHH:MM. The date and time is limited to up to 5 minutes in the future. |
Example:
{
"member_id": 46,
"kiosk_id": 18,
"clock_out_datetime": "2021-10-12T16:15"
}
{} application/json
member_id integer
ID of the Aladtec member clocking out of the system
kiosk_id integer
ID of the authenticated kiosk for the member clocking out of the system
clock_out_datetime datetime
Date and time the member is clocking out, format is YYYY-MM-DDTHH:MM
Example:
{
"member_id": 24,
"kiosk_id": 12,
"clock_out_datetime": "2021-10-12T16:15"
}
Error response containing one or more errors returned as a result of invalid payload data
{} application/json
Example:
[
{
"error": "Example general error message.",
"detail": "A more detailed error message."
}
]
<?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/clock-out';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$clock_out = array(
'member_id' => 46,
'kiosk_id' => 18,
'clock_out_datetime' => '2021-10-12T15:00'
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $clock_out ) );
$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/clock-out';
xhr.open( 'POST', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var clock_out_json = {
member_id: 46,
kiosk_id: 18,
clock_out_datetime: '2021-10-12T16:15'
};
xhr.send( JSON.stringify( clock_out_json ) );
xhr.addEventListener( "load", function () {
console.log( xhr.responseText );
});
Routes for retrieving Event ranges
Events for requested date/time range.
Description
Events for requested date/time range.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
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. |
{} application/json
event_id integer
ID assigned to an event in Aladtec
title string
Event title
description string
Event description
location string
Event location
start_datetime datetime
stop_datetime datetime
start_timestamp integer
stop_timestamp integer
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/v2';
$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/v2';
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 );
});
Routes for retrieving Shift Label information
Shift Labels for requested date range.
Description
Shift Labels for requested date range.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
start_date | date | required | |
stop_date | date | required |
{} 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/v2';
$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/v2';
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 );
});
Routes for retrieving Work Group information
Returns all work groups. Work groups are used for putting members into groups if they...
Description
Returns all work groups. Work groups are used for putting members into groups if they follow the same schedule and work limit rules. Work groups can be customized per Aladtec system.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
work_group_id integer
ID of the work group
name string
Name assigned to the work group
Example:
[
{
"work_group_id": 1,
"name": "Default"
},
{
"work_group_id": 2,
"name": "Duty Crew"
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/work-groups';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/work-groups';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Routes for retrieving Time Type information
Returns a list of unique Time Types which can be applied to scheduled time.
Description
Returns a list of unique Time Types which can be applied to scheduled time.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
limit | integer | optional | Number of records to return in the result. Maximum value is 500. Default: '50'. |
offset | integer | optional | Paginate the records returned in the result. Default: '0'. |
{} application/json
time_type_id integer
ID assigned to a time type in Aladtec
name string
Name assigned to a time type in Aladtec
is_default boolean
Whether or not the time type is applied by default to new time records; For systems using Time Types, one time type must be set as the default.
is_active boolean
A time type is either active or inactive
Example:
[
{
"time_type_id": 3,
"name": "Happy Hour",
"is_default": false,
"is_active": true
},
{
"time_type_id": 0,
"name": "Regular",
"is_default": true,
"is_active": true
},
{
"time_type_id": 2,
"name": "Block Time",
"is_default": false,
"is_active": true
},
{
"time_type_id": 10,
"name": "Training",
"is_default": false,
"is_active": true
}
]
Error response when Time Types are disabled.
{} application/json
Example:
[
{
"error": "Time Types are not enabled in this system."
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/time-types?limit=50';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/time-types?limit=50';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Routes for retrieving and updating Time Off accrual information
Returns a list of all accrual banks
Description
Returns a list of all accrual banks
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
accrual_bank_id integer
ID assigned to an accrual bank in Aladtec
name string
Name assigned to an accrual bank in Aladtec
Example:
[
{
"accrual_bank_id": 1,
"name": "Personal Time"
},
{
"accrual_bank_id": 2,
"name": "Vacation Time"
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/accrual-banks';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/accrual-banks';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Returns the number of hours in each specified accrual bank for a list of provided members
Sets accrual bank balances given a list of hours for members' accrual banks
Description
Returns the number of hours in each specified accrual bank for a list of provided members
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
member_ids | array | required | IDs assigned to members by Aladtec |
accrual_bank_ids | array | required | IDs assigned to accrual banks in Aladtec |
{} application/json
member_id integer
ID assigned to a member by Aladtec
accrual_bank_id integer
ID assigned to an accrual bank in Aladtec
hours float
The number of hours in the bank for the specified member in Aladtec
Example:
[
{
"member_id": 1,
"accrual_bank_id": 1,
"hours": 24.5
},
{
"member_id": 1,
"accrual_bank_id": 2,
"hours": 36.1234
},
{
"member_id": 3,
"accrual_bank_id": 1,
"hours": 0
},
{
"member_id": 3,
"accrual_bank_id": 2,
"hours": -12
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/accrual-banks/balances?' . http_build_query( array(
'member_ids' => '[1,2,3]',
'accrual_bank_ids' => '[1,2]'
) );
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/accrual-banks/balances?' + new URLSearchParams( {
member_ids: '[1,2,3]',
accrual_bank_ids: '[1,2]'
} ).toString();
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Description
Sets accrual bank balances given a list of hours for members' accrual banks
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
member_id | integer | required | ID assigned to a member by Aladtec |
accrual_bank_id | integer | required | ID assigned to an accrual bank in Aladtec |
hours | number | required | The absolute number of hours to set the accrual bank balance. Both positive and negative values are allowed to be specified. The number can have, at most, four decimal places of precision (e.g. 10.1234). |
note | string | optional | An optional note to log details about the set |
Example:
[
{
"member_id": 1,
"accrual_bank_id": 1,
"hours": 0
},
{
"member_id": 1,
"accrual_bank_id": 2,
"hours": 40,
"note": 'Example note about setting the accrual balance.'
},
{
"member_id": 3,
"accrual_bank_id": 2,
"hours": 12.5001
}
{
"member_id": 4,
"accrual_bank_id": 1,
"hours": -10.234
}
]
{} application/json
member_id integer
ID assigned to a member by Aladtec
accrual_bank_id integer
ID assigned to an accrual bank in Aladtec
hours float
The number of hours in the bank for the specified member in Aladtec
Example:
[
{
"member_id": 1,
"accrual_bank_id": 1,
"hours": 24.5
},
{
"member_id": 1,
"accrual_bank_id": 2,
"hours": 36.1234
},
{
"member_id": 3,
"accrual_bank_id": 1,
"hours": 0
},
{
"member_id": 3,
"accrual_bank_id": 2,
"hours": -12
}
]
Error response containing one or more errors returned as a result of invalid payload data. Errors caused by an individual set value also include the member_id and accrual_bank_id to identify that set.
{} application/json
Example:
[
{
"error": "Example general error message.",
},
{
"error": "Example error message about a specific set.",
"member_id": 15,
"accrual_bank_id": 4
},
{
"error": "Example error message about a specific set.",
"member_id": 16,
"accrual_bank_id": 8
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/accrual-banks/balances';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$accrual_sets = array(
array(
'member_id' => 1,
'accrual_bank_id' => 1,
'hours' => 0
),
array(
'member_id' => 1,
'accrual_bank_id' => 2,
'hours' => 40.000,
'note' => 'Example note for setting the accrual balance.'
),
array(
'member_id' => 3,
'accrual_bank_id' => 2,
'hours' => 12.5001
)
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $accrual_sets ) );
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/accrual-banks/balances';
xhr.open( 'PUT', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var accrual_sets = [
{
member_id: 1,
accrual_bank_id: 1,
hours: 0
},
{
member_id: 1,
accrual_bank_id: 2,
hours: 40,
note: 'Example note about setting the balance.'
},
{
member_id: 3,
accrual_bank_id: 2,
hours: 12.5001
}
];
xhr.send( JSON.stringify( accrual_sets ) );
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Updates accrual bank balances given a list of adjustment hours for members' accrual banks
Description
Updates accrual bank balances given a list of adjustment hours for members' accrual banks
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
member_id | integer | required | ID assigned to a member by Aladtec |
accrual_bank_id | integer | required | ID assigned to an accrual bank in Aladtec |
adjustment_hours | number | required | The relative number of hours to adjust the accrual bank balance. A positive number will increase the balance, and a negative number will decrease the balance. The number can have, at most, four decimal places of precision (e.g. 10.1234). |
note | string | optional | An optional note to log details about the adjustment |
Example:
[
{
"member_id": 1,
"accrual_bank_id": 1,
"adjustment_hours": 24
},
{
"member_id": 1,
"accrual_bank_id": 2,
"adjustment_hours": -40,
"note": 'Example note about the adjustment.'
},
{
"member_id": 3,
"accrual_bank_id": 2,
"adjustment_hours": 12.5001
}
]
{} application/json
member_id integer
ID assigned to a member by Aladtec
accrual_bank_id integer
ID assigned to an accrual bank in Aladtec
hours float
The updated number of hours in the bank for the specified member in Aladtec
Example:
[
{
"member_id": 1,
"accrual_bank_id": 1,
"hours": 48
},
{
"member_id": 1,
"accrual_bank_id": 2,
"hours": -4
},
{
"member_id": 3,
"accrual_bank_id": 2,
"hours": 0.5001
}
]
Error response containing one or more errors returned as a result of invalid payload data. Errors caused by an individual adjustment value also include the member_id and accrual_bank_id to identify that adjustment.
{} application/json
Example:
[
{
"error": "Example general error message.",
},
{
"error": "Example error message about a specific adjustment.",
"member_id": 15,
"accrual_bank_id": 4
},
{
"error": "Example error message about a specific adjustment.",
"member_id": 16,
"accrual_bank_id": 8
}
]
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/accrual-banks/balances/adjustments';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $api_token,
'Content-Type: application/json'
));
curl_setopt( $ch, CURLOPT_FAILONERROR, true );
$accrual_adjustments = array(
array(
'member_id' => 1,
'accrual_bank_id' => 1,
'adjustment_hours' => 24.000
),
array(
'member_id' => 1,
'accrual_bank_id' => 2,
'adjustment_hours' => -40.000,
'note' => 'Example note about the adjustment.'
),
array(
'member_id' => 3,
'accrual_bank_id' => 2,
'adjustment_hours' => 12.5001
)
);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $accrual_adjustments ) );
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/accrual-banks/balances/adjustments';
xhr.open( 'POST', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.setRequestHeader( 'Content-Type', 'application/json' );
var accrual_adjustments = [
{
member_id: 1,
accrual_bank_id: 1,
adjustment_hours: 24
},
{
member_id: 1,
accrual_bank_id: 2,
adjustment_hours: -40,
note: 'Example note about the adjustment.'
},
{
member_id: 3,
accrual_bank_id: 2,
adjustment_hours: 12.5001
}
];
xhr.send( JSON.stringify( accrual_adjustments ) );
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Routes for retrieving Aladtec system configuration information
Returns a list of configuration settings
Description
Returns a list of configuration settings
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
{} application/json
timezone string
The timezone used by the system in tz database format, also known as IANA or Olson.
organization_name string
The name of the organization using this Aladtec system
system_admin_member_id int
The member_id of the system admin. This can be used in conjunction with the /members resource to get information about this member.
historical_edits_limit string
The number of days a record remains editable after it occurs. If no limit is imposed, this will return the string "No Limit".
Example:
{
"timezone": "America/Chicago",
"organization_name": "Example Department",
"system_admin_member_id": 3,
"historical_edits_limit": "7"
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
$url = $base_url . '/configuration';
$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/v2';
var api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
var xhr = new XMLHttpRequest();
var url = base_url + '/configuration';
xhr.open( 'GET', url );
xhr.setRequestHeader( 'Authorization', 'Bearer ' + api_token );
xhr.send();
xhr.addEventListener( 'load', function () {
console.log( xhr.responseText );
});
Routes for exporting reports
Runs the Payroll Report export. Pagination is required to export all...
Description
Runs the Payroll Report export.
Pagination is required to export all records within the requested range.
Authorization | string | required | API access token to authenticate the request. The token value must be prefaced with the word "Bearer" and a single space. |
range_start | datetime | required | Datetime format is YYYY-MM-DDTHH:MM |
range_stop | datetime | required | Datetime format is YYYY-MM-DDTHH:MM |
member_ids | array | optional | IDs assigned to members by Aladtec |
time_categories | array | optional | One or more payroll categories to filter by. Possible values: [ time_worked, time_off, overtime, holiday ] |
next_token | string | optional | Pagination token used to request the next set of records |
Successful response containing a partial set of Payroll Report records.
{} application/json
data array
Array of Payroll Report records divided by member
member object
Member information
member_id integer
ID assigned to a member by Aladtec
first_name string
Member given name
last_name string
Member family name
report_entries array
Array of Payroll Report time records
start_time datetime
Datetime format is ISO 8601
stop_time datetime
Datetime format is ISO 8601
schedule object
This property has a value when pay_type.record_type
equals "time_type". Otherwise, it will have a value of null.
schedule_id integer
ID assigned to a schedule in Aladtec
name string
The name of the schedule
position_qualification object
This property has a value when pay_type.record_type
equals "time_type". Otherwise, it will have a value of null.
position_qualification_id integer
ID assigned to a position qualification in Aladtec
name string
Name assigned to the qualification
pay_type object
The entry's Aladtec time record type
id string
ID of the type
name string
Name of the type
record_type string
The time record type in Aladtec. Possible values: [ time_type, paycode, time_off_type ]
time_category string
The payroll category in Aladtec. Possible values: [ time_worked, time_off, overtime, holiday ]
shift_differential string
The shift differential value if this record is mapped to one
payroll_hours number
Total number of hours for this entry
meta object
Additional properties describing the record set within data
.
next_token string
Pagination token used to request the next set of records. When this value is an empty ""
, all records in the requested range have been returned.
last_updated integer
Unix timestamp at which data
was generated
Example:
{
"data": [
{
"member": {
"member_id": 4,
"first_name": "John",
"last_name": "Doe"
},
"report_entries": [
{
"start_time": "2018-12-02T09:00:00-06:00",
"stop_time": "2018-12-02T17:00:00-06:00",
"schedule": {
"schedule_id": 1,
"name": "Ambulance 1"
},
"position_qualification": {
"position_qualification_id": 10,
"name": "EMT"
},
"pay_type": {
"record_type": "time_type",
"id": 1,
"name": "Regular"
},
"time_category": "time_worked",
"shift_differential": "",
"payroll_hours": 8
},
{
"start_time": "2019-01-01T00:00:00-06:00",
"stop_time": "2019-01-03T00:00:00-06:00",
"schedule": null,
"position_qualification": null,
"pay_type": {
"record_type": "paycode",
"id": 1,
"name": "Hourly"
},
"time_category": "overtime",
"shift_differential": "",
"payroll_hours": 48
}
]
}
],
"meta": {
"generated_at": 1655904611,
"next_token": "eyJyYW5nZV9zdGFydCI6IjIwMTktMDEtMDFUMDA6MDAiLCJyYW5nZV9zdG9wIjoiMjAxOS0wMS0wM1QwMDowMCIsIm1lbWJlcl9pZHMiOiJbODEsODIsODMsODQsODUsODYsODcsODgsODksOTAsOTEsOTIsOTMsOTUsOTYsOTgsOTksMTAxLDEwMiwxMDgsMTgsNDMsMTAwLDE1LDEwNiwxMDQsMTA1LDk0LDEwMywxMDddIn0="
}
}
<?php
/* Set your system URL and API token here. */
$base_url = 'https://secure#.aladtec.com/example/api/v2';
$api_token = 'zYyMDk5MTAtbnU1blZVY3NPTHdFWEczWE1MT0RLRkNTYmI3WE1ELjBwYTZaaTNjS';
/* For this example, we are getting the first set of payroll report members */
$url = $base_url . '/reports/payroll?' . 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;
return;
}
echo( 'Response: ' . "\n" . $response_body . "\n" );
/* For this example, we are using the next_token to get the next set of members */
$response_array = json_decode( $response_body, true );
$next_token = $response_array['meta']['next_token'];
while ( !empty( $next_token ) ) {
$url = $base_url . '/reports/payroll?' . http_build_query( array(
'next_token' => $next_token
) );
curl_setopt($ch, CURLOPT_URL, $url);
$response_body = curl_exec( $ch );
$error = curl_error( $ch );
if ( $error ) {
echo 'Error: ' . $error;
}
echo( "\n" . 'Response: ' . "\n" . $response_body . "\n" );
$response_array = json_decode( $response_body, true );
$next_token = $response_array['meta']['next_token'];
}
curl_close( $ch );
/* Set your system URL and API token here. */
const base_url = 'https://secure#.aladtec.com/example/api/v2';
const api_token = 'YOUR API TOKEN';
(async () => {
let url = `${base_url}/reports/payroll?`;
let params = {
range_start: '2020-01-01T00:00',
range_stop: '2021-01-07T00:00'
};
let headers = {
'Authorization': 'Bearer ' + api_token
};
let report_data = [];
do {
const res = await fetch( url + new URLSearchParams( params ).toString(), {
headers: headers
} );
const json = await res.json();
report_data = report_data.concat( json.data );
params.next_token = json.meta.next_token;
} while ( params.next_token !== '' );
console.log( report_data );
})();
© Aladtec Inc. All rights reserved.