Working with alert comments using the API

Working with alert comments using the API

Overview

Check the list of available endpoints and methods to work with alert comments using the Alerts API:

Endpoints and methods

Description

Endpoints and methods

Description

POST/comments/addsee below

Add a comment to a triggered alert.

POST/comments/bulk/addsee below

Add a comment to a set of triggered alerts.

POST/comments/listsee below

Get all the comments of the indicated alerts.

PUT /comments/updatesee below

Update an alert comment.

PUT /comments/bulk/updatesee below

Update a set of comments with the same content.

DELETE/comments/deletesee below

Delete alert comments.

Endpoints and methods

POST /comments/add

Add a comment to a triggered alert.

 

Request

Request body

The request JSON body must include the following parameters:

Parameter

Type

Definition

Parameter

Type

Definition

elementId required

string

Enter the ID of the alert to which you want to add the comment.

How can I get the ID of a triggered alert?

Triggered alert IDs are displayed in the Alerts area of the Devo platform. You can find them in the Alerts history table at the bottom of the Alerts dashboard tab. Learn more about this in Managing triggered alerts.

You will also get the IDs of the triggered alerts in a domain using GET/v1/alerts/list

commentType required

string

Indicate the comment type. Must be one of the following:

  • ALERT - Add a new comment to an alert.

  • REPLY - Reply to an existing comment.

commentTitle required

string

Enter the title of the comment.

commentMsg required

string

Enter the message of the comment.

Example

Find below a request example in cURL language. In this case, we are adding a new comment to the triggered alert with ID 123456. Learn how to authorize your request in this article.

curl --location -g 'https://api-us.devo.com/alerts/v1/comments/add' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{ "elementId": "123456", "commentMsg": "From alerts API, comment for alert 123456", "commentTitle": "This is a comment for alert 123456", "commentType": "ALERT" }'

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. comment created.

true

400

Error in request

401

Unauthorized error.

403

Forbidden request.

404

Not found.

405

Method not allowed.

500

Server error and Java exception.

POST /comments/bulk/add

Add a comment to a set of triggered alerts.

 

Request

Request body

The request JSON body must include the following parameters:

Parameter

Type

Definition

Parameter

Type

Definition

elementIds required

string

Enter the IDs of all the triggered alerts to which you want to add the comment, following this format:

"elementIds": ["string", "string", "string"]

How can I get the ID of a triggered alert?

Triggered alert IDs are displayed in the Alerts area of the Devo platform. You can find them in the Alerts history table at the bottom of the Alerts dashboard tab. Learn more about this in Managing triggered alerts.

You will also get the IDs of the triggered alerts in a domain using GET/v1/alerts/list

commentType required

string

Indicate the comment type. Must be one of the following:

  • ALERT - Add a new comment to an alert.

  • REPLY - Reply to an existing comment.

commentTitle required

string

Enter the title of the comment.

commentMsg required

string

Enter the message of the comment.

Example

Find below a request example in cURL language. In this case, we are adding a new comment to the triggered alerts with IDs 123456 and 789012. Learn how to authorize your request in this article.

curl --location -g 'https://api-us.devo.com/alerts/v1/comments/bulk/add' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{ "elementIds": ["123456", "789012"], "commentMsg": "From alerts API, comment for alerts 123456 and 789012", "commentTitle": "This is a comment for alerts 123456 and 789012", "commentType": "ALERT" }'

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. comments created.

{ "123456": true, "789012": true, }

400

Error in request

401

Unauthorized error.

403

Forbidden request.

404

Not found.

405

Method not allowed.

500

Server error and Java exception.

POST /comments/list

Get all comments of the indicated alerts.

 

Request

Request body

The request JSON body must include the IDs of all the alerts from which you want to retrieve the comments, following this format:

["string", "string", "string"]

Example

Find below a request example in cURL language. In this case, we want to retrieve details about the comments added to the triggered alerts with IDs 123456 and 789012. Learn how to authorize your request in this article.

curl --location --request POST 'https://api-us.devo.com/alerts/v1/comments/list' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '["123456", "789012"]'

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. List of comments for the indicated alerts retrieved.

[ { "idAlert": 123456, "comments": [ { "id": 709964, "author": { "id": 4076, "user": { "id": "*****", "email": "user@devo.com", "username": "Firewall Investigator", "telephone": "", "pwd": "**************", "status": 0, "validation_token": "**************", "defaultDomain": null, "updateDate": 1680613381000, "creationDate": 1679407982000, "otpSecret": "**************", "loginAttempts": 0, "recoveryAttempts": 0 }, "domain": { "id": "******", "name": "demo", "status": 0, "type": 12, "updateDate": 1651960466000, "creationDate": 1469195237000, "subscribed": 1, "daysLeft": 0, "showLanding": false, "reseller": null, "groupId": null, "alertsLastReseted": 1651960466000, "authRestrictions": false }, "lastTimeLogged": 1680613391000, "status": 0, "creationDate": 1558079345000, "updateDate": 1680618378000, "pwd": "**************", "validationToken": "**************", "roleCustom": 118, "rolesCustom": null, "externalId": null, "owner": false, "alertsLastVisited": 1680618378000 }, "msg": "From alerts API, comment for alert 123456", "ack": "{\"ackUserList\":[\"4b1583b9-38e7-40b8-8364-86792d91f6bf\"]}", "creationDate": 1680617937000, "updateDate": 1680617937000, "elementType": "alert", "elementId": "133456", "domain": { "id": "1048ae29-8cae-4ae5-af29-e7d76c7de5d1", "name": "demo", "status": 0, "type": 12, "updateDate": 1651960466000, "creationDate": 1469195237000, "subscribed": 1, "daysLeft": 0, "showLanding": false, "reseller": null, "groupId": null, "alertsLastReseted": 1651960466000, "authRestrictions": false }, "title": "This is a comment for alert 123456", "status": null, "task": false } ] }, { "idAlert": 789012, "comments": [ { "id": 709965, "author": { "id": 4076, "user": { "id": "******", "email": "user@devo.com", "username": "Firewall Investigator", "telephone": "", "pwd": "**************", "status": 0, "validation_token": "**************", "defaultDomain": null, "updateDate": 1680613381000, "creationDate": 1679407982000, "otpSecret": "**************", "loginAttempts": 0, "recoveryAttempts": 0 }, "domain": { "id": "******", "name": "demo", "status": 0, "type": 12, "updateDate": 1651960466000, "creationDate": 1469195237000, "subscribed": 1, "daysLeft": 0, "showLanding": false, "reseller": null, "groupId": null, "alertsLastReseted": 1651960466000, "authRestrictions": false }, "lastTimeLogged": 1680613391000, "status": 0, "creationDate": 1558079345000, "updateDate": 1680618378000, "pwd": "**************", "validationToken": "**************", "roleCustom": 118, "rolesCustom": null, "externalId": null, "owner": false, "alertsLastVisited": 1680618378000 }, "msg": "From alerts API, comment for alert 789012", "ack": "{\"ackUserList\":[\"4b1583b9-38e7-40b8-8364-86792d91f6bf\"]}", "creationDate": 1680617937000, "updateDate": 1680617937000, "elementType": "alert", "elementId": "789012", "domain": { "id": "1048ae29-8cae-4ae5-af29-e7d76c7de5d1", "name": "demo", "status": 0, "type": 12, "updateDate": 1651960466000, "creationDate": 1469195237000, "subscribed": 1, "daysLeft": 0, "showLanding": false, "reseller": null, "groupId": null, "alertsLastReseted": 1651960466000, "authRestrictions": false }, "title": "This is a comment for alert 789012", "status": null, "task": false } ] } ]

400

Error in request

401

Unauthorized error.

403

Forbidden request.

404

Not found.

405

Method not allowed.

500

Server error and Java exception.

PUT /comments/update

Update an alert comment.

 

Request

Query string parameters

Query string parameters are optionally added after the path parameters, preceded by a question mark (?) and separated by an ampersand ()

Parameter

Type

Definition

Parameter

Type

Definition

commentId required

string

ID of the comment to be updated.

How can I get the ID of an comment?

comment IDs are not displayed in the Devo platform, so you should get them using POST /v1/comments/list to get details of a set of comments in the domain. IDs are included in the response.

Request body

The request JSON body must include the following parameters:

Parameter

Type

Definition

Parameter

Type

Definition

elementId required

string

Enter the ID of the alert that has the comment you want to update.

How can I get the ID of a triggered alert?

Triggered alert IDs are displayed in the Alerts area of the Devo platform. You can find them in the Alerts history table at the bottom of the Alerts dashboard tab. Learn more about this in Managing triggered alerts.

You will also get the IDs of the triggered alerts in a domain using GET/v1/alerts/list

commentType required

string

Indicate the comment type. Must be one of the following:

  • ALERT - Add a new comment to an alert.

  • REPLY - Reply to an existing comment.

commentMsg required

string

Enter the new message of the comment.

commentTitle required

string

Enter the new title of the comment.

Example

Find below a request example in cURL language. In this case, we want to update the comment with ID 010101 added to the triggered alert with ID 123456. Learn how to authorize your request in this article.

curl --location --request PUT 'https://api-us.devo.com/alerts/v1/comments/update?commentId=010101' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{ "elementId": ["123456"], "commentMsg": "Updated message", "commentTitle": "Updated title", "commentType": "ALERT" }'

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. comment updated.

true

400

Error in request

401

Unauthorized error.

403

Forbidden request.

404

Not found.

405

Method not allowed.

500

Server error and Java exception.

PUT /comments/bulk/update

Update a set of alert comments with the same content.

 

Request

Request body

The request JSON body must include the following parameters:

Parameter

Type

Definition

Parameter

Type

Definition

idMap required

string

Enter the IDs of the comments you want to update following this format:

{ "additionalProp1": [ 0 ], "additionalProp2": [ 0 ], "additionalProp3": [ 0 ] },

commentType required

string

Indicate the comment type. Must be one of the following:

  • ALERT - Add a new comment to an alert.

  • REPLY - Reply to an existing comment.

commentMsg required

string

Enter the new message of the comment.

commentTitle required

string

Enter the new title of the comment.

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. comments updated.

400

Unsuccessful response. Invalid parameters

DELETE /comments/delete

Delete the specified alert comments.

 

Request

Request body

The request JSON body must include the IDs of all the alerts whose comments you want to delete, following this format:

["string", "string", "string"]

Find below a request example:

https://api-us.devo.com/alerts/v1/comments/delete
["1660947", "1660948", "1660950"]

 

Response

Check the list of available responses:

Code

Description

Code

Description

200

Successful response. comments deleted.

true

400

Unsuccessful response. Invalid parameters