Getting started

Preface

This document describes the Aladtec Vendor XML API.

The API allows retrieval of information from the Aladtec system. Specifically, information can be retrieved related to:

  • Scheduling - dates/times, schedule, position, time type
  • Time Clock - dates/times of punches, pay codes
  • Who’s Working Now - scheduled time, currently punched in on the time clock
  • Members - names, id numbers, certifications, emergency contacts, and any other stored information
  • Availability of Members - dates/times, types
  • Time Off - dates/times, types
  • Events - date/time, title, description, location

The Vendor XML API is implemented as a PHP page that accepts POST ​parameters and returns XML after a user has been authenticated. The Vendor XML API is included with the product and does not need to be installed separately.

To start using the API, please contact Aladtec Support to request an access key.

General Information

  1. Only HTTPS POST​ requests will be processed.
  2. The response is a valid XML file in UTF-8 format containing an outer <results> tag at the root.
  3. If the first child node is <error>, something went wrong.
  4. All date-time references are specified in UTC using the following case-sensitive format as in the example: 2010-03-22T15:30:00Z
    • 2010 is the year
    • 03* is the month
    • 22* is the day of month
    • 15* is the hour using a 24 hour clock
    • 30* is the minute
    • 00* is the second
    • * these values are 2-digit and "left-zero padded"
  5. All parameter keys and values are case sensitive and should be url encoded.

API Rate Limits

An Aladtec subscription provides 50 requests per minute and 2500 requests per rolling 24 hour period. Once the rate limit has been reached, an "Unauthorized Access" error code will be returned until the rate limit automatically resets.

Error Codes

Any HTTP response code other than 200 or 3xx should be considered an error. The URL you were originally given by Aladtec is subject to change at the discretion of Aladtec.

If your URL does change, you will receive a 3xx HTTP response. The response will include a "Location:" header that will point to a new URL that you can use to access the XML API for your system.


Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results>
    <error code="1">API Unavailable</error>
</results>

Error Codes:

Code Description
1 API Unavailable
2 Unauthorized Access
3 Invalid Request
100 Time Types for Schedule Time Disabled
101 Time Off Disabled
102 Time Clock Disabled
103 Time Clock Pay Codes Disabled

Commands

authenticateMember

Checks member password against either member unique identifier or member user name. If too many failed password attempts occur (code 2, see below), then the member will be locked out for a period of time (codes 3 and 4, see below) and Aladtec will be notified. Any abuse of this command will result in the immediate disabling of the offending access identifier's account.

Parameter Description
accid access identifier
acckey access key
cmd authenticateMember
memid (optional) Aladtec member id (see getMembers)
memun (optional) Aladtec member username
mempw Aladtec member password

Example 1 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'authenticateMember',
    'memid' => '64',
    'mempw' => 'pass2453'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Example 2 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'authenticateMember',
    'memun' => 'psmith',
    'mempw' => 'pass2453'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <authentication code="0">
        <member id="64"/>
    </authentication>
</results>

Authentication Code Responses:

Code Description
0 Success
1 Member could not be found
2 Invalid password
3 Too many failed attempts
4 Member currently locked out

Definitions

  • authentication
    container for authentication information
  • code (authentication)
    authentication status – 0 is successful, 1 through 4 are failures
  • retry (authentication)
    seconds before member is no longer locked out - times vary
    • member
      specific member information - this is only returned for a code value of 0 (zero)
    • id (member)
      Aladtec unique identifier for member
    • message
      textual message for codes 1 through 4

getAttributes

Returns a list of all of the member database sections (groups) and their associated member database fields (attributes).

Parameter Description
accid access identifier
acckey access key
cmd getAttributes

Example

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getAttributes'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <groups>
        <group id="1">
            <name>General Information</name>
        </group>
        <group id="3">
            <name>Certifications</name>
        </group>
    </groups>
    <attributes>
        <attribute id="1" accessible="yes" groupid="0">
            <name>First Name</name>
        </attribute>
        <attribute id="3" accessible="yes" groupid="0">
            <name>Last Name</name>
        </attribute>
        <attribute id="35" accessible="yes" groupid="1">
            <name>Employee Id</name>
        </attribute>
        <attribute id="18" accessible="no" groupid="3">
            <name>EMT-B Course: Completed</name>
        </attribute>
    </attributes>
</results>

Definitions

  • groups
    container for group information
    • group
      specific group information
    • id (group)
      Aladtec unique identifier for group. Group id 0 is reserved for system-defined attributes.
      • name
        name of group
  • attributes
    container for attribute information
    • attribute
      specific attribute information
    • id (attribute)
      Aladtec unique identifier for attribute
    • accessible (attribute)
      whether this attribute will be returned by getMembers. Please contact Aladtec, Inc. to expose additional attributes for the API.
    • groupid (attribute)
      Aladtec unique identifier for group
      • name
        name of attribute

getAvailability

Returns a list of members and their associated availability types within a time range.

Parameter Description
accid access identifier
acckey access key
cmd getAvailability
bt beginning time for range (see General Information for format)
et end time for range (see General Information for format)

Example

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getAvailability',
    'bt' => '2015-01-01T00:00:00Z',
    'et' => '2016-01-01T00:00:00Z'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF­-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <type>Available</type>
            <member id="32"/>
            <begin>2015-12-14T12:00:00Z</begin>
            <end>2015-12-14T20:00:00Z</end>
        </range>
        <range>
            <type>Prefer</type>
            <member id="64"/>
            <begin>2015-11-19T03:00:00Z</begin>
            <end>2015-11-21T21:00:00Z</end>
        </range>
    </ranges>
</results>

Definitions

  • ranges
    container for availability date-time info
    • range
      specific availability date-time info
      • type
        specific availability type ( Available, Prefer, Unavailable )
      • member
        specific member information
      • id (member)
        Aladtec unique identifier for member
      • begin
        date-time of the beginning of availability type range
      • end
        date-time of the ending of availability type range

getClockedInMembers

Returns a list of members currently punched into the system time clock.

Parameter Description
accid access identifier
acckey access key
cmd getClockedInMembers

Example

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getClockedInMembers'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned When SOME members are currently punched into the system time clock.

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <members>
        <member id="32"/>
        <member id="64"/>
    </members>
</results>

Information Returned When NO members are currently punched into the system time clock

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <members/>
</results>

Definitions

  • members
    container for member information
    • member
      specific member information
    • id (member)
      Aladtec unique identifier for member

getEvents

Returns a list of events.

Parameter Description
accid access identifier
acckey access key
cmd getEvents
bd beginning date for the range (yyyy-mm-dd)
ed (optional) end date for the range (yyyy-mm-dd)

Example

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getEvents',
    'bd' => '2012-04-01',
    'ed' => '2012-04-30'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <events>
        <event public="yes" type="5">
            <title>Game Night</title>
            <description>Play until the sun comes up!</description>
            <location>Public Library</location>
            <begin>2012-04-20</begin>
            <end>2012-04-21T15:30:00Z</end>
            <schedules />
        </event>
        <event public="no" type="4">
            <title>CPR Training</title>
            <description></description>
            <location>Clinic</location>
            <begin>2012-05-01T01:30:00Z</begin>
            <end />
            <schedules>
                <schedule id="1"/>
                <schedule id="3"/>
                <schedule id="4"/>
            </schedules>
        </event>
    </events>
</results>

Definitions

  • events
    container for event info
    • event
      specific event info
    • public (event)
      whether event is marked as publicly viewable - either "yes" or "no"
    • type (event)
      one of the following:
      1 - starts on <begin> date at <begin> time and ends on <end> date at <end> time
      2 - starts on <begin> date at <begin> time and ends on <end> date
      3 - starts on <begin> date at <begin> time and ends on <end> time
      4 - starts on <begin> date at <begin> time
      5 - starts on <begin> date and ends on <end> date at <end> time
      6 - starts on <begin> date and ends on <end> date
      7 - starts on <begin> date and ends on <end> time
      8 - occurs on <begin> date
      • title
        event title
      • description
        event description
      • location
        event location
      • begin
        date or date-time of the beginning of the event
      • end
        date or date-time of the ending of the event
      • schedules
        container for schedule information
        • schedule
          specific schedule information
        • id (schedule)
          Aladtec unique identifier for schedule

getMembers

Returns a list of all of the members (including inactive members).

Parameter Description
accid access identifier
acckey access key
cmd getMembers
ia (optional) including api accessible attributes (all)
only_active (optional) whether or not to limit to active members only (0 or 1) – 0 default

Example 1 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getMembers'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF­-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <members>
        <member id="32">
            <name>John Anderson</name>
        </member>
        <member id="64">
            <name>Pete Smith</name>
        </member>
    </members>
</results>

Example 2 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getMembers',
    'ia' => 'all'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <members>
        <member id="32">
            <name>John Anderson</name>
            <attributes>
                <attribute id="1" key="first_name">
                    <value>John</value>
                </attribute>
                <attribute id="3" key="last_name">
                    <value>Anderson</value>
                </attribute>
                <attribute id="35">
                    <value>1</value>
                </attribute>
            </attributes>
        </member>
        <member id="64">
            <name>Pete Smith</name>
            <attributes>
                <attribute id="1" key="first_name">
                    <value>Pete</value>
                </attribute>
                <attribute id="3" key="last_name">
                    <value>Smith</value>
                </attribute>
                <attribute id="35">
                    <value>3</value>
                </attribute>
            </attributes>
        </member>
    </members>
</results>

Example 3 of 3

Note: In this example John Anderson is active and Pete Smith is inactive.

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getMembers',
    'only_active' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <members>
         <member id="32">
            <name>John Anderson</name>
        </member>
    </members>
</results>

Definitions

  • members
    container for member information
    • member
      specific member information
    • id (member)
      Aladtec unique identifier for member
      • name
        name of member
      • attributes
        container for attribute information
        • attribute
          specific attribute information. Please contact Aladtec, Inc. to expose additional attributes for the API.
        • id (attribute)
          Aladtec unique identifier for attribute
        • key (attribute)
          Aladtec unique identifier for system-defined attributes. User-defined attributes will not have keys.
          • value
            value of attribute

getScheduledTimeNow

Returns a list of members who are scheduled to work at time of request.

Parameter Description
accid access identifier
acckey access key
cmd getScheduledTimeNow
sch (optional) comma separated list of schedule ids (e.g. 5,6,7) OR all – all default
isp (optional) boolean flag for including schedule positions (0 or 1) – 0 default

Example 1 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getScheduledTimeNow',
    'sch' => '5,9'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <schedules>
        <schedule id="5">
            <members>
                <member id="32"/>
                <member id="64"/>
            </members>
        </schedule>
        <schedule id="9"/>
    </schedules>
</results>

Example 2 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getScheduledTimeNow',
    'ia' => 'all',
    'isp' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <schedules>
        <schedule id="5">
            <positions>
                <position id="1">
                    <member id="32"/>
                </position>
                <position id="2">
                    <member id="64"/>
                </position>
            </positions>
        </schedule>
        <schedule id="9">
            <positions>
                <position id="4"/>
            </positions>
        </schedule>
    </schedules>
</results>

Definitions

  • schedules
    container for schedule information
    • schedule
      specific schedule information
    • id (schedule)
      Aladtec unique identifier for schedule
      • positions
        container for schedule position information
        • position
          specific schedule position information
        • id (position)
          Aladtec unique identifier for schedule position
          • member
            specific member information
          • id (member)
            Aladtec unique identifier for member

getScheduledTimeRanges

Returns a list of members who are scheduled to work within a time range across one or more schedules.

Parameter Description
accid access identifier
acckey access key
cmd getScheduledTimeRanges
bt beginning time for range (see General Information for format)
et end time for range (see General Information for format)
sch (optional) comma separated list of schedule ids (e.g. 5,6,7) OR all – all default
isp (optional) boolean flag for including schedule positions (0 or 1) – 0 default
itt (optional) boolean flag for including time types (0 or 1) – 0 default

Example 1 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getScheduledTimeRanges',
    'sch' => '5,6,9',
    'bt' => '2010-03-15T15:00:00Z',
    'et' => '2010-03-22T15:00:00Z'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <schedule id="5"/>
            <member id="42"/>
            <begin>2010-03-20T03:30:00Z</begin>
            <end>2010-03-20T15:30:00Z</end>
        </range>
        <range>
            <schedule id="6"/>
            <member id="32"/>
            <begin>2010-03-20T07:30:00Z</begin>
            <end>2010-03-21T21:30:00Z</end>
        </range>
    </ranges>
</results>

Example 2 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getScheduledTimeRanges',
    'sch' => '5,6,9',
    'bt' => '2010-03-15T15:00:00Z',
    'et' => '2010-03-22T15:00:00Z',
    'isp' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <schedule id="5"/>
            <position id="1"/>
            <member id="42"/>
            <begin>2010-03-20T03:30:00Z</begin>
            <end>2010-03-20T11:30:00Z</end>
        </range>
        <range>
            <schedule id="5"/>
            <position id="2"/>
            <member id="42"/>
            <begin>2010-03-20T11:30:00Z</begin>
            <end>2010-03-20T15:30:00Z</end>
        </range>
        <range>
            <schedule id="6"/>
            <position id="9"/>
            <member id="32"/>
            <begin>2010-03-20T07:30:00Z</begin>
            <end>2010-03-21T21:30:00Z</end>
        </range>
    </ranges>
</results>

Example 3 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getScheduledTimeRanges',
    'sch' => '5,6,9',
    'bt' => '2010-03-15T15:00:00Z',
    'et' => '2010-03-22T15:00:00Z',
    'isp' => '1',
    'itt' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <schedule id="5"/>
            <position id="1"/>
            <timetype>Regular</timetype>
            <member id="42"/>
            <begin>2010-03-20T03:30:00Z</begin>
            <end>2010-03-20T11:30:00Z</end>
        </range>
        <range>
            <schedule id="5"/>
            <position id="2"/>
            <timetype>Regular</timetype>
            <member id="42"/>
            <begin>2010-03-20T11:30:00Z</begin>
            <end>2010-03-20T15:30:00Z</end>
        </range>
        <range>
            <schedule id="6"/>
            <position id="9"/>
            <timetype>Overtime</timetype>
            <member id="32"/>
            <begin>2010-03-20T07:30:00Z</begin>
            <end>2010-03-21T21:30:00Z</end>
        </range>
    </ranges>
</results>

Definitions

  • ranges
    container for scheduled date-time info
    • range
      specific scheduled date-time info
      • schedule
        specific schedule information
      • id (schedule)
        Aladtec unique identifier for schedule
      • position
        specific position information
      • id (position)
        Aladtec unique identifier for schedule position
      • timetype
        specific time type information
      • member
        specific member information
      • id (member)
        Aladtec unique identifier for member
      • begin
        date-time of the beginning of current "shift"
      • end
        date-time of the ending of current "shift"

getSchedules

Returns a list of all of the schedules.

Parameter Description
accid access identifier
acckey access key
cmd getSchedules
isp (optional) boolean flag for including schedule positions (0 or 1) – 0 default

Example 1 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getSchedules'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <schedules>
        <schedule id="5">
            <name>Sample BLS - 24/48</name>
        </schedule>
        <schedule id="6">
            <name>Medic 5</name>
        </schedule>
        <schedule id="7">
            <name>Wheelchair Van 12</name>
        </schedule>
        <schedule id="8">
            <name>Air Crew</name>
        </schedule>
        <schedule id="9">
            <name>Dispatch</name>
        </schedule>
    </schedules>
</results>

Example 2 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getSchedules'
    'isp' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <schedules>
        <schedule id="5">
            <name>Sample BLS – 24/48</name>
            <positions>
                <position id="1">
                    <name>EMT</name>
                </position>
                <position id="2">
                    <name>Driver</name>
                </position>
            </positions>
        </schedule>
        <schedule id="6">
            <name>Medic 5</name>
            <positions>
                <position id="9">
                    <name>Medic</name>
                </position>
                <position id="8">
                    <name>EMT</name>
                </position>
            </positions>
        </schedule>
    </schedules>
</results>

Definitions

  • schedules
    container for schedule information
    • schedule
      specific schedule information
    • id (schedule)
      Aladtec unique identifier for schedule
      • name
        name of schedule
      • positions
        container for schedule position information
        • position
          specific schedule position information
        • id (position)
          Aladtec unique identifier for schedule position
          • name
            name of schedule position

getTimeClockRanges

Returns a list of members who have time clock punches within a time range.

Parameter Description
accid access identifier
acckey access key
cmd getTimeClockRanges
bt beginning time for range (see General Information for format)
et end time for range (see General Information for format)
ipc (optional) boolean flag for including pay code information (0 or 1) – 0 default

Example 1 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getTimeClockRanges',
    'bt' => '2010-04-01T15:00:00Z',
    'et' => '2010-04-30T15:00:00Z'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <member id="42"/>
            <begin>2010-05-20T03:30:00Z</begin>
            <end>2010-05-20T15:30:00Z</end>
        </range>
        <range>
            <member id="32"/>
            <begin>2010-05-12T07:30:00Z</begin>
            <end>2010-05-12T21:30:00Z</end>
        </range>
    </ranges>
</results>

Example 2 of 2

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getTimeClockRanges',
    'bt' => '2010-04-01T15:00:00Z',
    'et' => '2010-04-30T15:00:00Z',
    'ipc' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <member id="42"/>
            <paycode>Training/Drill</paycode>
            <begin>2010-05-20T03:30:00Z</begin>
            <end>2010-05-20T15:30:00Z</end>
        </range>
        <range>
            <member id="32"/>
            <paycode>Regular Shift</paycode>
            <begin>2010-05-12T07:30:00Z</begin>
            <end>2010-05-12T21:30:00Z</end>
        </range>
    </ranges>
</results>

Definitions

  • ranges
    container for time clock date-time info
    • range
      specific time clock date-time info
      • member
        specific member information
      • id (member)
        Aladtec unique identifier for member
      • paycode
        specific time clock pay code information
      • begin
        date-time of the beginning of time clock range
      • end
        date-time of the ending of time clock range

getTimeOff

Returns a list of members who have approved time off within a time range.

Parameter Description
accid access identifier
acckey access key
cmd getTimeOff
bt beginning time for range (see General Information for format)
et end time for range (see General Information for format)
ipto (optional) boolean flag for including paid time off (0 or 1) – 0 default
itot (optional) boolean flag for including time off types (0 or 1) – 0 default

Example 1 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getTimeOff',
    'bt' => '2010-04-01T15:00:00Z',
    'et' => '2010-04-30T15:00:00Z'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <member id="42"/>
            <begin>2010-04-20T03:30:00Z</begin>
            <end>2010-04-25T15:30:00Z</end>
        </range>
        <range>
            <member id="32"/>
            <begin>2010-04-12T07:30:00Z</begin>
            <end>2010-04-21T21:30:00Z</end>
        </range>
    </ranges>
</results>

Example 2 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getTimeClockRanges',
    'bt' => '2010-04-01T15:00:00Z',
    'et' => '2010-04-30T15:00:00Z',
    'ipto' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <member id="42"/>
            <begin>2010-04-20T03:30:00Z</begin>
            <end>2010-04-25T15:30:00Z</end>
            <paid/>
        </range>
        <range>
            <member id="32"/>
            <begin>2010-04-12T07:30:00Z</begin>
            <end>2010-04-21T21:30:00Z</end>
            <paid>
                <range>
                    <begin>2010-04-15T014:30:00Z</begin>
                    <end>2010-04-15T22:30:00Z</end>
                </range>
                <range>
                    <begin>2010-04-16T014:30:00Z</begin>
                    <end>2010-04-16T22:30:00Z</end>
                </range>
                <range>
                    <begin>2010-04-17T014:30:00Z</begin>
                    <end>2010-04-17T22:30:00Z</end>
                </range>
                <range>
                    <begin>2010-04-18T014:30:00Z</begin>
                    <end>2010-04-18T22:30:00Z</end>
                </range>
                <range>
                    <begin>2010-04-19T014:30:00Z</begin>
                    <end>2010-04-19T22:30:00Z</end>
                </range>
            </paid>
        </range>
    </ranges>
</results>

Example 3 of 3

<?php
$url = "https://SYSTEM_URL/xmlapi.php";
$c = curl_init();

$params = array(
    'accid' => 'ACCOUNT_ID',
    'acckey' => 'ACCOUNT_KEY',
    'cmd' => 'getTimeClockRanges',
    'bt' => '2010-04-01T15:00:00Z',
    'et' => '2010-04-30T15:00:00Z',
    'itot' => '1'
);

curl_setopt( $c, CURLOPT_URL, $url );
curl_setopt( $c, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $c, CURLOPT_POSTFIELDS, http_build_query( $params ) );
curl_setopt( $c, CURLOPT_POST, true );

$xml_response = curl_exec( $c );

if ( curl_error( $c ) ) {
    echo 'error: ' . curl_error( $c );
    exit;
}

Information Returned

<?xml version="1.0" encoding="UTF-8"?>
<results version="3.5.3" accessTime="2016-03-03T15:52:01Z">
    <ranges>
        <range>
            <member id="42"/>
            <type>Personal Time</type>
            <begin>2010-04-20T03:30:00Z</begin>
            <end>2010-04-25T15:30:00Z</end>
        </range>
        <range>
            <member id="32"/>
            <type>Vacation</type>
            <begin>2010-04-12T07:30:00Z</begin>
            <end>2010-04-21T21:30:00Z</end>
        </range>
    </ranges>
</results>

Definitions

  • ranges
    container for time off date-time info
    • range
      specific time off date-time info
      • member
        specific member information
      • id (member)
        Aladtec unique identifier for member
      • type
        specific time off type information
      • paycode
        specific time off pay code information
      • begin
        date-time of the beginning of time clock range
      • end
        date-time of the ending of time clock range
      • paid
        container for paid time off date-time info
        • range
          specific paid time off date-time info
          • begin
            date-time of the beginning of paid time off range
          • end
            date-time of the ending of paid time off range

© 2017 Aladtec Inc. All rights reserved.