Using custom fields

Clearance Developer Guide

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

Custom fields are extra fields that are not originally part of Genetec Clearance™'s Evidence model but can be included in an Evidence item when using the Document Service API. Custm fields allow you to store specific data relevant to your case workflow.

To obtain the JSON data of a created Evidence item, you can make a GET call to the Evidence endpoint. To modify, edit, or create custom fields within JSON, you need to access the EvidenceID, which can be obtained using the Search Service API.

GET https://clearance-a-ds.geneteccloud.com/api/v1/tenant/{tenantName}/evidence/{evidenceId}/

The value returned should look like this:

{
  "AccessPolicies": [
    {
      "ExpirationDateUtc": "2021-07-26T19:49:37.527Z",
      "Permissions": "None",
      "PermissionSource": {
        "Reason": "None",
        "MergeStrategy": "None",
        "Permissions": "None"
      },
      "KId": "string",
      "Username": "string",
      "PrincipalId": "string",
      "PrincipalType": "string"
    }
  ],
  "AccessorPermissions": [
    "None"
  ],
  "AccessPoliciesGrantType": "None",
  "AssociationState": "None",
  "CategoryId": "string",
  "CreatedBy": {
    "KId": "string",
    "Username": "string",
    "PrincipalId": "string",
    "PrincipalType": "string"
  },
  "CreatedTimeUtc": "2021-07-26T19:49:37.527Z",
  "DeletedBy": {
    "KId": "string",
    "Username": "string",
    "PrincipalId": "string",
    "PrincipalType": "string"
  },
  "DeletedOnUtc": "2021-07-26T19:49:37.527Z",
  "Description": "string",
  "Device": {
    "DeviceType": "string",
    "ExternalId": "string",
    "Manufacturer": "string",
    "SerialNumber": "string",
    "Model": "string"
  },
  "EditingSessionId": "string",
  "EndTimeUtc": "2021-07-26T19:49:37.527Z",
  "EvidenceId": "string",
  "LifecycleState": "None",
  "LocationText": "string",
  "LocationWKT": "string",
  "Name": "string",
  "SourceId": "string",
  "StartTimeUtc": "2021-07-26T19:49:37.527Z",
  "State": "None",
  "Tags": [
    "string"
  ],
  "Thumbnail": "string",
  "CustomFields": {},
  "ConcurrencyId": "string"
}

We can then change the CustomFields node to add, remove, or edit the Custom Fields that appear on this Evidence.

Example:

"CustomFields": {
   "customFieldName": "value of this field",
   "customField2": "another value"
}

Then, we can use a PATCH call to the Document Store to update the Custom Fields with our new JSON as the body:

PATCH https://clearance-a-ds.geneteccloud.com/api/v1/tenant/{tenantName}/evidence/{evidenceId}/
{
  "AccessPolicies": [
    {
      "ExpirationDateUtc": "2021-07-26T19:49:37.527Z",
      "Permissions": "None",
      "PermissionSource": {
        "Reason": "None",
        "MergeStrategy": "None",
        "Permissions": "None"
      },
      "KId": "string",
      "Username": "string",
      "PrincipalId": "string",
      "PrincipalType": "string"
    }
  ],
  "AccessorPermissions": [
    "None"
  ],
  "AccessPoliciesGrantType": "None",
  "AssociationState": "None",
  "CategoryId": "string",
  "CreatedBy": {
    "KId": "string",
    "Username": "string",
    "PrincipalId": "string",
    "PrincipalType": "string"
  },
  "CreatedTimeUtc": "2021-07-26T19:49:37.527Z",
  "DeletedBy": {
    "KId": "string",
    "Username": "string",
    "PrincipalId": "string",
    "PrincipalType": "string"
  },
  "DeletedOnUtc": "2021-07-26T19:49:37.527Z",
  "Description": "string",
  "Device": {
    "DeviceType": "string",
    "ExternalId": "string",
    "Manufacturer": "string",
    "SerialNumber": "string",
    "Model": "string"
  },
  "EditingSessionId": "string",
  "EndTimeUtc": "2021-07-26T19:49:37.527Z",
  "EvidenceId": "string",
  "LifecycleState": "None",
  "LocationText": "string",
  "LocationWKT": "string",
  "Name": "string",
  "SourceId": "string",
  "StartTimeUtc": "2021-07-26T19:49:37.527Z",
  "State": "None",
  "Tags": [
    "string"
  ],
  "Thumbnail": "string",
  "CustomFields": {
    "customFieldName": "value of this field",
    "customField2": "another value"
  },
  "ConcurrencyId": "string"
}