Overview

Rich content can be defined by the Marketer in Watson Campaign Automation 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[your pod number].silverpop.com/restdoc/#!/channels/createRichContentset_post_

Scenarios that can be accomplished using this API

  • Creating a rich push notification.

Inbox types supported

  • traditional
  • video
  • image
  • custom

Note: Relational table personalization is not supported

Request Body

RichContentRequest

Attribute Required Description Data Type
personalizationDefaults No Map of key value pairs for personalization defaults Map
personalizationFormulas No Map of key value pairs for personalization formulas Map
payload No Rich Content Map Map

RichContentMap

Attribute Required Description Data Type
gcm No template content model
apns No template content model
wns No template content model 

TemplateContent

Attribute Required Description Data Type
template No template type (such as, but not limited to “default”, “post”) String
content No content (varies based on the template type used) JSON node – a collection of key/value pairs

Content – some sample contents 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 Required Description Data Type
messagePreview No  message preview model
messageDetails No  message details model

MessagePreview

Attribute Required Description Data Type
subject No Subject of the message with optional personalization tags String
previewContent No  Content of the preview with optional personalization tags String

MessageDetails

Attribute Required Description Data Type
richContent No  content of rich push String
actions No array of actions JSON with actions definitions 

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 Click here!",
      "actions": {
        "offer-link-1": {
          "type": "url",
          "value": "http://ibm.com/offer"
        }
      }
    }
  }
}
}
}

Content for “Video” inbox template (“template”:”post”)

Attribute Required Description Data Type
contentVideo No URL for a video string, contains URL
header No Message title (or message header) string
subHeader No Message subtitle (or message sub header) string
headerImage No Image URL string, contains image URL
contentText No message string
actions No JSON array of actions JSON array with one or more 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
    }
  }
}
}
} 

Join The Discussion

Your email address will not be published. Required fields are marked *