Not logged in - Login

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 [Boolean]
    • 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 organization does not have auto disposition settings for all offense types.
Here is an example:
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"
}
Above, I am attemping to POST a case with an offense type of Bomb Threat
The return message from the request looks like this:
{
"autoDispoErrors": [
"Auto Disposition Settings are not found for Bomb Threat"
]
}


This message is the result of missing auto disposition settings for the offense type, Bomb Threat.


To resolve, first get the auto disposition settings for the organization.

GET https://{api url}/api/autoDisposition/settings/

{
"isAutoDispositionOn": true,
"officeAutoDispositionReviewers": [
{
"officeId": 1,
"officeName": "1 Office, LLC",
"generalTaskFromUserId": 1,
"generalTaskFromUserGroupId": null,
\ "isDefault": true,
"isGeneralTaskFromUser": true
},
{
"officeId": 175,
"officeName": "175 Office",
"generalTaskFromUserId": null,
"generalTaskFromUserGroupId": 76,
"isDefault": false,
"isGeneralTaskFromUser": false
}
],
"settings": [
{
"id": 1,
"active": true,
"daysToFollowUp": 1000,
"organizationId": 1,
"organization": null,
"offenseTypeId": 1,
"offenseType": {
"organizationOffenseTypeFollowUpDays": null,
"id": 1,
"name": "Other",
"active": true,
"offenseTypeForms": null,
"organizations": [],
"autoDispositionSettings": [],
"customDropdownCategoryId": 1,
"customDropdownCategory": null
}
},
{
"id": 2,
"active": true,
"daysToFollowUp": 1000,
"organizationId": 1,
"organization": null,
"offenseTypeId": 2,
"offenseType": {
"organizationOffenseTypeFollowUpDays": null,
"id": 2,
"name": "Arson",
"active": true,
"offenseTypeForms": null,
"organizations": [],
"autoDispositionSettings": [],
"customDropdownCategoryId": 1,
"customDropdownCategory": null
}
},
{
"id": 3,
"active": true,
"daysToFollowUp": 1000,
"organizationId": 1,
"organization": null,
"offenseTypeId": 3,
"offenseType": {
"organizationOffenseTypeFollowUpDays": null,
"id": 3,
"name": "Assault",
"active": true,
"offenseTypeForms": null,
"organizations": [],
"autoDispositionSettings": [],
"customDropdownCategoryId": 1,
"customDropdownCategory": null
}
},
{
"id": 0,
"active": false,
"daysToFollowUp": 0,
"organizationId": 0,
"organization": null,
"offenseTypeId": 178,
"offenseType": {
"organizationOffenseTypeFollowUpDays": null,
"id": 178,
"name": "Bomb Threat",
"active": true,
"offenseTypeForms": null,
"organizations": [],
"autoDispositionSettings": [],
"customDropdownCategoryId": 1,
"customDropdownCategory": null
}
}
,


The response is rather long - I have abbreviated to include the pertinent information. Note that for offense type Bomb Threat id is 0, days to follow up is 0, organizationId is 0. We need to add settings for this offense type.
To accomplish this, the api user token must belong to a user with orgAdmin permissions.

PUT https://{api url}/api/autoDisposition/settings/
{
"isAutoDispositionOn": true,
"officeAutoDispositionReviewers": [
{
"officeId": 1,
"officeName": "1 Office, LLC",
"generalTaskFromUserId": 1,
"generalTaskFromUserGroupId": null,
\ "isDefault": true,
"isGeneralTaskFromUser": true
},
{
"officeId": 175,
"officeName": "175 Office",
"generalTaskFromUserId": null,
"generalTaskFromUserGroupId": 76,
"isDefault": false,
"isGeneralTaskFromUser": false
}
], "settings": [
{
"id": 0,
"active": false,
"daysToFollowUp": 100,
"organizationId": 1,
"organization": null,
"offenseTypeId": 178,
"offenseType": {
"organizationOffenseTypeFollowUpDays": null,
"id": 178,
"name": "Bomb Threat",
"active": true,
"offenseTypeForms": null,
"organizations": [],
"autoDispositionSettings": [],
"customDropdownCategoryId": 1,
"customDropdownCategory": null
}
}

],
"listPermissionGroupIds": [
1,68,69,1387,1388, 1389
],
"createPermissionGroupIds": [
1,68,69,1387,1389
],
"updatePermissionGroupIds": [
43,68,69,1387,1389
]
}


Some Notes:

  • The above PUT does not need to have all of the offense types returned in the GET request - just the offense types which have no settings.
  • Note that the above error will continue to be returned until all of the organization offense types have a valid auto disposition setting.
  • The PUT must include the arrays of permission groups - "listPermissionGroupIds", "createPermissionGroupIds", "updatePermissionGroupIds"
    These permissions can be found here:
    GET https://{api url}/api/autoDisposition/{accesssType}/groups/


    There are 3 access types which you will provide in the above request:
  • List - value of 1
  • Create - value of 4
  • Update - value of 3
    Here is my complete request:
    GET https://{api url}/api/autoDisposition/1/groups/


    This returns an array:
    [
    {
    "id": 1,
    "text": "Not used Admin"
    },
    {
    "id": 68,
    "text": "Power User"
    },
    {
    "id": 69,
    "text": "Basic User"
    },
    {
    "id": 1387,
    "text": "Has CLP Access"
    },
    {
    "id": 1388,
    "text": "Has NO CLP Access"
    },
    {
    "id": 1389,
    "text": "Has CLP No Create Transactions"
    }
    ]
    The ids in the above array are what you will use to populate "listPermissionGroupIds", "createPermissionGroupIds", "updatePermissionGroupIds" when updating auto disposition settings.