Rich content can be defined by the Marketer in Acoustic Campaign or created using the Create Rich Content API.
Note:
This API is only for creating a rich message, not for sending a message. When this API is used a richcontentID will be produced and that richcontentID can be used in other APIs.
Functionalities available
The Create Rich Content API call has POST functionalities.
- POST: This call creates a rich push notification.
- POST /channels/push/richcontent
Swagger URL
[https://api-campaign-us-your pod number.goacoustic.com/restdoc/#!/channels/createRichContentsetpost
Inbox types supported
-
traditional
-
video
-
image
-
custom
Note:
Relational table personalization is not supported.
Request Body
RichContentRequest
Attribute | Data Type | Description |
---|---|---|
personalizationDefaults (optional) | Map | Map of key value pairs for personalization defaults |
personalizationFormulas (optional) | Map | Map of key value pairs for personalization formulas |
payload (optional) | Map | Rich Content Map |
RichContentMap
Attribute | Data Type | Description |
---|---|---|
gcm (optional) | model | template content |
apns (optional) | model | template content |
TemplateContent
Attribute | Data Type | Description |
---|---|---|
template (optional) | String | template type (such as, but not limited to default , post ) |
content (optional) | JSON node – a collection of key/value pairs | content (varies based on the template type used) |
Content – some sample content based on the templates used
Content is based on the type of inbox template used. The following are the attributes for Traditional inbox template (template
:default
)
Attribute | Data Type | Description |
---|---|---|
messagePreview (optional) | model | message preview |
messageDetails (optional) | model | message details |
MessagePreview
Attribute | Data Type | Description |
---|---|---|
subject (optional) | String | Subject of the message with optional personalization tags |
previewContent (optional) | String | Content of the preview with optional personalization tags |
MessageDetails
Attribute | Data Type | Description |
---|---|---|
richContent (optional) | String | content of rich push |
actions (optional) | JSON with actions definitions | array of actions |
Example (for template=default)
{
"personalizationDefaults": {},
"payload": {
"gcm": {
"template": "default",
"content": {
"messagePreview": {
"subject": "Black Friday Coupon",
"previewContent": "Here is your special 25% off coupon!"
},
"messageDetails": {
"richContent": "html message here<href="actionid:offer-link-1"> Click here!",
"actions": {
"offer-link-1": {
"type": "url",
"value": "http://ibm.com/offer"
}
}
}
}
}
}
}</href="actionid:offer-link-1">
Content for video inbox template (template: post)
Attribute | Data Type | Description |
---|---|---|
contentVideo (optional) | string, contains URL | URL for a video |
header (optional) | string | Message title (or message header) |
subHeader (optional) | string | Message subtitle (or message sub header) |
headerImage (optional) | string, contains image URL | Image URL |
contentText (optional) | string | message |
actions (optional) | JSON array with one or more actions | JSON array of actions |
Example for Video inbox template (template: post)
{
"personalizationDefaults": {},
"personalizationFormulas": {},
"payload": {
"apns": {
"template": "post",
"content": {
"contentVideo": "https://ia800207.us.archive.org/8/items/test-mpeg/test-mpeg_512kb.mp4",
"header": "This is the video",
"subHeader": "Video inbox subtittle",
"headerImage": "https://i.ytimg.com/vi/fVmVpjMnuI0/maxresdefault.jpg",
"contentText": "Here is your notification message",
"actions": [
{
"name": "Visit IBM!",
"type": "url",
"value": "http://www.ibm.com"
},
{
"name": "Call IBM",
"type": "dial",
"value": "18002255426"
},
{
"name": "Visit Apple",
"type": "url",
"value": "http://apple.com"
}
]
}
}
}
}
Similar rich content would be created for an image template. However, instead of contentVideo, you would have the contentImage attribute.
{
"personalizationDefaults": {},
"personalizationFormulas": {},
"payload": {
"apns": {
"template": "post",
"content": {
"contentImage": "https://i.pinimg.com/736x/92/c5/43/92c543d77ebbd1a5f80195eef163b034.jpg",
"header": "Image content title",
"subHeader": "image subtitle",
"headerImage": "https://i.pinimg.com/originals/dc/b3/e6/dcb3e60c84536d12faeca0616174c6a2.jpg",
"contentText": "image notification message",
"actions": [
{
"name": "Secret Garden!",
"type": "url",
"value": "http://www.butchartgardens.com/"
},
{
"name": "Call for help",
"type": "dial",
"value": "1234567890"
},
{
"name": "Tickets",
"type": "url",
"value": "http://www.butchartgardens.com/visit/rates"
}
]
}
}
}
}
Rich Content ID
After using the Create Rich Content API, you can use the generated richContentID in the APIs when you are sending a rich push notification.
Example of a simple plus inbox message
{
"contactSourceId": 44171,
"campaignName": "Test",
"messageName": "IBMTestJul28.21",
"appKeys": [
"gc04a3eawx"
],
"content": {
"inboxMessage": {
"expirationDate": "2017-10-25T22:34:51.123+00:00",
"richContentId": "REPLACE_WITH_RICH_CONTENT_ID"
},
"simple": {
"gcm": {
"alert": {
"subject": "Simple with inbox mobile app message example",
"message": "Find your 25% coupon in your inbox!",
"notification-action": {
"template": "default",
"name": "Show Inbox Notification",
"value": "SimpleWithInboxId",
"type": "openInboxMessage"
},
"highPriority": false,
"sensitive": false
}
}
}
}
}