Cortex API (get_alerts) Error 'Got an invalid input while processing XDR public API'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Cortex API (get_alerts) Error 'Got an invalid input while processing XDR public API'

L1 Bithead

I was able to use "get_endpoints" because in that instance, the PARAMS are just {}.

 

But with /public_api/v1/alerts/get_alerts/ :

 

>>> PARAMS = {"request_data": {"filters": [{"field": "alert_id_list","operator": "in","value": [88299]}]}}
>>> r = requests.post(url=url,headers=headers,params=PARAMS)
>>> print(r.json())
{'reply': {'err_code': 500, 'err_msg': 'Got an invalid input while processing XDR public API', 'err_extra': 'request_data must be of type: dict'}}

 

Am I missing something here?

 

>>> type(PARAMS)
<class 'dict'>

1 accepted solution

Accepted Solutions

L1 Bithead

Needed to be:

 

response = requests.post(url, headers=headers, json=params)

View solution in original post

1 REPLY 1

L1 Bithead

Needed to be:

 

response = requests.post(url, headers=headers, json=params)

  • 1 accepted solution
  • 1432 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!