Use custom fields

By updating an Evidence through the Document Service API, it is possible to add fields that are not part of the Evidence model. We will refer to these fields as Custom Fields.
After creating an Evidence, you can use a get call to the Evidence in order to get the JSON we will need to modify to edit or create custom fields (The EvidenceID can be found 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 will 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"
}