Overview

Push to Segment API (also known as the Push to Contact Source API) with inline content, can be used from an external system, but not from the Watson Campaign Automation UI.

Note: If user wants to send a rich notification using this API, the rich content has to be created first using the Create Rich Content API (POST:/channels/push/richcontent) or a valid rich content ID should be used. If a user wants to send an in-app notification using this API, the inapp content has to be created first using the InApp Content API (POST:/channels/push/inappcontent) or a valid inapp content ID should be used

Functionalities available

The Push to Segment API with inline content call has POST functionalities.

  • POST: This call sends a push notification.

POST /channels/push/sendjobs

Swagger URL

https://api[your pod number].silverpop.com/restdoc/#!/channels/send_push_to_segment_inline_source_post_

Scenarios that can be accomplished using this API

  • Send to a predefined contact source/segment (database, query or contact list created in WCA) using content defined in the API payload.

The following Mobile app messages supported:

    • Simple
    • Simple + inbox (rich content has to be created prior to using this API and must have a valid richcontent ID, please see the Create Rich Content API)
    • Simple + Extension
    • Inbox only (rich content has to be created prior to using this API and must have a valid richcontent ID, please see the Create Rich Content API)
    • In-App only
    • Data only

Additional information about this API:

      • Regular personalization can only be used with information known to Watson Campaign Automation.
      • Relational table personalization is supported (with 18.1 release, no error validation available).
      • This API does check mobile app frequency limits and honors them.
      • Messages can be scheduled
      • Pre-processing can be specified, see the preBlockingHours attribute.
      • Can schedule based on recipient’s timezone, see useRecipientTimezone attribute.

Request Body

SendJobWithInlineSpecification

Attribute Required Description Data Type
appKeys Yes List of App keys Array[String]
contactSourceId No ID of the contact source (ie. Database, contact list, query) long
campaignName Yes Campaign name string
messageName Yes Message name string
folder No Message folder location String
scheduledDate No Date on which the push notification is to be sent Date
preBlockingHours No Value representing the blocking time before send the push notification Int
useRecipientTimeZone No Whether or not to use recipient time zone for Push notification Boolean
Content Yes Content for push notification model

InlinePushContent

Attribute Required Description Data Type
InboxMessage No Inbox message content model
InAppMessage No InApp message content model
Simple No Contents for push notification model

InboxMessage

Attribute Required Description Data Type
expirationDate Yes Inbox message expiration date represented in a String as per RFC 3339 (‘1970-01-01T00:00:00.000+00:00’), Date
richContentID** Yes Inbox message rich content ID – see Create Rich Content (POST) String

**publishedmessageID from Watson Campaign Automation cannot be used here.

InAppMessage

Attribute Required Description Data Type
expirationDate Yes InApp message expiration date represented in a String as per RFC 3339 (‘1970-01-01T00:00:00.000+00:00’) Date
maxViews Yes Maximum number of views on the InApp message Integer
inAppContentId Yes InApp message content id – See Create InApp Content (POST) API call InAppContentId

SimplePushContent

Attribute Required Description Data Type
aps No Push content for iOS devices iOSPushPayload
gcm No Push content for Android devices AndroidPushPayload
wns No Push content for Windows devices WindowsPushPayload

iOSPushPayload

Attribute Required Description Data Type
aps No APS model
notification-action No Action to perform when notification is pressed model
Data No Map of key value pairs as data content model
media-attachment No media url send with the nofitication String

APS

Attribute Required Description Data Type
alert No Message to show on notification String
badge No Number to show on App Integer

IosAlertNode

Attribute Required Description Data Type
title No Title of notification String
subtitle No Subtitle of notification String
body No Message of notification String

Action

Attribute Required Description Data Type
type Yes Type of action to perform String
name No Name of action to display on notification String
value Yes Parameters of action JSONnode

AndroidPushPayload

Attribute Required Description Data Type
alert No Android push contents AndroidAlertNode – model
Data No Map of key value pairs as data content model

AndroidAlertNode

Attribute Required Description Data Type
subject No Subject of notification String
message No Message of notification String
notification-action No Action to perform when notification is pressed model

WindowsPushPayload

Attribute Required Description Data Type
contentType No Windows push payload content type String
Xml No Windows push payload xml content String

Sample JSON Request Body

Simple Message

{
  "appKeys": [
    "gcU6M2fD9P"
  ],
  "contactSourceId": "332229",
  "campaignName": "Black Friday 2017 Offer",
  "messageName": "Black Friday 2017 morning Promotion",
  "useRecipientTimeZone":"true",
  "scheduledDate":"2017-04-18T16:30:51.123+00:00",
  "content": {
    "simple": {
      "gcm": {
        "alert": {
         "subject": "Special Black Friday Sale!",
          "message": "Extra 20% off for purchases before midnight!",
          "notification-action": {
            "type": "url",
            "name": "URL",
            "value": "http://www.ibm.com"
          }
        }
      }
    }
  }
 }

Personalization Example

personalization fields (first_name, last_name) are contact attributes known/within to Watson Campaign Automation

"contactSourceId": "1234567",
  "campaignName": "Push to segment with inline",
  "messageName": "Demo message name",
  "appKeys": [
    "apIOSappkey",
    "gcAndroidAppkey"
  ],
  "content": {
    "simple": {
      "apns": {
        "aps": {
          "alert": "Simple personalization test for %%first_name%% %%last_name%%",
          "sound": "default"
        },
        "notification-action": {
          "type": "url",
          "value": "http://www.ibm.com"
        }
      },
      "gcm": {
        "alert": {
          "subject": "Simple personalization test for %%first_name%% %%last_name%%",
          "message": "Simple",
          "notification-action": {
            "type": "url",
            "value": "http://www.ibm.com"
          },
          "highPriority": false,
          "sensitive": false
        }
      }
    }
  }
 }

Join The Discussion

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