Receive Notifications

Introduction

MOOST delivers the generated notifications to a REST Endpoint which can be specified by you ("Customer"). You can then deliver these notifications to your households ("End-users") e.g. via Firebase Cloud Messaging.

The MOOST Recommender Platform delivers Notifications to Customer’s specified REST Endpoint. The Endpoint that should be used can be configured as a per Customer, per End-user or a combination of both.

REST Endpoint

To send notifications to the REST Endpoint, the Endpoint has to be exposed on a public domain that can be accessed via Internet. Any REST Endpoint that is accessible via Internet should be protected via authentication. The MOOST Recommender Platform is able to authenticate against a Customer’s REST Endpoint via various authentication methods.

Authentication

The Recommender Platform is able to authenticate against a Customer REST Endpoint via various authentication methods as listed below.

Username / Password

The Recommender Platform can be configured to authenticate against a customer’s REST endpoint with username and password (i.e. “Basic” authentication).

API-Token

The Recommender Platform can be configured to use an API-Token to authenticate against a customer REST Endpoint.

Bearer-Token

The Recommender Platform can be configured to use a Bearer Token to authenticate against a Customer REST Endpoint.

API Throttling

If the Customer’s REST Endpoint is protected against DDOS attacks with some kind of request throttling the Customer should inform MOOST during the integration phase about the limitations that are in place. MOOST will configure the Recommender Platform accordingly.

If the limits are exceeded, the MOOST Recommender Platform will not able to send all notifications back to the Customer’s REST Endpoint. Cusermers are encouraged to ensure that the chosen limitation is in line with the expected notifications per time unit.

Notification Schema

An example of a notification object which will be sent to the Customer’s REST Endpoint is shown below. The notification object will be posted to the specified Customer’s REST Endpoint as a JSON message in the body.

{
    "id": "631b3a453d6ddc7effeebb17",
    "message": {
      "de": "Sie haben gerade den Abwesenheitsmodus aktiviert, aber es scheint, dass noch Strom fliesst.",
      "en": "Away mode activated, but device [NAME] is still pulling full energy. Would you like to set up an automation to turn off your switch when leaving home?",
      "fr": "Vous venez d'activer le mode d'extinction, mais il semble que le courant continue de circuler."
    },
    "title": {
      "de": "Aktiver Stromfluss Erkannt",
      "en": "Power consumption",
      "fr": "Flux de courant actif"
    },
    "actions": [{
      "actionQualifier": "DISMISS",
      "text": {
        "de": "Schliessen",
        "en": "Dismiss",
        "fr": "Rejeter"
      }
    },
    {
      "actionQualifier": "OPENAPP",
      "text": {
        "de": "App öffnen",
        "en": "Open app",
        "fr": "Ouvrir l'application"
      },
      "parameter": {
        "de": "https://myapp.com/de/aktiver_stromfluss",
        "en": "https://myapp.com/en/power_consumption",
        "fr": "https://myapp.com/fr/flux_de_courant"
      }
    },
    {
      "actionQualifier": "STOPDELIVERY",
      "text": {
        "de": "Benachrichtigung ausschalten",
        "en": "Do not notify again",
        "fr": "Désactiver les notifications"
      }      
    },
    {
      "actionQualifier": "OPENWEB",
      "text": {
        "de": "Webseite öffnen",
        "en": "Goto website",
        "fr": "Ouvrir la page web"
      },
      "parameter": {
        "de": "https://myapp.com/de/aktiver_stromfluss",
        "en": "https://myapp.com/en/power_consumption",
        "fr": "https://myapp.com/fr/flux_de_courant"
      }
  }],
  "createdAtTimeMillis": 1662728773479,
  "customerId": "6149884d0aafc84cb196d4c8",
  "ruleId": "61e19fc6c7e5a80a4c764213",
  "userId": "6149884d0aafc84cb196d4c8",
  "priority": "high"
}

Actions

A notification includes an array of one or two actions that should be presented to the End-user. The actions consists out of a field “text” which contains the text that should be presented to the End-user in the different languages and a field “action” which contains the action qualifier which should be returned to the MOOST API when the action is selected by the end-user.

The Recommender Platform has the following action qualifiers:

  • DISMISS

  • OPENAPP

  • STOPDELIVERY

  • OPENWEB

DISMISS

The DISMISS actionQualifier states that the push notification should be dismissed when this action is selected be the end-user.

{
  "actionQualifier": "DISMISS",
  "text": {
    "de": "Schliessen",
    "en": "Dismiss",
    "fr": "Rejeter"
}

OPENAPP

The OPENAPP action states that when this action is selected by the the end-user, then the app should be opened. The optional parameter attribute may contain a language specific value, such as e.g. an URL or a use case name.

{
  "actionQualifier": "OPENAPP",
  "text": {
    "de": "APP öffnen",
    "en": "Open app",
    "fr": "Ouvrir l'application"
  }
},
"parameter": {
  "de": "https://myapp.com/de/aktiver_stromfluss",
  "en": "https://myapp.com/en/power_consumption",
  "fr": "https://myapp.com/fr/flux_de_courant"
}

STOPDELIVERY

The STOPDELIVERY action states that when this action is selected the push-notification should be dismissed and the actionQualifier should be returned to the MOOST API implicating that no more notifications of this type should be sent to the End-user.

{
  "actionQualifier": "STOPDELIVERY",
  "text": {
    "de": "Benachrichtigung ausschalten",
    "en": "Do not notify again",
    "fr": "Désactiver les notifications"
  }      
}

OPENWEB

The OPENWEB action states that when this action is selected by the the end-user, then a browser should be opened. The optional parameter attribute may contain a language specific value, typically an URL.

{
  "actionQualifier": "OPENWEB",
  "text": {
    "de": "Seite öffnen",
    "en": "Goto website",
    "fr": "Ouvrir la page web"
  },
  "parameter": {
    "de": "https://myapp.com/de/aktiver_stromfluss",
    "en": "https://myapp.com/en/power_consumption",
    "fr": "https://myapp.com/fr/flux_de_courant"
  }
}

Last updated

© 2023 MOOST AG