Notification destinations

One of the additional services of the BlueCherry platform is to monitor the online/offline state of a device. As soon as the state of a device changes the cloud will send a state change notification to all notification destinations. A notification destination can be notified through email, SMS, phone call or push notification. The notification destination list is synchronized with the cloud and can be modified by using this part of the API.

Retrieve all notification destinations

A simple HTTP GET request can be used to retrieve the most up-to-date list of notification destinations.

GET /api/internal/offline_notification_destinations HTTP/1.1
Host: 127.0.0.1:43770

Add a notification destination

You can add a notification destination by means of a HTTP POST request. The request JSON object must contain the following fields:

  • type: the type of communication to use for the notification:
    1. Email
    2. SMS
    3. Phone
    4. Push notification
  • destination: the address to send the stage change notification to. The address must match the type of communication.
  • lang: the language to send the notification in. Currently supported languages are nl, fr, de, en, it, pl, es
  • name: the name of the consignee.
POST /api/internal/offline_notification_destinations HTTP/1.1
Host: 127.0.0.1:43770
Content-Type: application/json
Content-Length: 98

{
    "type": 1,
    "destination": "john@johndoe.com",
    "lang": "nl",
    "name": "John Doe"
}

Update a notification destination

Updating a notification destination is done through a HTTP PUT request. The request body is the same as the POST body to add a new notification. The notification to update is identified by the id which is added to the end of the URL.

PUT /api/internal/offline_notification_destinations/2 HTTP/1.1
Host: 127.0.0.1:43770
Content-Type: application/json
Content-Length: 98

{
    "type": 1,
    "destination": "john@johndoe.com",
    "lang": "en",
    "name": "John Doe"
}

Delete a notification destination

Deleting a notification destination is done through an HTTP DELETE request. The notification destination to delete is identified by adding the id to the end of the URL.

DELETE /api/internal/offline_notification_destinations/3 HTTP/1.1
Host: 127.0.0.1:43770