Not logged in - Login
< back

API Overview

SAFE Integration with CAD / RMS type system

Where do I start?

In most casescases, an integration between aan RMS type system (3rd party system) and SAFE is a one-way connection where data is being retrieved from SAFE via a WebAPI and recorded into the RMS. This is done in such as way so that the RMS can find any ‘new records’ that exist in SAFE and also update any existing records if desired. While this is not always the case, this is the most straight forwardstraightforward and safe setup.

Why not push data into SAFE from a RMS / 3rd Party System?

So why can’t I just collect data in the RMS system and have it populate in SAFE? You could do that. SAFE does have aan API you could use to create data in SAFE. However, the reason that this is the far less desired path is that most RMS systems do not collect the detail of information on a piece of evidence that SAFE does. So if the RMS is only collecting five pieces of data per item and SAFE requires eight, then how do those three other piecepieces of data get applied. It is FAR easier to draw back the five needed fields for the RMS than to try and push three more piecepieces of data. And what happens if next year it becomes nine.

So how does it work (essentially)

If you go the route of drawing data from SAFE into the 3rd party system you will follow these steps.

  1. Someone (typically the RMS vendor) will have a programmer write code to hit the SAFE web api and draw the necessary data back the 3rd party system on a timely basis.
  2. The SAFE system has a API endpoint that will allow the developer to poll all items in the system based on a unique and ascending OrgID number (sequentialCaseID, row 2 in example below). Every new item entered into the Organization will obtain a unique and ascending number. This example happens to be the 13th item entered into this system.
  3. If the response includes valid item data (as seen in the pic above), the developer will take any amount of the response desired and write that data to the RMS system. After writing the data from this valid response you will immediately post another request with the next ascending ID number. You will continue this process until you get a blank or no response.
  4. Once you get a blank or no response, you will not try the process for another X hours or days. Once you start the process again you will start with the last ‘no response’ ID number and continue until you get a no response again.
  5. This process will be repeated for every request made to the system.

Setting a Static Token for use with Tracker API

Each request made to the SAFE webAPI will require the following

  1. Valid URL (https://securelb.trackerproducts.com/api/items/seqOrgID/1) [The 1 in this line is the sequentialOrgID you are referencing)
  2. Valid user token (See instructions below for getting this)
  3. Valid OrgID # (See instructions below for getting this)
  4. Valid Office ID # (See instructions below for getting this)

Getting a valid User Token

  1. Go to Settings -> Users
  2. Select a user in which to create a static token for, and select ‘Edit’ (Or you may want to create a new user for this process)
  3. At the bottom of the edit screen will be the token create section:
  4. Press ‘Generate’ to create the token.
  5. NOTE: If you created a token for the currently logged in user, then you must logout before using the token.

Setting a Static License In most casescases, 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.

To set a license follow these steps…

  1. Go to Settings > License Allocation
  2. 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.

Warning Making aan API call to the database more than once a minute will most likely cause your account to be disabled. It hisis highly recommended that you make (or schedule) your call every 10 minutes or so.

Testing the Tracker API

  1. The user can test communicating to the Tracker API using Postman in Chrome, or any similar tool. The following example is using Postman:
  2. Header Fields:Fields
    1. Accept application/json – required field
    2. Content-Type application/x-www-form-urlencoded – required field
    3. Authorization – This field requires the word ‘Bearer’ followed by a single space and then the static token that was created.
    4. OrganizationId – the organization ID to use
    5. OfficeId – the office ID to use
    6. StaticToken – tells the API that the bearer token is static
  3. Once these fields are in place, select ‘Send’ and verify that an item was returned (if one exists).

Note: make sure you have a valid item in the system before you try to select one from the webAPI.

Retrieving Data from API

Retrieving Custom Data – Formdata Controller

API URL = https://securelb.trackerproducts.com/api/items/XXXXX/formdata

Where XXXXX = the "id" value that is provided in the seqOrgID controller listed above

This Formdata controller will come back with every custom data form and field that is attached to this item. { "id": "5750570d1b5c6008e8e4fcec", "active": true, "entityId": 994601, "formId": 1, "formName": "Drug Form (SysSys Template)",Template", "dateFields": null, "data": "{ \"field2849\" : \"1\", \"field7312\" : \"1\", \"field5100\" : true, \"field7289\" : true, \"field6199\" : 1, \"field5088\" : 2, \"field5091\" : 3, \"field5094\" : 4, \"field5097\" : 5, \"field5970\" : 6 }", "organizationId": 1, "officeId": 1, "visibilityId": 1 } ]


The data you are looking for is in the “Data” section.

Retrieving Case Data


Where XXXXX = the "PrimaryCaseID" value that is provided in the seqOrgID controller listed above

Retrieving People in a Case

API URL = https://securelb.trackerproducts.com/api/cases/XXXXX/peopleList/

Where XXXXX = the "PrimaryCaseID" value that is provided in the seqOrgID controller listed above

Retrieving People in a Case

API URL = https://securelb.trackerproducts.com/api/cases/XXXXX/peopleList/

Where XXXXX = the "PrimaryCaseID" value that is provided in the seqOrgID controller listed above


Retrieving Chain of Custody

API URL = https://securelb.trackerproducts.com/api/items/XXXXX/coc

Where XXXXX = the "id" value that is provided in the seqOrgID controller listed above


Writing Data to API (Posting)

Case Data Post

API URL = https://securelb.trackerproducts.com/api/cases

Required fields:

  • CaseOfficerId (long)[long]
  • OffenseTypeId (long)[long]
  • CaseNumber (string)[string]
  • FormData (List) [List]
  • FormId (long)[long]
  • Data (string)[string]
  • Tags (List)[List]
  • tagModelId (long)[long]
  • Name (string)[string]

Optional:

  • OffenseDescription (string)[string]
  • OffenseLocation (string)[string]
  • OffenseDate

This is a test of the Case Post

Person Data Post

API URL - https://securelb.trackerproducts.com/api/people

Required fields:

  • RaceId (long)[long]
  • GenderId (long)[long]
  • FirstName (string)[string]
  • LastName (string)[string]

Optional:

  • MiddleName (string)[string]
  • Alias (string)[string]
  • MobilePhone (string)[string]
  • OtherPhone (string)[string]
  • Email (string)[string]
  • DriverLicense (string)[string]
  • Dob (date)[date]
    • FormData (List)[List]
    • FormId (long)[long]
    • Data (string)[string]