Actions can be used in Alerts and Email Reports.
Note: In the ManagementAPI creation and edit of Slack and Teams actions is not supported. Please use UI for that and then List that actions to get id and use to create/edit Alerts and Email Reports.
List
Output list of actions for specified type. Type (the last path parameter) can be either webhook, slack or teams.
Query
GET /api/1.0/action/<actionType>
| Parameter | Comments |
|---|---|
| actionType | Type of actions to list. Possible values: webhook, slack or teams. |
Response
| HTTP Status | Response |
|---|---|
| 200 OK | Output example:
{
"list": [
{
"createdDate": 1490490365000,
"lastModDate": 1490524068000,
"id": 157,
"userId": 10077,
"actionType": "WEBHOOK",
"jsonConfig": "{\"classVersion\":1,\"url\":\"url1z\",\"authUrl\":\"\",\"authHeaders\":\"\",\"webhookHeaders\":\"\",\"useFullDatasetForPost\":false,\"additionalFilterCloud9ql\":\"\"}",
"classVersion": 1,
"url": "url1z",
"authUrl": "",
"authHeaders": "",
"webhookHeaders": "",
"useFullDatasetForPost": false,
"additionalFilterCloud9ql": ""
}
]
}
|
| 400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
| 401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" http://localhost:9090/api/1.0/action/webhook
Create (only webhook)
This endpoint is for creating a new webhook
Query
POST /api/1.0/action/webhook
| No parameters |
|---|
POST JSON payload:
Sample input:
{
"classVersion": 1,
"url": "http://some3.com",
"authUrl": "http://auth",
"authHeaders": "",
"webhookHeaders": "header1:val1",
"useFullDatasetForPost": false
}
Response
| HTTP Status | Response |
|---|---|
| 200 OK | Output created entity |
| 400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
| 401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d '{"classVersion":1,"url":"http://some3.com","authUrl":"http://auth","authHeaders":"","webhookHeaders":"header1:val1","useFullDatasetForPost":false}' http://localhost:9090/api/1.0/action/webhook
Edit (only webhook)
This Endpoint is for updating/modifying a webhook of a given webhook id
Query
PUT /api/1.0/action/lt;actionType>/lt;objectId>
| Parameter | Comments |
|---|---|
| actionType | Type of action to edit. Possible values: webhook, slack or teams. |
| objectId | Action id to edit |
Response
| HTTP Status | Response |
|---|---|
| 200 OK | Output edited entity |
| 400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
| 401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> }
Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d '{"classVersion":1,"url":"http://some3new.com","authUrl":"http://auth","authHeaders":"","webhookHeaders":"header1:val1","useFullDatasetForPost":false}' http://localhost:9090/api/1.0/action/webhook/202