Not logged in - Login
< back

API Example Create Case

API URL

https://securelb.trackerproducts.com/api/cases

Fields used in Post

  • CaseNumber [Required Unique Text]

  • OffenseDescription [Optional Text]

  • OffenseLocation [Optional Text]

  • OffenseDate [Optional DateTime]

  • Active [Required Text]
    • True or False Value

  • Tags [Required]
    • See example and leave blank

Example JSON Submit


{
       "caseOfficerId":1038,
       "offenseTypeId":1,
       "caseNumber":"20171129D",
       "offenseDescription":"Test Offense Description",
       "offenseLocation":"123 My Address New York, Ny 20012"
       "offenseDate":"2017-11-29 13:25:00.000", (24 hour time format or 12 hour time format - If no time is supplied it will default to system server time)
       "active":true,
       "formData":[],
       "tags":[],
}

Postman Header Example

Postman JSON Body Example

Creating Case With Custom Form Data


Note that the double quote must be escaped with a forward slash
A case can also be created with custom data. Note that the entityId field will be 0 for a new case (this value is the case id which the system will assign after the case is created).
Here is my json for adding a case with the custom form data:
{
"offenseDate": "2020-02-13T05:00:00.000Z",
"active": true,
"offenseDescription": "Burning Down The House",
"offenseTypeId": 2,
"formData": [
{
"formId": 1184,
"formName": "Test Form Cases",
"data": "{\"field2426\":{\"1\":true},
\"field2428\":\"2\",
\"field2430\":\"3\",
\"field2435\":\"3\",
\"field2424\":\"This is a text field\",
\"field2432\":\"2020-02-13T05:00:00.000Z\"}",
"visibilityId": 1,
"dateFields": [
"field2432"
]
}
],
"tags": [

],
"reviewDateNotes": "",
"checkInProgress": false,
"caseNumber": "2020-0213-01",
"reviewDate": "2021-02-12T19:27:04.230Z",
"caseOfficerId": 34864,
"offenseLocation": "Newport, KY, USA"
}

Possible Error Scenarios


In this section, we will look at errors returned during a case POST.

Auto Disposition Error


This error occurs when auto disposition is turned on for an organization and the case offense type in the POST does not have settings in for follow up days.
Here is an example: (infobox: POST https://{api url}/api/cases/

{
"active": true,
"offenseDescription": "test",
"offenseTypeId": 178,
"formData": [ ],
"tags": [ ],
"reviewDateNotes": "",
"checkInProgress": false,
"caseNumber": "2020-0325-02",
"reviewDate": "2047-09-26T14:08:21.372Z",
"caseOfficerId": 1,
"offenseLocation": "Newport, KY, USA"
}