The Tempest API


Version & Publication Date

The current version of the Tempest API is 2019.6.
This documentation was last updated on 2019-12-20.


Introduction

The Tempest API provides secure access to data stored in TIG's Tempest system. Using the API, developers can easily integrate Tempest with help desk and ticketing systems, dashboards, and more.

The Tempest API is an RPC-style API that uses JSON-encoded requests and responses. To send a request to the Tempest API, developers send an HTTP POST request and specify the details of the request in a JSON-encoded payload.

For example, suppose that you want to retrieve a specific unit, based on the unit's Asset Number, from the "Tempest Standard" instance of Tempest. You would send an HTTP POST request to...

https://api.tempest.tig.com/

The payload would look something like this:

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Units-Select",
  "Filters": {
    "Asset_Number": "USH281847"
  }
}

Notice that the request includes your API Key, the instance name ("Database") that you'd like the request to be made against, and the name of the function that you'd like to perform (in this case, "Units-Select"). Also notice that the Filters parameter is an array, and the only filter that is to be applied is against the Asset_Number column.

The API will return a JSON-encoded response, like this:

{
  "records": [
    {
      "Unit_ID": 75893,
      "DateTime_Created": {
        "date": "2009-11-20 11:40:43.477000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
      },
      "DateTime_Modified": {
        "date": "2018-05-04 13:29:28.710000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
      },
      "DateTime_Current": {
        "date": "2019-06-03 11:19:52.887000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
      },
      "Created_By_User_ID": 1001,
      "Created_By_Username": "tempest",
      "Created_By_First_Name": "Tempest",
      "Created_By_Last_Name": "Administrator",
      "Modified_By_User_ID": 1233,
      "Modified_By_Username": "khayes",
      "Modified_By_First_Name": "Tim",
      "Modified_By_Last_Name": "Hayes",
      "Serial_Number": "H9YEN3G1",
      "Asset_Number": "USH281847",
      "User_ID": null,
      "user_location": "Technology",
      "user_location_id": 1027,
      "user_location_type": "Other",
      "User_Number": "017-999999",
      "User_Type": "Spares",
      "user_name": "Spares Pool",
      "Model_Number": "D630",
      "Ticket_Count": 0,
      "Open_Ticket_ID": 0,
      "Last_Ticket_ID": 0,
      "Summer_Refresh_Unit_ID": null,
      "DateTime_OOW": {
        "date": "2012-04-20 23:59:59.000000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
      },
      "Unit_Is_OOW": "T",
      "days_unit_oow": -2600,
      "DateTime_Collection_Received": null,
      "Collection_Repair_Needed": null,
      "Collection_Repair_Ticket_ID": null,
      "Collection_Receiving_Comments": null,
      "DateTime_Collection_Imaging_Completed": null,
      "Box_Number": null,
      "Slot_Number": null,
      "Student_Grade": null,
      "Collection_DateTime_DropOff": null,
      "Collection_DropOff_Parts_Returned": null,
      "Collection_DropOff_Comments": null,
      "collection_adapter_serial_number": null,
      "collection_summer_school": null,
      "collection_special_program": null,
      "last_year_assigned": "2012",
      "unit_type": "LAPTOP",
      "status": "ACTIVE",
      "status_detail": null,
      "manufacturer": "Dell",
      "so_number": null,
      "po_number": null,
      "base_location_id": 1083,
      "unit_leased": "Yes",
      "base_location_name": "Smith Elementary School",
      "base_location_type": "Elementary",
      "assignee_id": 417301,
      "assignment_status": "Available",
      "DISTRIBUTION_DATETIME_RECEIVED": {
        "date": "2018-05-04 13:29:28.000000",
        "timezone_type": 3,
        "timezone": "America/Los_Angeles"
      },
      "assignee_username": null,
      "assignee_active": "Y"
    }
  ]
}

The example API requests that are included in this documentation are intended to demonstrate the format and parameters of the various functions that the API supports. Examples show the request, including any HTTP headers that should be sent, and the request itself as a JSON-encoded request body.


Authentication & Permissions

All requests sent to the Tempest API are authenticated using an API key, which is passed using the "API_Key" parameter in the request body. To obtain a Tempest API key, please contact your TIG point of contact.

Each Tempest API account is configured with unique permissions, giving it access to one or more Tempest instances, as well as specific API functions within each instance. For details on the Tempest instances and API functions that your Tempest API account has been granted access to, please see the "API Account Get" function below.


Retrieving Data

Many of the Tempest API functions are designed for retrieving data. For example, "Units-Select" can be used to select one or more units, "Tickets-Select" can be used to retrieve tickets, and so on.

These functions often support several common request parameters. For example, you can specify Filters to return records that meet your specific criteria. You can use the Fetch parameter to limit the number of records that are returned. And you can use an Offset parameter to paginate records.

You can also specify the columns that you'd like to receive in the API's response. To do so, use the Columns parameter, and specify a coma-delimited list of the column names.

Additionally, you can specify the order in which you'd like the records returned. To do so, use the Sort parameter, specify a coma-delimited list of the column names to sort on, and use ASC or DESC to specify whether a column should be sorted in ascending or descending order.


Inserting & Updating Records

Several Tempest API functions are designed for inserting or updating data. For example, "Units-Insert" can be used to add a new unit, "Tickets-Insert" can be used to add a ticket, and so on. The response to these types of request will be the new or updated record. The response for requests that add records will include the ID that Tempest has assigned to the record.

Where functions that retrieve data use a Columns parameter for filtering purposes, the functions that insert and modify data use a similar "Values" parameter. This is an array of column name / value pairs.


Preprocessing

The Tempest API supports "preprocessing" of API requests. This powerful feature makes it possible to route requests to an intermediate API where they can be evaluated and/or manipulated prior to actually being processed by the Tempest API itself.

For example, you might choose to use this feature to map values from an external system to those supported by Tempest. Or you might use the preprocessor to sync data between an external system and Tempest prior to inserting a unit or ticket. The possibilities are endless.

To use the preprocessing function, you simply pass the URL of the preprocessor via the "Preprocessor" parameter. For example:

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Units-Insert",
  "Preprocessor": "http://test.com/tempest-api-preprocessor/",
  "Database": "tempest_standard",
  "Function": "Tickets-Insert",
  "Values": {
    "Ext_Ticket_Number": "EXT-12313",
    "Serial_Number": "USH281847"
  }
}

When a Preprocessor is specified, Tempest will send the original JSON-encoded request payload to the Preprocessor via an HTTP POST operation. Additionally, the IP address of the original requestor will be sent via an "X-Forwarded-For" header.

The preprocessor should return a similarly structured payload. It is this payload that the Tempest API will use to process the request.


Postprocessing

The Tempest API also supports "postprocessing" of API requests. This feature makes it possible to route the results of an API request to an external API for additional processing.

For example, you might choose to use this feature to sync data between Tempest and an external system, to send email and text notifications when certain types of events occur, and so on.

To use the postprocessing function, you simply pass the URL of the postprocessor via the "Postprocessor" parameter. For example:

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Units-Insert",
  "Preprocessor": "http://test.com/tempest-api-preprocessor/",
  "Postprocessor": "http://test.com/tempest-api-postprocessor/",
  "Database": "tempest_standard",
  "Function": "Tickets-Insert",
  "Values": {
    "Ext_Ticket_Number": "EXT-12313",
    "Serial_Number": "USH281847"
  }
}

When a Postprocessor is specified, Tempest will send a JSON-encoded payload to the postprocessor via an HTTP POST operation. That payload will include the JSON-encoded request payload that was processed as well as the JSON-encoded response that the API generated.


API Account Get

Each Tempest API account is configured with unique permissions, giving it access to one or more Tempest instances, as well as specific API functions within each instance. The API-Account-Get function can be used to get information about the Tempest instances that your account has access to, and the specific functions that have been granted for each instance.

Here's an example of an API-Account-Get API request.

{
  "API_Key": "*** Your API KEY ***",
  "Function": "API-Account-Get"
}

Here's a sample response.

{
  "comment": "Demo account for SNOW integration.",
  "databases": [
    {
      "name": "tempest_pro_demo",
      "functions": [
        "Tickets-Insert",
        "Tickets-Select",
        "Units-Select"
      ]
    }
  ]
}

In this example, the account has access to a single Tempest instance (named "tempest_pro_demo"), and for that instance, the account can send requests that utilize three functions: Tickets-Insert, Tickets-Select, and Units-Select.


Assignees Select

Assignees are the users (staff, students, etc) that units can be assigned to. The Assignees-Select function can be used to retrieve one of more assignees, and do so using a variety of filters (last name, first name, and so on).

Here's an example of an Assignees-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Assignees-Select",
  "Filters": {
    "is_active": "Y",
    "is_system": "Y",
    "assignee_type": "Student",
    "last_name": "Aaron",
    "grade": "5",
    "username": "demo-aaron",
    "assignee_id": "130487",
    "middle_name": "al",
    "homeroom": "106",
    "first_name": "Test"
  },
  "Offset": 2,
  "Fetch": 50,
  "Columns": "assignee_id, first_name, last_name, grade, homeroom, is_active",
  "Sort": "last_name, first_name, assignee_id"
}

Here's a sample response.

{
  "comment": "Demo account for SNOW integration.",
  "databases": [
    {
      "name": "tempest_pro_demo",
      "functions": [
        "Tickets-Insert",
        "Tickets-Select",
        "Units-Select"
      ]
    }
  ]
}

In this example, the account has access to a single Tempest instance (named "tempest_pro_demo"), and for that instance, the account can send requests that utilize three functions: Tickets-Insert, Tickets-Select, and Units-Select.


Claims Select

Claims are used to receive compensation from manufacturers for repairs that have been made to units. The Claims-Select function can be used to retrieve one of more claims, and do so using filters such as the date that the claim was submitted, payment status, etc.

Here's an example of a Claims-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Claims-Select",
  "Filters": {
    "DateTime_Diagnosed_Max": "2019-05-20 23:59:59",
    "DateTime_Paid_Min": "2019-05-01 00:00:00",
    "DateTime_Diagnosed_Min": "2019-05-20 00:00:00",
    "DateTime_Reimb_Requested_Max": "2019-03-30 23:59:59",
    "DateTime_Paid_Max": "2019-05-07 23:59:59",
    "Claim_ID": "738350",
    "DateTime_Claim_Entered_Min": "2019-05-01 00:00:00",
    "DateTime_Claim_Entered_Max": "2019-05-01 23:59:59",
    "Check_Number": "1000885044",
    "DateTime_Reimb_Requested_Min": "2019-03-01 00:00:00",
    "Payment_Status": "Unpaid"
  },
  "Offset": 2,
  "Fetch": 100,
  "Columns": "Claim_ID, DateTime_Paid, Ticket_ID, Status, Payment_Status",
  "Sort": "Claim_ID DESC"
}

Claim Lineitems Select

Claim Lineitems are the specific parts or services that were submitted with a claim.

Here's an example of a Claim-Lineitems-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Claim-Lineitems-Select",
  "Filters": {
    "Dispatch_Number": "111261464",
    "DateTime_Part_Received_Max": "2019-05-03",
    "Inbound_Tracking_Number": "",
    "TIG_Reference_Number": "11193",
    "Claim_Lineitem_ID": "812058",
    "Request_Number": "12591609",
    "Part_ID": "1023",
    "DateTime_Part_Received_Min": "2019-05-03",
    "Dell_Order_Number": "5952522339",
    "Claim_ID": "738350",
    "External_Part_Code": "LCC",
    "DateTime_Part_Ordered_Number_Min": "2019-05-15",
    "Outbound_Tracking_Number": "",
    "DateTime_Part_Ordered_Number_Max": "2019-05-20"
  },
  "Offset": 2,
  "Fetch": 1000,
  "Columns": "Claim_ID, DateTime_Paid, Ticket_ID, Status, Payment_Status",
  "Sort": "Claim_ID DESC"
}

Databases Select

The Databases-Select function can be used to retrieve a list of the Tempest database instances that are available.

Here's an example of a Databases-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Databases-Select",
  "Fetch": 1000
}

Events Insert

Tempest's Events table is used for logging purposes. Most events are associated with an entity (a table) and an instance of that entity (a record in that table). The Events-Insert function can be used to log an event.

Here's an example of an Events-Insert API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Events-Insert",
  "Values": {
    "Trans_Reference_Entity": "Units",
    "Notes": "This is a test.",
    "Created_By_User_ID": "1001",
    "Event_Code": "0",
    "Trans_Reference_Number": "753893",
    "Event_Type": "API Test"
  }
}

Funding Sources Select

Some instances of Tempest support the concept of Funding Sources. The Funding-Sources-Select function can be used to obtain a list of the funding sources that are on file.

Here's an example of a Funding-Sources-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Funding-Sources-Select"
}

Locations Select

Tempest uses a Locations table to keep track of where users and units are located. The Locations-Select function can be used to obtain a list of the locations that are on file.

Here's an example of a Locations-Select API request, which will returns data for all of the locations in the Tempest instance.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Locations-Select"
}

In this example, a Locations-Select API request is being sent to get data for a specific location (based on its Location_ID, Tempest's internally assigned, unique identifier for the location).

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Locations-Select",
  "Filters": {
    "Location_ID": "1022"
  }
}

Parts Select

Tempest uses a Parts table to keep track of the spare parts that are used to repair units. The Parts-Select function can be used to obtain a list of the parts that are on file.

Here's an example of a Parts-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Parts-Select"
}

Property Select

Tempest uses a generic Property table to manage detailed settings and configuration for its instances. The Property-Select function can be used to obtain a list of the properties and their values.

Here's an example of a Property-Select API request. In this example, the request is for property values associated with a specific district (indicated by the Table_Name and Table_UID filters) - and specifically the values associated with Tempest's Unit Configuration functions (indicated by the Context filter). Additionally, the request is being made for specific columns (property.Name, property."Values", dbo.property.default_value, dbo.property_value.value), indicated by the Columns parameter.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Property-Select",
  "Columns": "property.Name, property.\"Values\", dbo.property.default_value, dbo.property_value.value",
  "Sort": "property.Name",
  "Filters": {
    "Table_Name": "DISTRICTS",
    "Table_UID": "1000",
    "Context": "Unit Configuration"
  }
}

Tickets Select

Tempest stores service requests in a Tickets table, and the Tickets-Select function can be used to obtain detailed information on one or more tickets. You can filter the tickets by status, location, and so on. You can also request a specific ticket based on the Tempest Ticket_ID or by an external ticket number ("Ext_Ticket_Number").

Here's an example of a call to Tickets-Select API function, requesting all open tickets.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Tickets-Select",
  "Filters": {
    "Ticket_Status": "Open"
  }
}

Tickets Insert

To add a new ticket to Tempest, use the Tickets-Insert function. Note that you can specify an alternate ticket ID so that you map tickets generated in an external system with those in Tempest. Do so by specifying an "Ext_Ticket_Number" value.

How you call the Tickets-Insert function will depend on the type of Tempest instance that you are working with. There are currently two Tempest instance types: Pro and Education. The Pro instance type is primarily designed to handle the servicing of devices for commercial clients, while the Education type handles educational clients. The primary difference between the two instance types is that with Education instances, the devices and users assigned to them is usually known ahead of time and is tracked in Tempest. With Pro instances, the devices and users are not always known. As a result, the used to call the Tickets-Insert function can vary significantly.

Here's an example of a Tickets-Insert API request being sent to a Pro instance of Tempest.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Tickets-Insert",
  "Values": {
    "Address_Line_1": "200 Main Street",
    "Address_Line_2": "Suite 1B",
    "Base_Location_ID": "1010",
    "City": "Richmond",
    "Created_By_User_ID": "1002",
    "Damage_Cause": "Unknown",
    "Damage_Type": "Accidental",
    "Email_Address": "johndoe@test.com",
    "Ext_Ticket_Number": "EXT-1437",
    "First_Name": "John",
    "Last_Name": "Doe",
    "Manufacturer": "Lenovo",
    "Middle_Name": "William",
    "Model_Number": "ABC-100",
    "Phone_Number": "804-555-1212",
    "Problems_Reported": "Unit will not power on.",
    "Serial_Number": "TEST1120",
    "State": "VA",
    "Submitter_Comments": "Issue started after latest OS update.",
    "Ticket_Type": "Dispatch",
    "Unit_ID": "94825",
    "Unit_Type": "Desktop",
    "Username": "test1120",
    "Zip": "23112"
  }
}

Here's an example of a Tickets-Insert API request being sent to an Education instance of Tempest. Note that the API supports an optional "Ext_Ticket_Number_Friendly" parameter for requests made against a Tempest Education instance.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Tickets-Insert",
  "Values": {
    "Damage_Type": "Accidental",
    "Ext_Ticket_Number": "94003c01-d2ba-4d20-b451-370948b82376",
    "Ext_Ticket_Number_Friendly": "Test-1606D",
    "Location_ID": "1009",
    "Serial_Number": "TESTUNIT",
    "Ticket_Type": "Dispatch",
    "Unit_Type": "Desktop"
  }
}

If the call to the Tickets-Insert function is successful, the API will return either a "200 OK" response or a "202 Accepted" response. A "200" response indicates that a ticket has been created. A "202" response indicates that the request has been received and is pending review before being fully processed.


Units Select

In Tempest, Units are the devices that are to be managed, assigned to users, repaired, and so on. The Units-Select function can be used to obtain detailed information on one or more units. You can filter the units by status, model number, location, and so on. You can also request a specific unit based on the Tempest Unit_ID, by its serial number, asset tag, and so on.

Here's an example of a Units-Select API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Units-Select",
  "Filters": {
    "Asset_Number": "TEST1120"
  }
}

Units Insert

To add a new unit to Tempest, use the Units-Insert function.

Here's an example of a Units-Insert API request.

{
  "API_Key": "*** Your API KEY ***",
  "Database": "tempest_standard",
  "Function": "Units-Insert",
  "Values": {
    "Serial_Number": "TEST-SERIAL-1",
    "Asset_Number": "TEST-ASSET-1",
    "Unit_Type": "TEST-TYPE",
    "Manufacturer": "Dell",
    "Model_Number": "TEST-MODEL-NUMBER",
    "DateTime_OOW": "2019-12-31 00:00:00",
    "Base_Location_ID": "1009",
    "PO_Number": "TEST-PO-01",
    "SO_Number": "TEST-SO-01",
    "funding_source": "TEST-SOURCE-1",
    "Box_Number": "1",
    "Slot_Number": "1",
    "Unit_Leased": "No",
    "Assignee_ID": "133092",
    "User_ID": "test-user-id"
  }
}

Technical Support

If you need technical support for the Tempest API, please contact:

Tim Dietrich
timdietrich@me.com

© Technology Integration Group.