Poll
Format
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. Note If you set pushMode property to manual, the only thing you can specify in the audience is the push quota filter. |
|||||||||||||||
category |
string |
Optional. Category of the campaign (64 characters max). Categories can be used on the application side to customize campaigns. |
|||||||||||||||
pushMode |
string |
Optional. Defines how the campaign is pushed. Valid values are:
Default value: real-time |
|||||||||||||||
deliveryTime |
string |
Defines when the campaign should be delivered. Valid values are:
|
|||||||||||||||
deliveryActivities |
array |
Optional. Array containing the list of activities in which the campaign can be delivered. deliveryTime must be set to session. If the platform is iOS, this option can also be set if deliveryTime is set to any. In that case, if the campaign is received when the application is launched, it will be delivered only in the specified list of activities. |
|||||||||||||||
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'. Note
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 Example: America/Los_Angeles |
|||||||||||||||
notificationType |
string |
Optional. Android only. Defines how the notification should be displayed. Valid values are:
Default value: popup |
|||||||||||||||
notificationIcon |
boolean |
Optional. A flag indicating whether or not you want to display the resource icon in notification content. Default value: true |
|||||||||||||||
notificationCloseable |
boolean |
Optional. A flag indicating whether or not you want the notification to be closeable. Default value: true |
|||||||||||||||
notificationVibrate |
boolean |
Optional. Android only. A flag indicating whether or not you want the system notification to make a vibration. The notificationType property must be set to system. Default value: false |
|||||||||||||||
notificationSound |
boolean |
Optional.
Default value: falseiOS only |
|||||||||||||||
notificationBadge |
boolean |
Optional. A flag indicating whether or not you want the native Apple Push notification to update the badge icon to the number of unread messages. The deliveryTime property must be set to any or background. Default value: false |
|||||||||||||||
notificationTitle |
string |
Optional. Title of the notification (2000 characters max). This field supports AppInfo markers. |
|||||||||||||||
notificationMessage |
string |
Optional. Title of the notification (4000 characters max). This field supports AppInfo markers. |
|||||||||||||||
notificationImage |
string |
Optional. Optional image encoded in base 64 (65535 bytes max). Usually included in the right part of in app notifications (or as a banner if there is neither text nor content icon). For Android system notifications, the image is used as the large icon (displayed only on Android 3+). |
|||||||||||||||
notificationOptions |
object |
Optional. Additional platform specific options as a sub JSON object. The available properties are:
|
|||||||||||||||
title |
string |
Optional. Title of the announcement (128 characters max). This field supports AppInfo markers. |
|||||||||||||||
body |
string |
Optional. Description of the poll (65535 bytes max). This field supports AppInfo markers. |
|||||||||||||||
actionButtonText |
string |
Optional. Text of the action button (64 characters max). |
|||||||||||||||
exitButtonText |
string |
. Text of the exit button (64 characters max). |
|||||||||||||||
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 properties: title, body, notificationTitle, notificationMessage, notificationImage, notificationOptions, actionButtonText, exitButtonText. Example:
|
|||||||||||||||
questions |
array |
Array containing questions as described in the Poll question format. |
Poll question format
Property |
Type |
Description |
---|---|---|
title |
string |
Title of the question (256 characters max). |
id |
integer |
read-only parameter Unique identifier of the question. |
localization |
object |
Optional. Poll questions 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 title. Example:
|
choices |
array |
List of possible choices for this question. See Poll choice format. |
Poll choice format
Property |
Type |
Description |
---|---|---|
title |
string |
Title of the choice (256 characters max). |
id |
integer |
read-only parameter Unique identifier of the choice. |
localization |
object |
Optional. Poll choices 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 title. Example:
|
idDefault |
boolean |
Optional. A flag indicating if this choice is the default choice for the associated question. Only one choice in the array can have this value set to true. Default value: false |
AppInfo markers
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.
Example
{
"name": "MyPoll",
"deliveryTime": "any",
"title": "Talk me about you",
"body": "Some personal questions:",
"notificationTitle": "Some personal questions",
"notificationOptions": {
"bigText": "Your feedback matters.\nPlease take a moment to answer a few personal questions.\nIt will allow us to improve our services.\nThank you in advance."
},
"actionButtonText": "OK",
"localization": {
"fr": {
"title": "Parlez moi de vous",
"body": "Quelques questions personnelles:",
"notificationTitle": "Quelques questions personnelles",
"actionButtonText": "Valider",
"notificationOptions": {
"bigText": "Votre avis compte.\nVeuillez SVP nous accorder un peu de votre temps svp pour répondre à quelques questions personnelles.\nCela nous permettra d'améliorer nos services.\nMerci d'avance."
}
}
},
"questions": [
{
"title": "Are you a cat or a dog person?",
"localization": {
"fr": {
"title":"Etes-vous plutôt chien ou plutôt chat ?"
}
},
"choices": [
{
"title": "Cat",
"localization": {
"fr": {
"title": "Chat"
}
}
},
{
"title": "Dog",
"isDefault":true,
"localization": {
"fr": {
"title": "Chien"
}
}
}
]
},
{
"title": "Do you like bananas?",
"localization": {
"fr": {
"title":"Aimez vous les bananes ?"
}
},
"choices": [
{
"title": "I love bananas.",
"localization": {
"fr": {
"title": "J\u0027adore les bananes."
}
}
},
{
"title": "I hate bananas.",
"localization": {
"fr": {
"title":"Je déteste les bananes."
}
}
}
]
}
]
}