Data push

 

Property

Type

Description

name

string

Unique name of the campaign (64 characters max).

id

integer

read-only parameter

Unique identifier of the campaign.

audience

object

Optional.

Specify which users will be targeted by this campaign (65535 bytes max, see Audience format). By default, all users will be targeted.

System_CAPS_noteNote

If you set pushMode property to manual, the only thing you can specify in the audience is the push quota filter.

category

string

Optional. Android, IOS, or Web. Category of the campaign (64 characters max). Categories can be used on the application side to identify if and how the content should be processed.

pushMode

string

Optional. Defines how the campaign is pushed. Valid values are:

  • real-time : Never ending campaign, the campaign will be delivered to your existing users and also to your new users.

  • one-shot : In this mode, the campaign will be delivered only to your existing users (campaign will stop after that).

  • manual : In this mode, the campaign will not be pushed automatically to devices. You will have to use the Push campaign command to push the campaign to your end-users. Campaigns can be pushed multiple times to the same device.

Default value: real-time

type

string

Type of data push. Valid values are:

  • text/plain : Text-only data push. body property should only contain plain text.

  • text/base64 : Base 64 data push. body property must be encoded in base 64.

startTime

string

Optional. The date at which the campaign should be started. The date shall conform to the following format: yyyy-MM-dd HH:mm'Z'.

System_CAPS_noteNote
  • If you set pushMode property to manual, this attribute will be ignored.

  • If you set pushMode property to one-shot, then the timezone attribute must be specified.

Example: 2011-11-21 15:23Z

endTime

string

Optional. The date at which the campaign should be finished. The date shall conform to the following format: yyyy-MM-dd HH:mm'Z'.

Example: 2011-11-21 15:23Z

timezone

string

Optional. The id of the time zone to use for the startTime and endTime dates
(see Supported Time-Zones for a list of valid values). If not provided, the two date attributes will be expressed using the device timezone.

Example: America/Los_Angeles

body

string

Body of the datapush (65535 bytes max). Body format is defined by the type property.

This field supports AppInfo markers.

localization

object

Optional. Reach campaigns can be localized using an optional JSON object. The JSON key is a two-character language code as specified by the ISO 639-1 standard. The corresponding value is an object containing the localizable property body.

Example:

"localization": {
  "en": {
    "body": "My english data push..."
  },

  "fr": {
    "body": "Mon data push français..."
  }
}

AppInfo markers are special strings which are replaced with user information (also known as appInfo) when the campaign is pushed. This is used to create personalized campaigns based on appInfo.

The format of the replacement string is ${<appInfo>} where <appInfo> is the key of the appInfo that should be replaced. The appInfo of a device can be updated using the Tag devices command or using the SDK’s sendAppInfo: function.

For instance, consider the following text:

Hello ${name}.

When the campaign is pushed on a device, ${name} is replaced with the content of the appInfo identified with key name for the corresponding user.

Since personalization works by replacing a marker by its related appInfo content, you have to make sure the user has the proper appInfo defined. Here we suppose the targeted user has an appInfo named ${name} with value being set to the name of the user.

See the format above to know which fields are supporting appInfo markers.

{
  "name": "MyDatapush",
  "type":"text/base64"
  "deliveryTime": "when-started",
  "body": "QWxsIHlvdXIgcHVzaCBhcmUgYmVsb25nIHRvIHVz",
}
Show: