Alert Dismissal Error response via API

Reply
L0 Member

Alert Dismissal Error response via API

Anyone have experience using the Prisma Cloud API with dismissing alert, i've been testing the but always getting 404 or 400 response, check parameters below

 

url = "https://api.prismacloud.io/alert/dismiss"

payload = {
                        "alerts": [param.get("alert_id")],
                        "dismissalTimeRange": {
                            'type''absolute',
                            'value': {
                                'startTime'0,
                                'endTime': end_time
                            }
                        },
                        "filter": {
                            "timeRange": {
                                'type''absolute',
                                'value': {
                                    'startTime'0,
                                    'endTime': end_time
                                }
                            },
                            "limit""1",
                            "detailed""true"
                        }
                    }
 
been looking on the community but not found any good solutions.
L2 Linker

Re: Alert Dismissal Error response via API

Policies array might be required - here's mine that works and it seems to be the only major thing missing from your payload.  Also make sure it's a POST.

 

Payload: 
  
   "alerts":
      "P-1424086"
   ],
   "policies":

   ],
   "filter":
      "filters":
         
            "operator":"=",
            "name":"alert.status",
            "value":"open"
         },
         
            "operator":"=",
            "name":"policy.type",
            "value":"config"
         }
      ],
      "timeRange":
         "type":"relative",
         "value":
            "amount":1,
            "unit":"week"
         }
      }
   },
   "dismissalNote":"Test2"
}

L0 Member

Re: Alert Dismissal Error response via API

Thanks on your response,

 

I've solve it via removing "dismissalTimeRange" on parameter. i don't have any idea why it does not work having that on parameters.

 

Thanks!

L2 Linker

Re: Alert Dismissal Error response via API

Dismissal Range is for the new snooze feature to specify the time range for keeping the alert in dismissed status. 

If you are dismissing without snoozing, then Dismissal Range is not needed.

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 Live Community as a whole!

The Live Community thanks you for your participation!