InstaAlert™ Protocol Documentation
Applies to SupportSuite™ and eSupport™ 3.00.00 and higher
© 2008 Kayako, All Rights Reserved.

SECTIONS:

  1. Synopsis
  2. SWIFT headers
  3. Login
  4. Update
  5. Logout

1. SYNOPSIS

The InstaAlert protocol is designed to allow remote applications to receive alerts when certain events occur within the framework of Kayako's web-based help desk software (SupportSuite™ and eSupport™). It is exclusively executed over HTTP/S with most data sent in XML format.

The protocol begins with the client application requesting to begin a new session by authenticating. Once authenticated, the client is responsible for polling the server at an interval for XML alert data. When the client wishes to terminate the session, it should log out.

Technical questions regarding implementation of this protocol should be directed to the Kayako forums.

2. SWIFT HEADERS

Each response sent by the server will begin with a header in the following format:

SWIFT Header: <compression>;<md5 compressed>;<md5 uncompressed>;<size compressed>;<size uncompressed>;<data>

compression
Either the string "compressed" or "uncompressed" determining whether or not data is zlib compressed.
md5 compressed
The MD5 checksum of the zlib compressed data in printed hexadecimal format (e.g. '4FD8E4FD5988E970476E52AD0994EBB0'), or '0' if data is not compressed.
md5 uncompressed
The printed hexadecimal MD5 checksum of data, or '0' if data is zlib compressed.
size compressed
The size, in bytes of the zlib compressed data, or '0' if data is not compressed.
size uncompressed
The size, in bytes of data, or '0' if data is zlib compressed.
data
The data that resulted from the client's query, which may be zlib compressed.
If an error occurs during the processing of a request, the server may respond with one of the following error codes in the data parameter:
'-1'
The session variable provided by the client is no longer valid and the client must re-authenticate.
'-2'
Authentication has failed; the user name or password provided are not correct.

3. LOGIN

Before the client application can request alert data, it must first be authenticated. This is done by opening a URL in the following format:

Login URL: <path>/instaalert/index.php?_ca=login&username=<user>&password=<pass>
path
The whole path to the installation directory for the help desk (e.g. http://domain.com/support or http://support.domain.com)
user
The URL encoded user name of the staff user's account that should be authenticated. Take special note that the source data being URL encoded should be UTF-8 (or ASCII). If a different character set is used, authentication will fail.
pass
The MD5 checksum of the staff user's plain text password in printed hexadecimal format (e.g. '4FD8E4FD5988E970476E52AD0994EBB0')
The server will then respond with a standard SWIFT header containing either error information or the following UTF-8 encoded XML data if the authentication was successful:

<instaalert>
  <sessionid><![CDATA[%session_id%]]></sessionid>
  <version><![CDATA[%swift_version%]]></version>
</instaalert>
session_id
A unique variable representing the authenticated session. This variable is used in all further communication with the server.
swift_version
The human readable version of the server software (e.g. '3.30.02')
Now that the client application has authenticated, it can begin requesting alert data.

4. UPDATE

It is the responsibility of the client application to request alert data on an interval. The data is requested by opening a URL in the following format:

Update URL: <path>/instaalert/index.php?_m=tickets&_a=instaalert&sessionid=<sessionid>

path
The whole path to the installation directory for the help desk (e.g. http://domain.com/support or http://support.domain.com)
sessionid
The unique session variable sent in the login response from the server; used to authenticate.
The server's response will be a standard
SWIFT header containing either error information or the following UTF-8 encoded XML data:

<instaalert>
  <department>
    <title><![CDATA[%department_title%]]></title>
    <isnew><![CDATA[%department_isnew%]]></isnew>
    <link><![CDATA[%department_link%]]></link>
    <status>
      <title><![CDATA[%status_title%]]></title>
      <isnew><![CDATA[%status_isnew%]]></isnew>
      <count><![CDATA[%status_count%]]></count>
      <link><![CDATA[%status_link%]]></link>
    </status>
  </department>
  <alert>
    <title><![CDATA[%alert_title%]]></title>
    <link><![CDATA[%alert_link%]]></link>
  </alert>
</instaalert>

The first part of the response contains a hierarchical representation of the departments and statuses in the help desk which the client application can use to render a tree-like user interface for navigation. Each department can have several statuses associated with it.

The second part of the response contains the alert data.
department_title
The title of this department (e.g. 'Sales')
department_isnew
'1' if any tickets have been created or updated in this department since the last time the client application requested alert data, or '0' otherwise.
department_link
The full URL that can be used to go directly to this department in the help desk.
status_title
The title of this status (e.g. 'Escalated')
status_isnew
'1' if any tickets with this status in the parent department have been created or updated since the last time the client application requested alert data, or '0' otherwise.
status_count
The number of 'new' tickets (see status_isnew).
status_link
The full URL that can be used to view all tickets in the parent department with this status in the help desk.
alert_title
The title of the alert (e.g. 'Sales: Question about product')
alert_link
The full URL that can be used to go directly to the relevant item in the help desk.
Currently, alerts are issued only when a ticket is created or updated in any department that the authenticated staff user is assigned to.

5. LOGOUT

When the client application no longer wishes to end the session, it should open a URL in the following format:

Logout URL: <path>/instaalert/index.php?_ca=logout&sessionid=<sessionid>

path
The whole path to the installation directory for the help desk (e.g. http://domain.com/support or http://support.domain.com)
sessionid
The unique session variable sent in the login response from the server; used to authenticate.

Back to top