Case file operations
Contents
Introduction
Once you have the token, you can start sending requests to the API.
Operations
Create a "Case file"
The first interaction you have to do with the API is to create a "Case file".
HTTP Request
POST /api/v1/private/case-files
With the following information provided as JSON:
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "example code",
"description": "example description",
"category": "example category",
"owner": "example owner",
"title": "example title",
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
}
Request body parameters
| Parameter | Mandatory | Datatype | Description |
|---|---|---|---|
| id | yes | UUID | An identification for the "Case file". UUID V4 |
| code | no | string(50) | The code of the "Case file". It must be unique |
| description | no | string(255) | The description of the "Case file" |
| category | no | string(50) | The category of the "Case file" |
| owner | no | string(50) | The owner of the "Case file" |
| title | yes | string(255) | The title of the "Case file" |
| metadata | no | object | Metadata of the "Case file" |
As response, you will get
201 "Case File" created
Update "Case files" (bulk)
To update the same fields of several "Case files" at once, you can send a list of patch operations that will be applied to all the given "Case files".
HTTP Request
PATCH /api/v1/private/case-files
With the following information provided as JSON:
{
"ids": ["7e81750d-7906-43c9-bf6b-a9f30847c2e9", "1f7193a6-2454-4c67-8a64-b73c1049e92c"],
"patch": [
{
"operation": "REPLACE",
"path": "description",
"value": "example description"
},
{
"operation": "REMOVE",
"path": "owner"
}
]
}
Request body parameters
| Parameter | Mandatory | Datatype | Description |
|---|---|---|---|
| ids | yes | array of UUID | The identifiers of the "Case files" to update. UUID V4 |
| patch | yes | array of object | List of patch operations to apply to all the given "Case files". 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: "description", "category", "owner" and "title" |
| patch[].value | no | string | The new value of the field. Required for "REPLACE" operations, ignored for "REMOVE" operations. |
As response, you will get
204 "Case files" updated correctly
Update a single "Case file"
To update the information of a single "Case file" you can make the following request using the id of the "Case file".
HTTP Request
PATCH /api/v1/private/case-files/{caseFileId}
With the following information provided as JSON:
{
"code": "example code",
"description": "example description",
"category": "example category",
"owner": "example owner",
"title": "example title",
"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 |
|---|---|---|---|
| code | no | string(50) | The new code of the "Case file". It must be unique |
| description | no | string(255) | The new description of the "Case file" |
| category | no | string(50) | The new category of the "Case file" |
| owner | no | string(50) | The new owner of the "Case file" |
| title | no | string(255) | The new title of the "Case file" |
| metadata | no | object | New metadata of the "Case file" |
As response, you will get
204 "Case file" updated correctly
If the "Case file" does not exist, you will get a 404 Not found response.
Update "Case file" status
To change the status of a "Case file" you can make the following request using the id of the "Case file".
HTTP Request
PUT /api/v1/private/case-files/{caseFileId}/status
With the following information provided as JSON:
{
"status": "CLOSE"
}
Request body parameters
| Parameter | Mandatory | Datatype | Description |
|---|---|---|---|
| status | yes | string | The new status of the "Case file". Possible values: "OPEN" and "CLOSE" |
As response, you will get
204 "Case file" status updated correctly
If the "Case file" does not exist, you will get a 404 Not found response.
Delete "Case files" (bulk)
To delete "Case files" you can make the following request using the ids of the "Case files". Up to 100 "Case files" can be deleted in a single request.
HTTP Request
DELETE /api/v1/private/bulk/case-files
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 "Case files" to delete. Maximum 100 elements |
This operation is asynchronous: the request is accepted and the "Case files" (with all their "Evidence Groups" and "Evidences") are deleted in the background.
As response, you will get
204 Delete "Case files" request accepted
If some of the "Case files" do not exist, you will get a 404 Not found response. If some
of the "Case files" are already part of another running process, you will get a
409 Conflict response.
Get "Case file" info
To get the information of a "Case file" you can make the following requests using the id of the "Case File".
HTTP Request
GET /api/v1/private/case-files/{caseFileId}
And as response, we would get the following JSON object:
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "example code",
"description": "example description",
"category": "example category",
"owner": "example owner",
"status": "OPEN",
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"groups": "[7e81750d-7906-43c9-bf6b-a9f30847c2e9, 1f7193a6-2454-4c67-8a64-b73c1049e92c]",
"title": "example title",
"createdAt": "2023-10-23T10:34:59.483Z",
"updatedAt": "2023-10-23T10:34:59.483Z"
} Where:
HTTP Response parameters
| Parameter | Datatype | Description |
|---|---|---|
| id | UUID | An identification for the "Case file". UUID V4 |
| code | string(50) | The code of the "Case file". It must be unique |
| description | string(255) | The description of the "Case file" |
| category | string(50) | The category of the "Case file" |
| owner | string(50) | The owner of the "Case file" |
| status | string(50) | The status of the "Case file". Possible values: "OPEN" and "CLOSE" |
| title | string(255) | The title of the "Case file" |
| metadata | object | Metadata of the "Case file" |
| groups | list of UUID | List with the identifiers (UUID V4) of the "Evidence Groups" that belong to the "Case file" |
| createdAt | datetime | Date when the "Case file" was created |
| updatedAt | datetime | Date when the "Case file" was last updated |
Get "Case files" list
If you want to get the list of all the "Case files" in your system, you can make the following requests:
HTTP Request
GET /api/v1/private/case-files
The list can be filtered with the following optional query parameters:
{
"id": "[3fa85f64-5717-4562-b3fc-2c963f66afa6, c3a8eb1c-3f6d-4bad-9e6b-c7e29461d021]",
"code": "example code",
"title": "example title",
"category": "[cat1, cat2]",
"owner": "[owner1, owner2]",
"status": "OPEN",
"createdFrom": "2023-10-24T10:30:50.794Z",
"createdUntil": "2023-10-24T10:30:50.794Z",
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"page": 0,
"size": 0,
"sort": "[\"title:ASC\", \"createdAt:DESC\"]"
}
These call 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/case-files?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