Evidence group operations



Introduction

Once you have created a "Case File", you can start creating "Evidence Groups".


Operations

Create an "Evidence Group"

The second thing you should do before creating evidence is to create a group of evidence associated with a "Case File":

HTTP Request

POST /api/v1/private/case-files/{caseFileId}/evidence-groups

In this request, there is one primary resource case-files. There are also 1 resource identifier that you need to replace with real values of your Legal App platform account: caseFileId.

With the following information provided as JSON:

{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "code": "example code",
    "type": "FILE",
    "name": "example description",
    "description": "example description",
    "createdBy": "example description",
    "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    }
  }

Request body parameters

Parameter Mandatory Datatype Description
id yes UUID An identification for the "Evidence Group". UUID V4
code no string(50) The code of the "Evidence Group". It must be unique
type no string(50) The type of the "Evidence Group". Possible values: "FILE, PHOTO, VIDEO, WEB_PLUGIN".
name no string(255) The name of the "Evidence Group".
description no string(255) The description of the "Evidence Group"
createdBy no string(55) The creator of the "Evidence Group".
metadata no object Metadata of the "Evidence Group"

As response, you will get

201 Evidence Group created


Update an "Evidence Group"

To be able to update the information of "Evidence Groups"

HTTP Request

PATCH /api/v1/private/case-files/{caseFileId}/evidence-groups/{evidenceGroupId}

In this request, there is one primary resource case-files and a secondary one evidence-groups. There are also 2 resource identifiers that you need to replace with real values of your Legal App platform account: caseFileId and evidenceGroupId.

With the following information provided as JSON:

{
    "name": "example name",
    "description": "example description",
    "code": "example code",
    "createdBy": "example owner",
    "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    }
  }

If you only want to update one of the fields you only have to send this one in the request.

Request body parameters

Parameter Mandatory Datatype Description
name no string(255) The new name of the "Evidence Group"
description no string(255) The new description of the "Evidence Group"
code no string(50) The new code of the "Evidence Group"
createdBy no string(50) The new owner of the "Evidence Group"
metadata no object New metadata of the "Evidence Group"

As response, you will get

200 Evidence Group updated correctly

If the "Evidence Group" does not exist, you will get a 404 Not found response.

Update "Evidence Groups" (bulk)

To update the same fields of several "Evidence Groups" at once, you can send a list of patch operations that will be applied to all the given "Evidence Groups".

HTTP Request

PATCH /api/v1/private/evidence-groups

With the following information provided as JSON:

{
    "ids": ["7e81750d-7906-43c9-bf6b-a9f30847c2e9", "1f7193a6-2454-4c67-8a64-b73c1049e92c"],
    "patch": [
      {
        "operation": "REPLACE",
        "path": "name",
        "value": "example name"
      },
      {
        "operation": "REMOVE",
        "path": "description"
      }
    ]
  }

Request body parameters

Parameter Mandatory Datatype Description
ids yes array of UUID The identifiers of the "Evidence Groups" to update. UUID V4
patch yes array of object List of patch operations to apply to all the given "Evidence Groups". At most one operation per field.
patch[].operation yes string The patch operation. Possible values: "REPLACE" (set the field to the given value) and "REMOVE" (clear the field)
patch[].path yes string The field to update. Possible values: "createdBy", "name", "description" and "discarded"
patch[].value no string The new value of the field. For "discarded" it must be "true" or "false". Required for "REPLACE" operations, ignored for "REMOVE" operations.

As response, you will get

204 "Evidence Groups" updated correctly


Discard an Evidence Group

To discard a "Evidence Group" you can make the following requests using the id of the "Evidence Group".

HTTP Request

DELETE /api/v1/private/case-files/{caseFileId}/evidence-groups/{evidenceGroupId}

In this request, there is one primary resource case-files and a secondary one evidence-groups. There are also 2 resource identifiers that you need to replace with real values of your Legal App platform account: caseFileId and evidenceGroupId.

As response, you will get

204 Evidence Group discarded successfully


Delete "Evidence Groups" (bulk)

To delete "Evidence Groups" you can make the following request using the id of the "Case file" they belong to and the ids of the "Evidence Groups". Up to 100 "Evidence Groups" can be deleted in a single request.

HTTP Request

DELETE /api/v1/private/bulk/case-files/{caseFileId}/evidence-groups

In this request, there is one primary resource case-files. There is also 1 resource identifier that you need to replace with real values of your Legal App platform account: caseFileId.

With the following information provided as JSON:

{
    "requestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "ids": ["7e81750d-7906-43c9-bf6b-a9f30847c2e9", "1f7193a6-2454-4c67-8a64-b73c1049e92c"]
  }

Request body parameters

Parameter Mandatory Datatype Description
requestId yes UUID An identifier for this delete request, generated by the client. UUID V4
ids yes array of UUID The identifiers of the "Evidence Groups" to delete. Maximum 100 elements

This operation is asynchronous: the request is accepted and the "Evidence Groups" (with all their "Evidences") are deleted in the background.

As response, you will get

204 Delete "Evidence Groups" request accepted

If some of the "Evidence Groups" do not exist, you will get a 404 Not found response. If some of the "Evidence Groups" are already part of another running process, you will get a 409 Conflict response.


Close an "Evidence Group"

To close an "Evidence Group" you can make the following requests using the id of the "Evidence Group".

HTTP Request

POST /api/v1/private/case-files/{caseFileId}/evidence-groups/{evidenceGroupId}/close

In this request, there is one primary resource case-files and a secondary one evidence-groups. There are also 2 resource identifiers that you need to replace with real values of your Legal App platform account: caseFileId and evidenceGroupId.

With the following information provided as JSON:

{
    "evidencesCount": 3,
    "collectMetadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    }
  }

*evidencesCount: it is the number of "Evidences" in the "Evidence Group" at the moment of the request.

*This operation starts an asynchronous process: the "Evidence Group" moves from OPEN to CLOSING and, once the process finishes, to CLOSED. A webhook notification is sent to the client when the "Evidence Group" reaches the CLOSED status (see Webhook notifications).

As response, you will get

202 Evidence Group close request accepted


Get "Evidence Group" info

To get the information of "Evidence Group" you can make the following requests using the id of the "Evidence Group".

HTTP Request

GET /api/v1/private/case-files/{caseFileId}/evidence-groups/{evidenceGroupId}

In this request, there is one primary resource case-files and a secondary one evidence-groups. There are also 2 resource identifiers that you need to replace with real values of your Legal App platform account: caseFileId and evidenceGroupId.

And as response, we would get the following JSON object:

{
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "caseFileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "collectionMetadataId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "code": "example code",
    "name": "example name",
    "type": "FILE",
    "status": "OPEN",
    "description": "example description",
    "createdAt": "2023-10-24T20:44:31.972Z",
    "createdBy": "example owner",
    "evidences": {
      "inProcess": 0,
      "failed": 0,
      "completed": 0,
      "total": 0
    },
    "discarded": false,
    "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    }
  }

Where:

HTTP Response parameters

Parameter Datatype Description
id UUID An identification for the "Evidence Group". UUID V4
caseFileId UUID An identification for the "Case File". UUID V4
collectionMetadataId UUID An identification for the "Collection Metadata". UUID V4
code string(50) "Evidence group's" code
name string(50) "Evidence group's" name
type string(50) The type of the "Evidence Group". Possible values: "FILE, PHOTO, VIDEO, WEB_PLUGIN".
status string(50) "Evidence group's" status. Possible values: "OPEN", "CLOSING" and "CLOSED".
description string(255) "Evidence group's" description
createdAt datetime Date when the "Evidence Group" was created
createdBy string(50) "Evidence group's" owner
evidences object "Evidence group's" evidences and their quantity grouped by evidence status
discarded bool If the "Evidence Group is discarded"
metadata object Metadata of the "Evidence Group"

Get "Evidence Group" list

If you want to get the list of all the "Evidence Groups" in your system, you can make the following requests:

HTTP Request

GET /api/v1/private/evidence-groups

The list can be filtered with the following optional query parameters:

{
    "caseFileId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "id": "[3fa85f64-5717-4562-b3fc-2c963f66afa6, c3a8eb1c-3f6d-4bad-9e6b-c7e29461d021]",
    "code": "example code",
    "name": "example name",
    "status": "OPEN",
    "type": "FILE",
    "createdBy": "example owner",
    "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "createdFrom": "2023-10-24T20:53:29.593Z",
    "createdUntil": "2023-10-24T20:53:29.593Z",
    "page": 0,
    "size": 0,
    "sort": "[\"name:ASC\", \"createdAt:DESC\"]"
  }

These calls can be paged. This is specially usefull when you have to retrieve a big amount of elements.

By default, the size of the page is 20 elements, and you can put a maximum size of 200 elements. The response shows a list of resources to make the paged calls, basically you can set the page, the size, and the field you want to sort the list by.

Example:

GET api/v1/private/evidence-groups?page=0&size=25

If you want to try any of these functionalities yourself and learn more about them, please go to the API catalogue