Presets

post
/createPreset

https://cp.pushwoosh.com/json/1.3/createPreset
Creates a new preset.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
name
required
string
Preset name.
applicationCode
required
string
Pushwoosh app code.
campaignCode
optional
string
Code of a campaign to which you want to assign this preset.
content
required
object
Message content parameters.
content.message
required
string
String or object. Message text. In case it's a string, the default language is used.
content.title
optional
object
Cross-platform multi-language push title. String or object. If separate titles for platforms are needed, use platform-specific title or header instead.
content.action
optional
object
Custom action parameters. See the example below.
content.userData
optional
array
Custom user data. Will be passed as "u" parameter in the payload (converted to JSON string).
content.platforms
optional
array
Specific content for different platforms. See the example below.
scheduling.sendRate
optional
integer
Throttling. Valid values are from 100 to 1000 pushes/second.
segmentation
optional
object
Segmentation parameters
segmentation.filter
optional
string
Filter name
segmentation.platforms
optional
array
Array of integers. The list of platforms ids. 1 - iOS, 2 - BB, 3 - Android, 5 - Windows Phone, 7 - OS X, 8 - Windows 8, 9 - Amazon, 10 - Safari, 11 - Chrome, 12 - Firefox. Ignored if "devices"<10
Response
200: OK
{
"status_code":200,
"status_message":"OK"
}
Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // required, string. API access token from Pushwoosh Control Panel.
"name": "PRESET_NAME", // required, string.
"applicationCode": "XXXXX-XXXXX", // required, string. Pushwoosh application code.
"applicationGroupCode": "AAAAA-BBBBB", // optional, string. Can be used instead of "applicationCode".
"campaignCode": "CCCCC-DDDDD", // optional, string. Campaign code.
"content": { // required, array. Contains message data.
"message": { // required, string or array. Message content. In case it's a string, the default language will be used.
"en": "English message", // Message content localized for different languages. Only ISO 639-1:2002 for language codes.
"fr": "French message"
},
"title": {
"en": "Title", // Message title localized for different languages. Common for all platforms. If separate titles for platforms are needed, use platform-specific title or header instead.
"fr": "Tutle"
},
"action": { // optional, array. Action to be performed once a user opens a message.
"type": "url", // string. Type of action. Available types: `url`, `deepLink`, `richMedia`, `openApp`(default).
"options": { // array. Options for action types. Required for all action types except for `openApp`.
"url": "http://example.com", // required for `url` action type, string. Will be shortened if shortener is defined.
"shortener": 2, // optional, integer. Available values: 0 — do not minimize, 2 — bit.ly. If no shortener is specified, bit.ly shortener will be used by default.
"richMediaCode": "BBBBB-AAAAA", // required for `richMedia` action type, string. Rich Media code from Pushwoosh Control Panel.
"id": 123, // required for "deepLink" action type, integer. Deep Link ID.
"params": { // custom parameters, required for "deepLink" action type, array.
"param1": "value1",
"param2": "value2"
}
}
},
"userData": { // optional, object. Custom user data. Will be passed as "u" parameter in the payload (converted to JSON string).
"CustomData": "value"
},
"platforms": {// optional, object. Specific content for different platforms.
// See the platform-specific examples in /createMessage request.
}
},
"scheduling": { // optional, object. Scheduling options.
"sendRate": 1000 // optional, integer. Throttling. Valid values are from 100 to 1000 pushes/second.
},
"segmentation": { // required, object. Segmentation options.
"filter": "FILTER NAME", // optional, string. Filter name from your Pushwoosh Control Panel.
"platforms": [11,3] // required, array. The list of platforms IDs: 1 — iOS; 2 — BB; 3 — Android; 5 — Windows Phone; 7 — OS X; 8 — Windows 8; 9 — Amazon; 10 — Safari; 11 — Chrome; 12 — Firefox; ignored if "devices" < 10
}
}
}

For platform-specific parameters, please refer to /createMessage.

post
/getPreset

https://cp.pushwoosh.com/json/1.3/getPreset
Retrieves the parameters of the specific push preset.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
preset_code
required
string
Push preset code to retrieve information for.
Response
200: OK
{
"status_code":200,
"status_message":"OK",
"response":{
"preset":{
"code":"XXXXX-XXXXX",
"name":"Full preset",
"page_id":26,
"url":null,
"content":{
"en":"Some eng message",
"ru":"\u041a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0435\u043a\u0441\u0442"
},
"title": {
"en": "Title",
"fr": "Tutle"
},
"properties":{
"ignore_user_timezone":1,
"ios_badges":"5",
"ios_sound":"default",
"ios_ttl":"43200",
"android_sound":"Sound1.wav",
"android_custom_icon":"icon.png",
"android_header":"android_header",
"android_gcm_ttl":"43200",
"wns_type":"toast",
"wns_content":{
"template":"ToastImageAndText02",
"lang-en":{
"headlinetext":"Title",
"bodytext":"super text"
},
"languages":["en", "zh", "it", "sv", "de", "fr", "ru", "pt", "nl", "es"],
"lang-zh":{
"headlinetext":"",
"bodytext":""
},
"lang-it":{
"headlinetext":"",
"bodytext":""
},
"lang-sv":{
"headlinetext":"",
"bodytext":""
},
"lang-de":{
"headlinetext":"",
"bodytext":""
},
"lang-fr":{
"headlinetext":"",
"bodytext":""
},
"lang-ru":{
"headlinetext":"",
"bodytext":""
},
"lang-pt":{
"headlinetext":"",
"bodytext":""
},
"lang-nl":{
"headlinetext":"",
"bodytext":""
},
"lang-es":{
"headlinetext":"",
"bodytext":""
},
"imagesource":"http:\/\/image.com\/jpg"
},
"blackberry_header":"Some Header",
"adm_sound":"song",
"adm_custom_icon":"i5.bmp",
"adm_header":"Amazon Header",
"adm_ttl":"7200",
"wp_type":"Tile",
"wp_background":"i1.png",
"wp_count":5,
"wp_backbackground":"i2.png",
"wp_backtitle":"back title",
"wp_backcontent":"back content",
"safari_title":"Safari title",
"safari_action":"OK",
"safari_url_args":["hello.com", ""],
"safari_ttl":"43200",
"userdata":"{\"custom\":\"data\"}",
"created_via":"CP",
"user_id":2,
"filter_id":"1"
},
"platforms":[1,2,3,5,7,8,9,10,11,12,13,17]
}
}
}
Example
{
"request":{
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"preset_code": "AAAAA-BBBBB" // push preset code to retrieve information for
}
}

post
/listPresets

https://cp.pushwoosh.com/json/1.3/listPresets
Retrieves the list of presets created for the app.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
application
required
string
Pushwoosh app code.
Response
200: OK
No presets
Presets list
No presets
{
"status_code": 200,
"status_message": "OK",
"response": {
"presets": []
}
}
Presets list
{
"status_code": 200,
"status_message": "OK",
"response": {
"presets": [
{
"name": "test",
"code": "AAAAA-BBBBB"
}
]
}
}
{
"request": {
"auth" : "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"application": "XXXXX-XXXXX" // Pushwoosh app code
}
}

post
/deletePreset

https://cp.pushwoosh.com/json/1.3/deletePreset
Deletes a preset from your account.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
preset_code
required
string
Preset code retrieved from Pushwoosh Control Panel or /listPresets API response.
Response
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": null
}
Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"preset_code": "AAAAA-BBBBB" // code of a preset to delete
}
}