Skip to main content

Instance Notification Rule Actions

https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Below are the various requests that can be performed against the Instance Notification Rule resource, as well as the expected parameters and the potential responses.

Delete

Deletes a notification rule

Method And Url

DELETE https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceNotificationRule.*, or instanceNotificationRule.delete.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec7417ae143cd83dc4a96
NOTIFICATION_RULE_IDID associated with the notification rule575ec7417ae143cd83dc4a95

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X DELETE \
https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Successful Responses

CodeTypeDescription
200SuccessIf notification rule was successfully deleted

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if notification rule was not found

Evaluate

Queues the evaluation of a notification rule

Method And Url

POST https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID/evaluate

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceNotificationRule.*, or instanceNotificationRule.evaluate.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec7417ae143cd83dc4a96
NOTIFICATION_RULE_IDID associated with the notification rule575ec7417ae143cd83dc4a95

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Notification Rule Evaluation Options schema. For example, the following would be a valid body for this request:

{
"ignoreFrequencyCheck": true
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"ignoreFrequencyCheck":true}' \
https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID/evaluate

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultIf the evaluation was successfully queued

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if notification rule was not found

Get

Retrieves information on a notification rule

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceNotificationRule.*, or instanceNotificationRule.get.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec7417ae143cd83dc4a96
NOTIFICATION_RULE_IDID associated with the notification rule575ec7417ae143cd83dc4a95

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Successful Responses

CodeTypeDescription
200Notification RuleNotification rule information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if notification rule was not found

Logs

Retrieves information on notification rule deliveries

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID/logs

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceNotificationRule.*, or instanceNotificationRule.logs.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec7417ae143cd83dc4a96
NOTIFICATION_RULE_IDID associated with the notification rule575ec7417ae143cd83dc4a95

Request Query Parameters

NameRequiredDescriptionDefaultExample
limitNMax log entries to return (ordered by time descending)1limit=10
sinceNLook for log entries since this time (ms since epoch)since=1465790400000

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID/logs

Successful Responses

CodeTypeDescription
200Notification Rule Delivery LogsNotification delivery information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if notification rule was not found

Patch

Updates information about a notification rule

Method And Url

PATCH https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceNotificationRule.*, or instanceNotificationRule.patch.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec7417ae143cd83dc4a96
NOTIFICATION_RULE_IDID associated with the notification rule575ec7417ae143cd83dc4a95

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Notification Rule Patch schema. For example, the following would be a valid body for this request:

{
"name": "My Updated Notification Rule",
"enabled": false
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"name":"My Updated Notification Rule","enabled":false}' \
https://api.losant.com/instances/INSTANCE_ID/notification-rules/NOTIFICATION_RULE_ID

Successful Responses

CodeTypeDescription
200Notification RuleUpdated notification rule information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if notification rule was not found

Schemas

Error

Schema for errors returned by the API

Error Schema

  • {} 3 keys
    • "http://json-schema.org/draft-07/schema#"
    • "object"
    • {} 2 keys
      • {} 1 key
        • {} 1 key

      Error Example

      • {} 2 keys
        • "NotFound"
        • "Application was not found"

      Job Enqueued API Result

      Schema for the result of a job being queued

      Job Enqueued API Result Schema

      • {} 3 keys
        • "http://json-schema.org/draft-07/schema#"
        • "object"
        • {} 3 keys
          • {} 2 keys
            • {} 2 keys
              • {} 2 keys

            Job Enqueued API Result Example

            • {} 3 keys
              • true
              • "clnHvJbyVkOWAZwYAwLP4"
              • true

            Notification Rule

            Schema for a single notification rule

            Notification Rule Schema

            • {} 3 keys
              • "http://json-schema.org/draft-07/schema#"
              • "object"
              • {} 18 keys
                • {} 2 keys
                  • {} 2 keys
                    • {} 2 keys
                      • {} 2 keys
                        • {} 2 keys
                          • {} 2 keys
                            • {} 2 keys
                              • {} 2 keys
                                • {} 2 keys
                                  • {} 2 keys
                                    • {} 2 keys
                                      • {} 2 keys
                                        • {} 3 keys
                                          • {} 2 keys
                                            • {} 1 key
                                              • {} 3 keys
                                                • {} 4 keys
                                                  • {} 4 keys

                                                Notification Rule Example

                                                • {} 16 keys
                                                  • "585ec7417ae143cd83dc4a95"
                                                  • "585ec7417ae143cd83dc4a95"
                                                  • "60106426dc03c6aad06560ba"
                                                  • "instance"
                                                  • "2016-06-13T04:00:00.000Z"
                                                  • "2016-06-13T04:00:00.000Z"
                                                  • "575ed70c7ae143cd83dc4aa9"
                                                  • "user"
                                                  • "575ed70c7ae143cd83dc4aa9"
                                                  • "user"
                                                  • "organization"
                                                  • "{}"
                                                  • "My Notification Rule"
                                                  • true
                                                  • {} 5 keys
                                                    • {} 4 keys

                                                    Notification Rule Delivery Logs

                                                    Schema for a set of Notification Rule delivery logs

                                                    Notification Rule Delivery Logs Schema

                                                    • {} 3 keys
                                                      • "http://json-schema.org/draft-07/schema#"
                                                      • "array"
                                                      • {} 2 keys

                                                      Notification Rule Delivery Logs Example

                                                      • [] 1 item
                                                        • {} 13 keys

                                                        Notification Rule Evaluation Options

                                                        Schema for evaluation options for a notification rule

                                                        Notification Rule Evaluation Options Schema

                                                        • {} 4 keys
                                                          • "http://json-schema.org/draft-07/schema#"
                                                          • "object"
                                                          • {} 1 key
                                                            • {} 1 key
                                                            • false

                                                          Notification Rule Evaluation Options Example

                                                          • {} 1 key
                                                            • true

                                                          Notification Rule Patch

                                                          Schema for the body of a notification rule modification request

                                                          Notification Rule Patch Schema

                                                          • {} 4 keys
                                                            • "http://json-schema.org/draft-07/schema#"
                                                            • "object"
                                                            • {} 7 keys
                                                              • {} 2 keys
                                                                • {} 3 keys
                                                                  • {} 2 keys
                                                                    • {} 1 key
                                                                      • {} 1 key
                                                                        • {} 1 key
                                                                          • {} 4 keys
                                                                          • false

                                                                        Notification Rule Patch Example

                                                                        • {} 2 keys
                                                                          • "My Updated Notification Rule"
                                                                          • false

                                                                        Success

                                                                        Schema for reporting a successful operation

                                                                        Success Schema

                                                                        • {} 3 keys
                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                          • "object"
                                                                          • {} 1 key
                                                                            • {} 2 keys

                                                                          Success Example

                                                                          • {} 1 key
                                                                            • true

                                                                          Was this page helpful?


                                                                          Still looking for help? You can also search the Losant Forums or submit your question there.