Skip to main content
Skip table of contents

Message format – general notifications

Overview

The message format for general (operator-initiated) notifications depends on whether the message is sent using one of the DMM APIs or using Operator Console (OpCon).

Messages sent using DMM

Example payload of a request sent to DMM:

JSON
{
  "envelope": {
    "event": "Payment due notification",
    "id": "b7a1e934-961a-42d4-9093-20e6d977dabc",
    "app_id": 3649,
    "from": "account-management-service",
    "expiration": 60000
  },
    "message": "Your subscription ends on 25/05/2018."
}

Payload of the corresponding notification received by the client:

JSON
{
  "data": {
    "default":
      "{
        "envelope":{
          "event":"Payment due notification",
          "id":"b7a1e934-961a-42d4-9093-20e6d977dabc",
          "app_id":3649,
          "from":"account-management-service"
        },                 
          "message":"Your subscription ends on 25/05/2018."
        }"
   },
  "collapse_key": "do_not_collapse"
}

None of the fields in envelope are mandatory and typically none of them will be displayed by the client.

Although expiration is not mandatory (the request will not fail if you omit it), you are expected to provide a value for it.

The meaning of each field is as follows;

  • envelope.event – the message subject, usually the topic that the message is being sent to (if the message is being sent to a topic)

  • envelope.id – a unique value where a distinct message ID is required

  • envelope.app_id – a description of the message origin

  • envelope.from – the actor that sent the message

  • envelope.expiration – the message validity period (in seconds)

  • message – the freeform message that will be delivered

  • collapse_key – ignore – not for client use

Messages sent using OpCon

Example payload for a message sent through OpCon:

JSON
{
  "envelope": {
    "event": "SubscriberInformationMessage",
    "id": "72bd2342-56e8-4afd-9dc2-ed8b20108a7e",
    "app_id": 1234,
    "from": "GlobalTopicForAllDevices",
    "expiration": 2025-08-231T23:59:59
  },    
  "message":"{
    "notification" : {
       "body" : "20% of all TVOD until Sunday",
       "title": "Discount Movies"
    },
    "data" : {
       "body" : "20% of all TVOD until Sunday",
       "title": "Discount Movies" 
    }
  }
}

The fields in the OpCon Publish Message screen correspond to the fields in the message payload received by the client as follows:

Field in payload

Source

envelope.event

Event Type field in the OpCon Publish Message screen

envelope.id

Automatically set to a UUID.

envelope.app_id

Automatically set to a hard-coded value.

envelope.from

The name of the selected topic

envelope.expiration

Message Expiration field in the OpCon Publish Message screen

message.notification.title

Message Title field in the OpCon Publish Message screen

message.data.title

message.notification.body

Message Body field in the OpCon Publish Message screen

message.data.body

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.