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 Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
NOTIFICATIONRULEID ID associated with the notification rule 575ec7417ae143cd83dc4a95

Request Headers

Name Required Description Default
Authorization Y The 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

Code Type Description
200 Success If notification rule was successfully deleted

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
NOTIFICATIONRULEID ID associated with the notification rule 575ec7417ae143cd83dc4a95

Request Headers

Name Required Description Default
Authorization Y The 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

Code Type Description
202 Job Enqueued API Result If the evaluation was successfully queued

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
NOTIFICATIONRULEID ID associated with the notification rule 575ec7417ae143cd83dc4a95

Request Headers

Name Required Description Default
Authorization Y The 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

Code Type Description
200 Notification Rule Notification rule information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
NOTIFICATIONRULEID ID associated with the notification rule 575ec7417ae143cd83dc4a95

Request Query Parameters

Name Required Description Default Example
limit N Max log entries to return (ordered by time descending) 1 limit=10
since N Look for log entries since this time (ms since epoch) since=1465790400000

Request Headers

Name Required Description Default
Authorization Y The 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

Code Type Description
200 Notification Rule Delivery Logs Notification delivery information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
NOTIFICATIONRULEID ID associated with the notification rule 575ec7417ae143cd83dc4a95

Request Headers

Name Required Description Default
Authorization Y The 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

Code Type Description
200 Notification Rule Updated notification rule information

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if notification rule was not found

Was this page helpful?


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