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:
{
"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:
{
"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 requiredenvelope.app_id– a description of the message originenvelope.from– the actor that sent the messageenvelope.expiration– the message validity period (in seconds)message– the freeform message that will be deliveredcollapse_key– ignore – not for client use
Messages sent using OpCon
Example payload for a message sent through OpCon:
{
"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 |
|---|---|
| Event Type field in the OpCon Publish Message screen |
| Automatically set to a UUID. |
| Automatically set to a hard-coded value. |
| The name of the selected topic |
| Message Expiration field in the OpCon Publish Message screen |
| Message Title field in the OpCon Publish Message screen |
| |
| Message Body field in the OpCon Publish Message screen |
|