Notifications

List notifications: GET /notifications

This method returns the available notifications of the user

URLhttps://api.sense-os.nl/notifications
MethodGET
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType
totalReturns a count of the total amount of notifications xsd:integer
pageThis parameter specifies which page of the results must be retrieved. The page offset starts at 0. xsd:integer
per_pageThis 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.

URLhttps://api.sense-os.nl/notifications/{id}
MethodDELETE
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

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 .

URLhttps://api.sense-os.nl/notifications
MethodPOST
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

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

URLhttps://api.sense-os.nl/notifications/{id}
MethodPUT
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

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.

URLhttps://api.sense-os.nl/sensors/triggers/notifications
MethodGET
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

List trigger notifications: GET /sensors/{id}/triggers/{trigger_id}/notifications

This method returns the notifications that are connected to a sensor trigger.

URLhttps://api.sense-os.nl/sensors/{id}/triggers/{trigger_id}/notifications
MethodGET
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

Add notification to a sensor trigger: POST /sensors/{id}/triggers/{trigger_id}/notifications

URLhttps://api.sense-os.nl/sensors/{id}/triggers/{trigger_id}/notifications
MethodPOST
Need AuthTrue
#### Request Headers
NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType

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.

URLhttps://api.sense-os.nl/sensors/{id}/triggers/{triggerid}/notifications/{notificationid}
MethodDELETE
Need AuthTrue

Request Headers

NameDefaultTypeStyleRequired
Accept*xsd:stringheaderTrue

Request Parameters

NameDescriptionType