Skip to content

Commit

Permalink
#11 WIP add docs for case attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Sep 20, 2021
1 parent c1a167b commit 6d09712
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions docs/thehive/api/case/attachments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# List related Alerts

List attachments added to task logs of a *Case*.

## Query

```plain
POST /api/v0/query
```

## Request Body Example

!!! Example ""

List attachments added to task logs or a *Case* identified by `{id}`:

```json
{
"query": [
{
"_name": "getCase",
"idOrName": "{id}"
},
{
"_name": "tasks"
},
{
"_name": "filter",
"_ne": {
"_field": "status",
"_value": "Cancel"
}
},
{
"_name": "logs"
},
{
"_contains": "attachment.id",
"_name": "filter"
},
{
"_name": "page",
"extraData": [
"taskId"
],
"from": 0,
"to": 100
}
]
}
```

With:

- `id`: id of the *Case*

## Response

### Status codes

- `200`: if query is run successfully
- `401`: Authentication error
- `404`: if the *Case* is not found

### ResponseBody Example

!!! Example ""

```json
[
...
{
"_id": "~122892472",
"id": "~122892472",
"createdBy": "[email protected]",
"createdAt": 1632124353194,
"_type": "case_task_log",
"message": "message",
"startDate": 1632124353194,
"attachment": {
"name": "filename.png",
"hashes": [
"0b62003cb73578d9e738a70aa7a81e89d3683282ac393856a96ef364cd1038cb",
"caa75ff1e33ee8bfba764c9a6139fb72e7f4e20a",
"a3e41c32ff817fc759bafeb1a106a433"
],
"size": 42213,
"contentType": "image/png",
"id": "0b62003cb73578d9e738a70aa7a81e89d3683282ac393856a96ef364cd1038cb"
},
"status": "Ok",
"owner": "[email protected]"
}
...
]
```

0 comments on commit 6d09712

Please sign in to comment.