Legacy API Documentation
Reference for the deprecated legacy Incident Tracker API: authenticate with your API key, use the bearer token, and query, view or search incidents.
On this page
This guide outlines how to connect to and use the legacy version of the Incident Tracker API. It includes instructions for authenticating, viewing data, querying by parameters, and searching using Postman.
Before You Begin#
Legacy API access is available to customers with an API key. If you don't have a legacy API key, contact your Incident Tracker representative.
Authentication#
Endpoint#
POST https://itapi.incident-tracker.com/api/v1/token
Instructions#
- In Postman, click New Request.
- Set the method to POST.
- Paste the URL above into the request field.
- Select the Body tab.
- Choose raw, then JSON from the dropdown.
- Enter your API key as follows:
{
"apikey": "abc123-xxxx-xxxx-xxxx-abcd1234xxxx"
}
- Click Send.
Expected Response#
You will receive a long token string under the token property.
Using the Token#
To use the token:
- Copy the token value from the response (excluding quotes).
- Create a new GET request in Postman.
- Go to the Authorization tab.
- Change the Type to Bearer Token.
- Paste the token in the Token field.
Routes Overview#
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/incident |
Return a paginated list of incidents |
| GET | /api/v1/incident/{id} |
Return a single incident by ID |
| GET | /api/v1/incident/total |
Return the total number of incidents |
| POST | /api/v1/incident/search |
Search for incidents based on field values |
Query string is supported on GET endpoints.
Query Parameters#
Add these as query strings in your GET request:
pagesizeβ default 20, max 100pagesetβ default 1sortβrecentoroldest(default: oldest)
Example Request:#
GET https://itapi.incident-tracker.com/api/v1/incident/?pagesize=50&pageset=1&sort=recent
View a Single Incident#
To retrieve a specific incident:
GET https://itapi.incident-tracker.com/api/v1/incident/{incident_id}
Replace {incident_id} with the ID you want to retrieve.
Example JSON Response:#
{
"incident_id": 14,
"reported_by_name": "John Doe",
"date_of_report": "2015-01-21T00:00:00",
"date_of_incident": "2015-01-21T00:00:00",
"location_name": "Building 1",
"sublocation_name": "First Floor",
"room_name": "Room 105",
"description": "Lorem Ipsum is simply dummy text...",
"status_name": "Closed",
"assigned_to_name": "un-assigned",
"categories": [
{
"category": "Accident",
"subcategories": ["First-aid"]
}
],
"notes": [
{
"note_author_name": "Jane Doe",
"note": "Test notes go here"
}
]
}
Searching for Incidents#
Send a POST request to:
POST https://itapi.incident-tracker.com/api/v1/incident/search
Sample Search Body:#
{
"culture": "en-us",
"date_of_report_start": "01/01/2023",
"date_of_report_end": "12/31/2023",
"location_name": "Building 1",
"status_name": "Open"
}
Operator Fields (used for duration and attachments):#
Use these values in the duration_operator and attached_file_count_operator fields of the search body.
| Operator Name | Value |
|---|---|
| equal | 0 |
| less_than | 1 |
| greater_than | 2 |
| less_than_or_equal | 3 |
| greater_than_or_equal | 4 |