From 345478636c33db8e4eb7d5417bf4f310ecaac93c Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Tue, 21 Sep 2021 07:12:28 +0200 Subject: [PATCH] #11 WIP add docs for case attachments and merge --- docs/thehive/api/.pages | 2 +- docs/thehive/api/case/attachments.md | 2 +- docs/thehive/api/case/merge.md | 64 ++++++++++++++++++++++++---- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/docs/thehive/api/.pages b/docs/thehive/api/.pages index 77a1c81b..996f0c7f 100644 --- a/docs/thehive/api/.pages +++ b/docs/thehive/api/.pages @@ -5,7 +5,7 @@ nav: - 'custom-field' - 'case-template' - 'alert' - # - 'case' + - 'case' - 'task' - 'observable' - 'search' diff --git a/docs/thehive/api/case/attachments.md b/docs/thehive/api/case/attachments.md index 5c2cf4a1..cbdaa86e 100644 --- a/docs/thehive/api/case/attachments.md +++ b/docs/thehive/api/case/attachments.md @@ -62,7 +62,7 @@ With: - `401`: Authentication error - `404`: if the *Case* is not found -### ResponseBody Example +### Response Body Example !!! Example "" diff --git a/docs/thehive/api/case/merge.md b/docs/thehive/api/case/merge.md index b2ba9f4d..1eaff2cb 100644 --- a/docs/thehive/api/case/merge.md +++ b/docs/thehive/api/case/merge.md @@ -1,21 +1,69 @@ # Merge +Merge two *Cases* in a single *Case*. This APIs permanently removes the source *Cases* and creates a *Case* by merging all the data from the sources. + ## Query +```plain +POST /api/v0/case/{id1}/_merge/{id2} ``` -``` +with: +- `id1`: id of the first *Case* +- `id2`: id of the second *Case* -## Request Body Example +## Response -```json +### Status codes -``` +- `204`: if the *Cases* are merged successfully +- `401`: Authentication error +- `404`: if at least one of the *Cases* is not found - -## ResponseBody Example +### Response Body Example ```json - -``` \ No newline at end of file + { + "_id": "~81928240", + "id": "~81928240", + "createdBy": "user@thehive.local", + "updatedBy": null, + "createdAt": 1632132365250, + "updatedAt": null, + "_type": "case", + "caseId": 87, + "title": "Case 1 / Case 2", + "description": "test\n\ntest", + "severity": 2, + "startDate": 1632124020000, + "endDate": null, + "impactStatus": null, + "resolutionStatus": null, + "tags": [], + "flag": false, + "tlp": 2, + "pap": 2, + "status": "Open", + "summary": null, + "owner": "user@thehive.local", + "customFields": {}, + "stats": {}, + "permissions": [ + "manageShare", + "manageAnalyse", + "manageTask", + "manageCaseTemplate", + "manageCase", + "manageUser", + "manageProcedure", + "managePage", + "manageObservable", + "manageTag", + "manageConfig", + "manageAlert", + "accessTheHiveFS", + "manageAction" + ] + } +```