Notifications
List notifications: GET /notifications
This method returns the available notifications of the user
URL | https://api.sense-os.nl/notifications |
Method | GET |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|---|---|
total | Returns a count of the total amount of notifications | xsd:integer |
page | This parameter specifies which page of the results must be retrieved. The page offset starts at 0. | xsd:integer |
per_page | This parameter specifies the amount of items that must be received at once. The maximum amount is 1000 items and the default amount is 100 items. | xsd:integer |
Delete notification: DELETE /notifications/{id}
This method deletes a notification.
Triggers connect to this notification will become inactive.
URL | https://api.sense-os.nl/notifications/{id} |
Method | DELETE |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
Create notification: POST /notifications
This method creates a notification
Notifications can be of type email or url. For email notifications the destination is the email address and for url a http url.
A POST request will be executed for the supplied url with parameters as application/x-www-form-urlencoded body data.
Event Notifications:
When an url notification is connected to an event the following parameters are sent:
event = the event name
subject_id = the identifier of the object in question
source_id = optional identifier of the event location (e.g. group_id, domain_id, sensor_id)
user_id = the notification owner identifier
text = the text of the notification
Trigger Notifications:
When using the url notification, a post message with the variables:
sensor_id = sensor identifier
trigger_id = trigger identifier
text = the notification text
When using the email notification the body of the email will be the supplied text. The variables which are available in the trigger expression can also be used for the text field .
URL | https://api.sense-os.nl/notifications |
Method | POST |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
Request Body
The notification object
{ "notification": { "type": "url", "text": "A disturbing measurement occurred", "destination": "http:\/\/api.twitter.com\/1\/direct_messages\/new.json?screen_name=kees" } }
Update notification: PUT /notifications/{id}
This method updates a notification
URL | https://api.sense-os.nl/notifications/{id} |
Method | PUT |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
Request Body
The notification object
{ "notification": { "type": "url", "text": "A disturbing measurement occurred", "destination": "http:\/\/api.twitter.com\/1\/direct_messages\/new.json?screen_name=kees" } }
List all trigger notifications: GET /sensors/triggers/notifications
This method returns all the notifications that are connected to a sensor trigger together with sensor trigger information.
URL | https://api.sense-os.nl/sensors/triggers/notifications |
Method | GET |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
List trigger notifications: GET /sensors/{id}/triggers/{trigger_id}/notifications
This method returns the notifications that are connected to a sensor trigger.
URL | https://api.sense-os.nl/sensors/{id}/triggers/{trigger_id}/notifications |
Method | GET |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
Add notification to a sensor trigger: POST /sensors/{id}/triggers/{trigger_id}/notifications
URL | https://api.sense-os.nl/sensors/{id}/triggers/{trigger_id}/notifications |
Method | POST |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|
Request Body
The notifications array
{ "notifications": [ { "notification": { "id": 2 } }, { "notification": { "id": 1 } } ] }
Remove notification from trigger: DELETE /sensors/{id}/triggers/{trigger_id}/notifications/{notification_id}
This method removes a notification from a sensor trigger.
URL | https://api.sense-os.nl/sensors/{id}/triggers/{triggerid}/notifications/{notificationid} |
Method | DELETE |
Need Auth | True |
Request Headers
Name | Default | Type | Style | Required |
---|---|---|---|---|
Accept | * | xsd:string | header | True |
Request Parameters
Name | Description | Type |
---|