Create rich content

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

AttributeData TypeDescription
personalizationDefaults (optional)MapMap of key value pairs for personalization defaults
personalizationFormulas (optional)MapMap of key value pairs for personalization formulas
payload
(optional)
MapRich Content Map

RichContentMap

AttributeData TypeDescription
gcm (optional)modeltemplate content
apns (optional)modeltemplate content

TemplateContent

AttributeData TypeDescription
template (optional)Stringtemplate type (such as, but not limited to default, post)
content (optional)JSON node – a collection of key/value pairscontent (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)

AttributeData TypeDescription
messagePreview (optional)modelmessage preview
messageDetails (optional)modelmessage details

MessagePreview

AttributeData TypeDescription
subject (optional)StringSubject of the message with optional personalization tags
previewContent (optional)StringContent of the preview with optional personalization tags

MessageDetails

AttributeData TypeDescription
richContent (optional)Stringcontent of rich push
actions (optional)JSON with actions definitionsarray 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)

AttributeData TypeDescription
contentVideo (optional)string, contains URLURL for a video
header (optional)stringMessage title (or message header)
subHeader (optional)stringMessage subtitle (or message sub header)
headerImage (optional)string, contains image URLImage URL
contentText (optional)stringmessage
actions (optional)JSON array with one or more actionsJSON 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
    }
  }
}
}
}