Custom Field Service API

Clearance Developer Guide

Content type
Guides > Developer guides
Product line
Clearance
Language
English
Applies to
Genetec Clearance

The Custom Field Service is a service that allows users to manage custom data inputs for custom fields, evidence, and single-tennant cases in Genetec Clearance™ by implementing certain templates. Depending on their type, these templates contain the custom fields that should be shown on creation and when editing either evidence or cases.

Removing a custom field from a template does not remove it from a case or evidence as long as that field contains a value. The template also contains renamed default fields, which are alternative labels for fields that are in cases and evidences by default, such as Description.

For Custom Field Service interactive documentation, see dems-proda-api.clearance.network.

Using the Custom Field service

Using a GET request to the Custom Field Service, we can see the templates for custom fields for cases and evidence associated with a tenant:

GET https://dems-dev-api.clearancedev.net/customfieldservice/api/v1/template/{tenantName}

The return looks like this:

[
  {
    "type": "Case",
    "renamedFields": [
      {
        "fieldId": "CadNumberTitle",
        "customName": "INumber"
      },
      {
        "fieldId": "RecordNumber",
        "customName": "TestRecordNumber"
      },
      {
        "fieldId": "IncidentNumber",
        "customName": "TestIncidentNumber"
      },
      {
        "fieldId": "OccurredOn",
        "customName": "Incident Start Time"
      }
    ],
    "customFields": [
      {
        "name": "Area",
        "type": "Text"
      },
      {
        "name": "casetest",
        "type": "Text"
      },
      {
        "name": "casetest2",
        "type": "Text"
      }
    ],
    "lastModifiedUtc": "2021-07-26T15:31:27.4511975+00:00",
    "lastModifiedBy": {
      "firstName": "",
      "lastName": "",
      "username": "aperson@anemail.com",
      "principalId": 6001,
      "principalType": "user",
      "kId": "https://dems-dev-keyvault.vault.azure.net:443/keys/genetecdev"
    }
  },
  {
    "type": "Evidence",
    "renamedFields": [
      {
        "fieldId": "DescriptionTitle",
        "customName": "New Description1"
      },
      {
        "fieldId": "TagsTitle",
        "customName": "Tagerinno"
      },
      {
        "fieldId": "Description",
        "customName": "EvidenceDescription"
      },
      {
        "fieldId": "StartTime",
        "customName": "Evidence Start Time"
      }
    ],
    "customFields": [
      {
        "name": "Area",
        "type": "Text"
      },
      {
        "name": "VehicleID",
        "type": "Text"
      },
      {
        "name": "Shift",
        "type": "Text"
      },
      {
        "name": "Agency",
        "type": "Text"
      }
    ],
    "lastModifiedUtc": "2021-07-26T15:32:51.6860126+00:00",
    "lastModifiedBy": {
      "firstName": "",
      "lastName": "",
      "username": "aperson@anemail.com",
      "principalId": 6001,
      "principalType": "user",
      "kId": "https://dems-dev-keyvault.vault.azure.net:443/keys/genetecdev"
    }
  }
]

To add or update a template, you can use a PUT request:

https://dems-dev-api.clearancedev.net/customfieldservice/api/v1/template/{tenantName}

The following JSON body uses either the type "Case" or "Evidence" (See the interactive documentation to see the current supported fieldIds for renaming):

{
  "type": "Case",
  "renamedFields": [
    {
      "fieldId": "string",
      "customName": "string"
    }
  ],
  "customFields": [
    {
      "name": "string",
      "type": "Text"
    }
  ],
  "lastModifiedUtc": "2021-07-26T20:15:22.482Z",
  "lastModifiedBy": {
    "firstName": "string",
    "lastName": "string",
    "username": "string",
    "principalId": 0,
    "principalType": "string",
    "kId": "string"
  }
}