Returns a list of all notification actions belonging to an account as per the specified criteria. This API is paginated and returns 20 actions by default. An action is uniquely identified by a 'notification_action_key'. This key should be used in all the other API referencing a particular notification action.
Param name | Description |
---|---|
page optional |
Page number of results to be fetched, Default 1 Value: Must be Integer. |
per optional |
Number of notification actions to be returned in one page, Default 20 Value: Must be Integer. |
order_by optional |
Field on which results should be sorted Value: Must be a String |
order optional |
Order, “asc” or “desc”, in which results should be sorted Value: Must be a String |
search optional |
Keywords based on which notfication actions should be searched. Currently not supported Value: Must be a String |
scope optional |
Matching condition if multiple keywords are specified for search. Currently not supported Value: Must be a String |
rule_key required |
Mandatory, rule_key in string format. Value: Must be a String |
type optional |
Optional, one from “EmailNotificationAction”, “CallHttpUrlAction” or “ThingUserDefinedPropertiesAction” Value: Must be a String |
timestamp_format optional |
Format, “str” or “int”, in which timestamps should be returned, Default “int” Value: Must be a String |
pretty optional |
Return a pretty formatted response if true, Default is false Value: Must be a Boolean |
Request - listing all notification actions associated with a rule curl -X GET -H "Content-Type:application/json" -H 'X-Auth-Token:SMvLmYkkIVSYrrEQZSix0Q' -d '{"rule_key":"a24e3747bd"}' https://api.datonis.io/api/v3/notification_actions Response (returns first 20 records) { "total_count": 3, "page": 1, "notification_actions": [ { "bcc": "", "body": null, "cc": "john@acme.com", "created_at": 1448514905, "notification_action_key": "e18c3t386e", "subject": null, "to": "bill@acme.com", "updated_at": 1448514905, "type": "EmailNotificationAction" }, { "body": "{\"user_defined_properties\":{\"Status\":\"Green\"}}", "created_at": 1448515099, "headers": { }, "method": "PUT", "notification_action_key": "4d1d745e94", "query": { }, "updated_at":...
curl -X GET -H "Content-Type:application/json" -H 'X-Auth-Token:SMvLmYkkIVSYrrEQZSix0Q' -d '{"rule_key":"a24e3747bd", "per":"2", "page":"2"}' https://api.datonis.io/api/v3/notification_actions Response (returns page 2 with 2 notification actions per page) { "total_count": 3, "page": "2", "notification_actions": [ { "body": "", "created_at": 1448514914, "headers": { }, "method": "GET", "notification_action_key": "dt1b22767c", "query": { }, "updated_at": 1448514914, "url": "http://epochconverter.com", "type": "CallHttpUrlAction" } ] }
Request - listing notification actions ordered by a field curl -X GET -H "Content-Type:application/json" -H 'X-Auth-Token:SMvLmYkkIVSYrrEQZSix0Q' -d '{"rule_key":"a24e3747bd", "order_by":"type", "order":"desc"}' https://api.datonis.io/api/v3/notification_actions Response (returns notification in the reverse order of type) { "total_count": 3, "page": 1, "notification_actions": [ { "bcc": "", "body": null, "cc": "john@acme.com", "created_at": 1448514905, "notification_action_key": "e18c3t386e", "subject": null, "to": "bill@acme.com", "updated_at": 1448514905, "type": "EmailNotificationAction" }, { "body": "{\"user_defined_properties\":{\"Status\":\"Green\"}}", "created_at": 1448515099, "headers": { }, "method": "PUT", "notification_action_key": "4d1d745e94", "query": { }, "updated_at": 1448515099, "url": "http://localhost:3000/api/v3/things/$THING$/set_user_defined_properties", "type": "ThingUserDefinedPropertiesAction" }, { "body": "", "created_at": 1448514914, "headers": { }, "method": "GET", "notification_action_key": "dt1b22767c", "query": { }, "updated_at": 1448514914, "url":...
Request - listing notification based on action type curl -X GET -H "Content-Type:application/json" -H 'X-Auth-Token:SMvLmYkkIVSYrrEQZSix0Q' -d '{"rule_key":"a24e3747bd", "type":"EmailNotificationAction"}' https://api.datonis.io/api/v3/notification_actions Response (returns notification actions of type "EmailNotificationAction") { "total_count": 1, "page": 1, "notification_actions": [ { "bcc": "", "body": null, "cc": "john@acme.com", "created_at": 1448514905, "notification_action_key": "e18c3t386e", "subject": null, "to": "bill@acme.com", "updated_at": 1448514905, "type": "EmailNotificationAction" } ] }