Push Notification Payload
| This document describes the payload format for Emarsys SDK 4.0 and is not compatible with earlier versions of the SDK. |
The payload is an agreed format between the mobile engage backend and the Emarsys SDK.
EMS structure
The EMS (Emarsys) structure is common for all platforms and contains Emarsys specific data.
-
version- version of the platform payload format. -
trackingInfo- JSON string of object TrackingInfo -
rootParams- JSON object containing anything from the customer e.g. custom fields. -
customData- JSON object representing the campaign Custom Data
{
"version": "HUAWEI_V1",
"trackingInfo": "{}",
"rootParams": {},
"customData": {}
}
TrackingInfo
TrackingInfo are used for internal purposes like AB testing, former SID purposes, etc.
- campaignId - identifier of the campaign, this is the multichannel-id.
- sid - source identifier of the campaign. At some point we are going to remove it
- triggerRequestId - identifier of the trigger request. This is used to identify the trigger request in the backend.
{
campaignId: '1000',
sid: 'sid', //optional,
triggerRequestId: '123adsd34123', //optional
eventTreatments: [https://github.com/emartech/me-modules/blob/master/current/modules/me-event-publisher/src/types/index.ts#L90]
}
Action format
The format of actions is common for all platforms.
Common fields
-
type- The type of the action. -
reporting- It is a stringify object. This is used to identify the action in the backend. -
title- Title of the button when displayed on device.
Custom Event
-
name- name of the event. -
payload- data sent with the event. Should be only one level deep key-value pair.
{
"type" : "MECustomEvent",
"reporting" : "{ \"id\": \"customEvent\" }",
"title" : "customEvent",
"name" : "mysy3",
"payload" : {
"key" : "value"
}
},
OpenExternalUrl
-
url- URL to open in the external browser.
{
"type" : "OpenExternalUrl",
"reporting" : "{ \"id\": \"External url test\" }",
"title" : "ExternalURL",
"url" : "https://www.emarsys.com"
}
App Event
-
name- name of the event. -
payload- data sent with the event. Should be a key-value pair.
{
"type" : "MEAppEvent",
"reporting" : "{ \"id\": \"RelaseTestAppevent\" }",
"title" : "appEvent",
"name" : "RelaseTestAppevent"
"payload" : {
"appEventKey" : "appEventValue"
}
}
Push To Inapp
| This format is subject to change due to bigger changes in how in-app message content is handled. |
-
payload.url- URL of the in-app message.
{
"type" : "InApp",
"reporting" : "{ \"id\": \"PushToInappCampaign\" }",
"payload" : {
"url" : "https://mobile-events.eservice.emarsys.net/v5/apps/EMS11-C3FD3/messages/100447689?lang=en&expires=1726143956&sign=Xr2v_EQYOvcvcLl6_rKEX2SZbjgI-ROUsMDL36tCeV8",
},
}