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 |
NOTIFICATION_RULE_ID | 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 |
NOTIFICATION_RULE_ID | 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 |
NOTIFICATION_RULE_ID | 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 |
NOTIFICATION_RULE_ID | 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 |
NOTIFICATION_RULE_ID | 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 |
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.