API Overview
General Purpose of the Safe API
Tracker clients will generally use the API for the following tasks.
- POST or GET System User Accounts (User Admin)
- POST or GET Case Information
- POST or GET Person Information
- POST or GET New Item(s) Information
- GET Updated Items Information
- GET Chain of Custody Information for Items
Requirements for each API request
Each request made to the SAFE webAPI will require the following
- Valid URL (from list of available URLs below)
- User Token (from a Org Admin user)
- Valid OrgID # (See instructions below for getting this)
- Valid Office ID # (See instructions below for getting this)
Getting a valid User Token
- Go to Settings -> Users
- Select a (Org Admin) user in which to create a static token for, and select ‘Edit’ (Or you may want to create a new user for this process)
- At the bottom of the edit screen will be the token create section:
- Press ‘Generate’ to create the token.
Setting a Static License
In most cases, you are going to want to peg a license to the user that was created in the previous step. This will ensure that a license is available when the interface makes a call to the SAFE webAPI. If not license is available, then the API will respond with a message that no licenses are available.- Go to Settings > License Allocation
- In the column ‘Reserved for Individual Users’ find the user you created for the API and then select the ‘No’ value to set a license.
What is your Org / Office ID
From within the SAFE interface, go to Settings > Offices to see your Org and Office ID.How often should you POST or GET
Making an API call to the database more than once a minute may cause your account to be disabled. It is highly recommended that you make (or schedule) your call every 10 minutes or so. Please contact Tracker support if you need to POST or GET more often.Testing the Tracker API
- Use Postman in Chrome (or any similar tool). The following example is using Postman:
- Header Fields
- Accept application/json – required field
- Content-Type application/x-www-form-urlencoded – required field
- Authorization – This field requires the word ‘Bearer’ followed by a single space and then the static token that was created.
- OrganizationId – the organization ID to use (Found in Settings > Offices)
- OfficeId – the office ID to use (Found in Settings > Offices)
- StaticToken – tells the API that the bearer token is static
- Once these fields are in place, select ‘Send’ and verify that an item was returned (if one exists).
POST or GET from APIUSERS
POST & GET User Administration
Used for creating a User in User Administration and also retrieving User infoImportant: Users are required to be unique across the entire system. If a duplicate email is found it will notify you in the response.
User Typeahead Search
Used to search for users in the systemWhere searchValue is the text you wish to search
ITEMS
Item POST (Create new item)
Used to post a single item to the system. Multiple item entries will simply loop this process.Case GET (Retrieve a Specific Case)
Where X = Case number entered into the system by the user.
Item GET (Retrieve a Specific Item)
Used to return all results of a specific (single) item.Where {id} = Item ID found in Get Case area or other API searches.
Item(s) GET (Retrieve All Items In a Specific Case)
Used to return all results of a specific (single) item.Where {id} = Case ID found in GET Case API above.
GET Item Chain of Custody
Returns chain of custody for a specific item.Where X = the "id" value of the item which is provided in the SeqUpdateOrgID
Important: Do NOT use any nested ID's, use the root level ID.
CASES
Case GET (Retrieve a Specific Case)
Used to return all results of a specific (single) case.Where X = Case number entered into the system by the user.
Case POST (Create)
Used for posting a new Case record to the system.See Info Page for all necessary info to submit to this endpoint.
Case PUT (Edit existing case)
Used for posting a updated Case record to the system.See Info Page for all necessary info to submit to this endpoint.
Custom Form Data
PEOPLE
Searching custom form data.
Person POST (Create)
Used for posting new Person, Address and/or Entry to a Case.See Info Page for all necessary info to submit to this endpoint.
Person PUT(Update existing Person)
Used for updating an existing person entry.Where X = ID of Person
See Info Page for all necessary info to submit to this endpoint.
POST Existing Person to Existing Case
Used for posting an existing Person to an existing Case.See Info Page for all necessary info to submit to this endpoint.
People GET (Retrieve all People In a Specific Case)
Used to get a list of all Persons tied to a specific case.Where X = the "PrimaryCaseID"
FYI - The API for Retrieving Specific Case Data will be need to also be used so that you can get the PrimaryCaseID to enter into this URL.
People Typeahead Search
Used to search for people in the systemWhere searchValue is the text you wish to search
People Merge
Used to merge person records in the systemGET CSV list of all Persons in Org
GETCUSTOM Chain of Custody
Where
XCustom =Form theData "id"
Important:person, Door NOTitem], useand anycan nestedalso ID's,be useadded thewhile rootcreating levelan ID.
entity. See Example Usage