TheHive4py
TheHive4py copied to clipboard
How to give case_id in get_case_tasks() function ?
| Question | Answer |
|---|---|
| thehive | 4.1.11 |
I am trying to get all the tasks under a case using function get_case_tasks() but to use this function I need to pass the case id ( format mentioned in api.py file ).
I am using python 3.
My Code :-
thehive = TheHiveApi('url', 'key', cert=False) response = thehive.get_case_tasks('12') print(json.dumps(response.json(), indent=4, sort_keys=True))
output :- { "errors": [ { "acceptedInput": [ "query", "parentChildFilter" ], "field": "FNumber(2.226586900976E12)", "format": "empty", "name": "", "type": "InvalidFormatAttributeError" } ], "message": "[Invalid format for : FNumber(2.226586900976E12), expected empty (query,parentChildFilter)]", "type": "AttributeCheckingError" }
Help me guys, How to give case id in that function. And also, if possible, please describe the error as well that why am I getting this error.
I think the case_id parameter of the method get_case_tasks is actually the id sting associated to the case. It looks like this: "~81924184".
If you use a Responder on a case, you can see it in Cortex in the input details.
If you use cortexutils, you can get it with self.get_param("data.id") used on a Responder object.
The method get_case_task will then return a list of dictionary, each of them describing a task.