Suggest Edits

/createMessage

Creates a new push notification

 
posthttps://cp.pushwoosh.com/json/1.3/createMessage
{
  "request": {
    "application": "XXXXX-XXXXX", // Your Pushwoosh application code
    "applications_group": "GROUP_CODE", // optional. Can be used instead of "application".
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "notifications": [
      {
        // Content settings 
        "send_date": "now",  // YYYY-MM-DD HH:mm OR 'now'
        "ignore_user_timezone": true, // or false
        "timezone": "America/New_York", // optional. If ignored UTC-0 is default for "send_date". See http://php.net/manual/timezones.php for supported timezones.
        "campaign": "CAMPAIGN_CODE",  // optional. Campaign code to which you want to assign this push message.
        "content": {  // object( language1: 'content1', language2: 'content2' ) OR string. Ignored for Windows 8, use "wns_content" instead. (Use \n for multiline text. Ex: "hello\nfriend")
          "en": "English",
          "ru": "Русский",
          "de": "Deutsch"
        },
        "page_id": 39,  // optional, integer. HTML Page ID.
        "rich_page_id": 42, // optional, integer. Rich Page ID.
        "rich_media": "XXXXX-XXXXX", // optional, string. Copy the Rich Media code from the URL bar of the Rich Media editor page in Pushwoosh Control Panel. 
        "remote_page": "http://myremoteurl.com", // optional, string. Remote Rich HTML Page URL. <scheme>://<authority>
        "link": "http://google.com", // optional, string. For deeplinks add "minimize_link":0
        "minimize_link": 0, // optional. False or 0 — do not minimize, 1 — Google, 2 — bitly. Default = 1. Google URL shortener is deprecated since March 30, 2018, and will be disabled on March 30, 2019. Please note that shorteners have restrictions on a number of calls. 
        "data": {
          "key": "value" // JSON string or JSON object, will be passed as "u" parameter in the payload (converted to JSON string).
        },
        "platforms": [1,2,3,5,7,8,9,10,11,12], // 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
        "preset": "Q1A2Z-6X8SW", // optional. Push Preset Code from your Control Panel.
        "send_rate": 100, // throttling. Valid values are from 100 to 1000 pushes/second.
         
        // To save the message to the Inbox via API, use "inbox_date" or "inbox_image". The message is saved when at least one of these parameters is used. 
        "inbox_date": "2017-02-02", // optional. Specify when to remove a message from the Inbox. If not specified, the default removal date is the next day after the send date. Ignored if the "users" parameter is specified. 
        "inbox_image": "Inbox image URL", // optional. The image to be shown near the message. 
        "devices": [ // optional. Specify tokens or hwids to send targeted push notifications. Not more than 1000 tokens/hwids in an array. If set, the message will only be sent to the devices on the list. Application Group for devices list is not allowed. iOS push tokens can only be lower case.               
          "dec301908b9ba8df85e57a58e40f96f523f4c2068674f5fe2ba25cdc250a2a41"
        ],
        
        // user-centric push notifications
        "users": [ // optional. If set, message will only be delivered to the specified user ID's (set via /registerUser call). If specified together with devices parameter, the latter will be ignored. Not more than 1000 user ID's in an array.
          "user_3078a"
        ],

        //filters and conditions
        "filter": "FILTER_NAME", // optional
        "dynamic_content_placeholders": { // optional. Placeholders for dynamic content instead of device tags.
          "firstname": "John",
          "lastname": "Doe"
        },
        "conditions": [TAG_CONDITION1, TAG_CONDITION2, ..., TAG_CONDITIONN] // optional. See the remark below.    
      }
    ]
  }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application code

request.applications_group
string

Can be used instead of "application"

request.auth
string
required

API access token from Pushwoosh Control Panel

request.notifications
array of objects
required

Notification settings, "send_date", "ignore_user_timezone", and "content" are required.

send_date
ignore_user_timezone
timezone
campaign
content
request.page_id
int32

HTML page ID to attach to the push message

request.rich_page_id
int32

Rich page ID

request.rich_media
string

Copy the Rich Media code from the URL bar of the Rich Media editor page in Pushwoosh Control Panel.

request.remote_page
string

Remote Rich HTML Page URL

request.link
string

Link to be opened once a user opens a push

request.minimize_link
int32

False or 0 - do not minimize, 1 - Google, 2 - billy

request.data
object

JSON string or JSON object. Will be passed as "u" parameter in the payload (converted to JSON string)

 
request.platforms
int32

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

request.preset
string

Push Preset code from Pushwoosh Control Panel

request.send_rate
int32

Throttling. Valid values are from 100 to 1000 pushes/second.

request.inbox_date
date

Specify when to remove a message from the Inbox.

request.inbox_image
string

URL of the image to be shown near the message in the Inbox

request.devices
array of strings

Specify tokens or hwids to send targeted push notifications

request.users
array of strings

If set, message will only be delivered to the specified user ID's (set via /registerUser call).

request.filter
string

Filter name

request.dynamic_content_placeholders
array

Placeholders for dynamic content instead of device tags.

request.conditions
string

See the remark below

 

Creates a new push notification.

Platform-specific parameters:

{
   "request":{
      "application": "XXXXX-XXXXX", // Your Pushwoosh application code
      "applications_group": "GROUP_CODE",   // optional. Can be used instead of "application".
      "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
      "notifications":[
         {
            // Content settings 
            "send_date": "now",             // YYYY-MM-DD HH:mm OR 'now'
            "ignore_user_timezone": true,   // or false
            "timezone": "America/New_York", // optional. If ignored UTC-0 is default for "send_date". See http://php.net/manual/timezones.php for supported timezones.
            "campaign": "CAMPAIGN_CODE",    // optional. Campaign code to which you want to assign this push message.
            "content":{                     // object( language1: 'content1', language2: 'content2' ) OR string. Ignored for Windows 8, use "wns_content" instead. (Use \n for multiline text. Ex: "hello\nfriend")
               "en":"English",
               "ru":"Русский",
               "de":"Deutsch"
            }, 
            
            // iOS related
            "ios_badges": 5,     // optional, integer. iOS application badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
            "ios_sound": "sound file.wav",    // optional. Sound file name in the main bundle of application. If left empty, the device will produce no sound upon receiving a push.
            "ios_ttl": 3600, // optional. Time to live parameter — maximum message lifespan in seconds.
            "ios_silent": 1, // optional. Enables silent notifications (ignore "sound" and "content").
            "ios_category_id": "1",       // optional, integer. iOS8 category ID from Pushwoosh.
            "ios_root_params" : {  // optional. Root level parameters to the aps dictionary.
              "aps":{
                "content-available": "1",
                "mutable-content":1 // required for iOS 10 Media attachments.
							},
              "attachment":"YOUR_ATTACHMENT_URL", // iOS 10 media attachment URL.
							"data": << User supplied data, max of 4KB>> 
            },
            "apns_trim_content":1,     // optional. (0|1) Trims the exceeding content strings with ellipsis.
            "ios_trim_content": 1,       // Deprecated, use "apns_trim_content" instead.
           "ios_title":"Title", // optional. Adds Title for push notification.
           "ios_subtitle" : "SubTitle", // optional. Adds sub-title for push notification.
           
            // Android related
            "android_root_params": {"key": "value"}, // optional. Custom key-value object. Root level parameters for the android payload recipients.
            "android_sound" : "soundfile", // optional. No file extension. If left empty, the device will produce no sound upon receiving a push.
            "android_header": "header",    // optional. Android notification header.
            "android_icon": "icon",
            "android_custom_icon": "http://example.com/image.png", // optional. Full path URL to the image file.
            "android_banner": "http://example.com/banner.png", // optional. Full path URL to the image file.
            "android_badges": 5, // optional, integer. Android application icon badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
            "android_gcm_ttl": 3600, // optional. Time to live parameter — maximum message lifespan in seconds.
            "android_vibration": 0,  // boolean. Android force-vibration for high-priority pushes.
            "android_led": "#rrggbb",  // LED hex color, device will do its best approximation.
            "android_priority": -1,  // Sets the “importance” parameter for devices with Android 8.0 and higher, as well as the “priority” parameter for devices with Android 7.1 and lower. Establishes the interruption level of a notification channel or a particular notification. Valid values are -2, -1, 0, 1, 2.
            "android_delivery_priority": "normal",  // or "high", optional. Enables notification’s delivery when the device is in the power saving mode. 
            "android_ibc": "#RRGGBB",  // icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
            "android_silent": 1, // optional. 0 or 1, enable silent notificaiton (ignore sound and content). 
 
            // Amazon related
            "adm_root_params": {"key":"value"}, // custom key-value object
            "adm_sound": "push.mp3",
            "adm_header": "Header",
            "adm_icon": "icon",
            "adm_custom_icon": "http://example.com/image.png",
            "adm_banner": "http://example.com/banner.png",
            "adm_ttl": 3600, // optional. Time to live parameter — the maximum message lifespan in seconds.
            "adm_priority":-1,  // priority of the push in Amazon push drawer, valid values are -2, -1, 0, 1 and 2.
 
            // Windows Phone related.
            "wp_type": "Tile",           // Windows Phone notification type. 'Tile' or 'Toast'. Raw notifications are not supported. 'Tile' is default. 
            "wp_background": "/Resources/Red.jpg", // tile image
            "wp_backbackground": "/Resources/Green.jpg", // back tile image
            "wp_backtitle": "back title",  // back tile title 
            "wp_backcontent": "back content",  // back tile content
            "wp_count": 3,               // optional, integer. Badge for Windows Phone notification.
 
            // BlackBerry related.
            "blackberry_header": "header",           // BlackBerry header, applicable to BB10 Series devices.
 
            // Mac OS X related
            "mac_badges": 3,
            "mac_sound": "sound.caf",
            "mac_root_params": {"content-available":1},
            "mac_ttl": 3600, // optional. Time to live parameter — maximum message lifespan in seconds.
 
            // WNS related
            "wns_content": { // Content (XML or raw) of notification encoded in MIME's base64 in form of Object( language1: 'content1', language2: 'content2' ) OR String
               "en": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9ImF2YWlsYWJsZSIvPg==",
               "de": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9Im5ld01lc3NhZ2UiLz4="
            },
            "wns_type": "Badge", // 'Tile' | 'Toast' | 'Badge' | 'Raw'
            "wns_tag": "myTag", // optional. Used in Tile replacement policy. An alphanumeric string of no more than 16 characters.
            "wns_cache": 1, // optional. (1|0) Translates into X-WNS-Cache-Policy value.
            "wns_ttl": 600, // optional. Expiration time for notification in seconds.
            // Safari related
            "safari_title": "Title", // obligatory. Title of the notification. 
            "safari_action": "Click here", // optional
            "safari_url_args": ["firstArgument", "secondArgument"], // obligatory, but the value may be empty
            "safari_ttl": 3600, // optional. Time to live parameter — the maximum lifespan of a message in seconds.
           
            // Chrome related 
            "chrome_title": "Title", // optional. You can specify the header of the message in this parameter.
            "chrome_icon": "icon_URL", // full path URL to the icon or extension resources file path
            "chrome_gcm_ttl": 3600, // optional. Time to live parameter – maximum message lifespan in seconds.
     		  	"chrome_duration": 20, // optional. Changes chrome push display time. Set to 0 to display push until user interacts with it.
					  "chrome_image": "image_URL", // optional. URL to large image. 
            "chrome_root_params": {"key":"value"}, // optional. Set parameters specific to messages sent to Chrome.
					  "chrome_button_text1": "1", // optional
					  "chrome_button_url1": "button1_URL", // optional. Ignored if chrome_button_text1 is not set.
					  "chrome_button_text2": "2", // optional
				    "chrome_button_url2": "button2_url", // optional. Ignored if chrome_button_text2 is not set. 
            // Firefox-related 
            "firefox_title": "Title", // optional. You can specify message header here.
            "firefox_icon": "icon_URL", // full path URL to the icon or path to the file in extension resources. 
            "firefox_root_params": {"key":"value"} // optional. Set parameters specific to messages sent to Firefox.
         }
      ]
   }
}

/createMessage Throttling

Keep in mind that non-enterprise accounts cannot send more than 600 /createMessage and/or /createTargetedMessage requests per minute.

However, if you send pushes via the devices parameter to 10 devices or less, there are no restrictions for any account type as long as the debug mode is disabled.

Note that we always save scheduled pushes to the Message History, even if you are sending them to less than 10 devices via devices parameter. Therefore, such pushes are also throttled.

Response:

HTTP Status code
status_code
Description

200

200

Message successfully created

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

An error in an array of notifications

If the createMessage request has several messages in the notifications array, they will be processed and sent one by one. If one of the messages cannot be parsed, our API will return "status_code":210 with the codes of successfully sent messages, i.e. those preceding the faulty message in the request.

Debug Mode

For load balancing purposes we do not store messages sent through API with the “devices” parameter that contains less than 10 devices in an array. Due to this, such messages will not be displayed in your Message History.

To see push reports during the testing phase, there’s Debug Mode. Turning Debug Mode ON allows you to override this limit for 1 hour and save such pushes in the Message History. Debug mode turns OFF automatically after 1 hour.

Debug Mode can be activated on the Message History page by switching the toggle in the upper right corner.

If the Debug Mode is turned OFF, and you send a createMessage request with less than 10 device tokens to Pushwoosh API, the server will return a “CODE_NOT_AVAILABLE” value for “Messages”, and an empty key for Unknown Devices instead of Message Code unless the message is scheduled to be sent in the future with the "send_date" parameter.

Parameters

Parameter
Description

auth

API access token from the Pushwoosh control panel (create this token at https://cp.pushwoosh.com/api_access)

application

your Pushwoosh application ID where you send the message to (cannot be used together with “applications_group”)

applications_group

your Pushwoosh Application group code (cannot be used together with “application”)

content

the text push message delivered to the application

data

use this only if you want to pass custom data to the application (JSON format) or omit this parameter. Please note that Mac OSX push is limited to 256 bytes

page_id

HTML page id (created from Application’s HTML Pages). Use this if you want to deliver additional HTML content to the application or omit this parameter

send_date

set the time you want the message to be sent (in UTC) or use ‘now’ to send it immediately

wp_count

sets the badge for WP7 platform

ios_badges

sets the badge on the icon for iOS platform. This value will be sent to ALL devices given in the “devices” list.

devices

omit this field (push notification will be delivered to all the devices for the application), or provide the list of devices IDs as described

users

user-centric push notifications. If set, message will only be delivered to the specified users Id's (specified via /registerUser call). If specified together with the devices parameter, the latter will be ignored. Push notification will be delivered to all devices with the specified user IDs.

send_rate

keep in mind that parameters "send_rate" and "devices" should not be used simultaneously in a single /createMessage request. Send rate throttling cannot be applied to messages sent to raw device tokens, only to bulk pushes or pushes with filter.

ios_root_params

root level parameters to the aps dictionary. For example to use with NewsStand apps.

conditions

see below

Tag conditions

Each tag condition is an array like [tagName, operator, operand] where

  • tagName: name of a tag
  • operator: "EQ" | "IN" | "NOTEQ" | "NOTIN" | "LTE" | "GTE" | "BETWEEN" | "NOTSET" | "ANY"
  • operand: string | integer | array | date

Operator description

  • EQ: tag value is equal to operand;
  • IN: tag value intersects with operand (operand must always be an array);
  • NOTEQ: tag value is not equal to an operand;
  • NOTIN: tag value does not intersect with operand (operand must always be an array);
  • GTE: tag value is greater than or equal to operand;
  • LTE: tag value is less than or equal to operand;
  • BETWEEN: tag value is greater than or equal to min operand value but less than or equal to max operand value (operand must always be an array).
  • NOTSET: tag not set. Operand is not considered.
  • ANY: tag has any value. Operand is not considered.

String tags

Valid operators: EQ, IN, NOTEQ, NOTIN
Valid operands:

  • EQ, NOTEQ: operand must be a string;
  • IN, NOTIN: operand must be an array of strings like ["value 1", "value 2", "value N"];
  • NOTSET: tag not set. Operand is not considered;
  • ANY: tag has any value. Operand is not considered.

Integer tags

Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE
Valid operands:

  • EQ, NOTEQ, GTE, LTE: operand must be an integer;
  • IN, NOTIN: operand must be an array of integers like [value 1, value 2, value N];
  • BETWEEN: operand must be an array of integers like [min_value, max_value];
  • NOTSET: tag not set. Operand is not considered;
  • ANY: tag has any value. Operand is not considered.

Date tags

Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE, NOTSET, ANY
Valid operands:

  • "YYYY-MM-DD 00:00" (string);
  • unix timestamp 1234567890 (integer);
  • "N days ago" (string) for operators EQ, BETWEEN, GTE, LTE.

Boolean tags

Valid operators: EQ, NOTSET, ANY
Valid operands: 0, 1, true, false

List tags

Valid operators: IN, NOTIN, NOTSET, ANY
Valid operands: operand must be an array of strings like ["value 1", "value 2", "value N"].

  • IN: user tag values include operand;
  • NOTIN: user tag values don't include operand;
  • NOTSET: tag not set. Operand is not considered;
  • ANY: tag has any value. Operand is not considered.

Remember that “filter” and “conditions” parameters should not be used together.
Also, both of them will be ignored, if the "devices" parameter is used in the same request.

Country and Language tags

Language tag value is a lowercase two-letter code according to ISO-639-1
Country tag value is an UPPERCASE two-letter code according to ISO_3166-2
For example, to send push a notification to Portuguese-speaking subscribers in Brazil, you will need to specify the following condition: "conditions": [["Country", "EQ", "BR"],["Language", "EQ", "pt"]]

/createMessage snippets

Sample /createMessage requests in BASH, PHP, Erlang, Ruby, Java and Python:

#!/bin/bash
 
#Usage
if [ ! -n "$1" ] || [ ! -n "$2" ]
then
  echo "`basename $0` usage: api_token appid message";
  exit 1;
fi;
MESSAGE="$3";
if [ -z "$3" ]
then
MESSAGE='One push to rule them all!'
fi;
 
echo -e "Response:"
curl --data-binary "
{\"request\":
    {\"application\":\"$2\",
     \"auth\":\"$1\",
     \"notifications\":
        [{
                        \"send_date\": \"now\",
            \"content\": \"$MESSAGE\"
        }]
    }
}" \
-H "Content-type: application/json" \
"https://cp.pushwoosh.com/json/1.3/createMessage"
echo "";
exit 0;
<?php 
define('PW_AUTH', 'API TOKEN');
define('PW_APPLICATION', 'APPLICATION CODE');
define('PW_DEBUG', true);
 
function pwCall($method, $data) {
    $url = 'https://cp.pushwoosh.com/json/1.3/' . $method;
    $request = json_encode(['request' => $data]);
 
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
 
    $response = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
 
    if (defined('PW_DEBUG') && PW_DEBUG) {
        print "[PW] request: $request\n";
        print "[PW] response: $response\n";
        print '[PW] info: ' . print_r($info, true);
    }
}
 
pwCall('createMessage', array(
    'application' => PW_APPLICATION,
    'auth' => PW_AUTH,
    'notifications' => array(
            array(
                'send_date' => 'now',
                'content' => 'test',
                'data' => array('custom' => 'json data'),
                'link' => 'http://pushwoosh.com/'
            )
        )
    )
);
-module(pushwoosh).
-export([run/0, stop/0, sendMessage/1]).
%% sendMessage argument: message text %%
 
%% Authentication & App_id %%
-define(PW_AUTH, "YOUR_AUTH_TOKEN").
-define(PW_APPLICATION, "YOUR_PUSHWOOSH_APP_CODE").
 
%% KickStart %%
run() ->
    application:start(unicode),
    application:start(crypto),
    application:start(public_key),
    application:start(ssl),
    application:start(inets),
    %% HTTP Client verbosity options flase, verbose, debug
    httpc:set_options([{verbose, false}]).  
stop() ->
    application:stop(ssl),
    application:stop(public_key),       
    application:stop(crypto),
    application:stop(inets).
%% JSON Wars !
encode(S) -> encode(S, [$"]).
encode([], Acc) -> lists:reverse([$" | Acc]);
encode([C | Cs], Acc) ->
        Hex = lists:flatten(io_lib:format("~4.16.0b", [C])),
        encode(Cs, lists:reverse(Hex) ++ "u\\" ++ Acc).
 
sendMessage(Message_text) ->
    %% URL to JSON API 1.3
    Url = "https://cp.pushwoosh.com/json/1.3/createMessage",
    EncodedMessage = encode(Message_text),
    {ok, Response} = httpc:request(
        %%Method 
        post, 
        %%Request
        {Url, [{"User-Agent", "Erlang exemple"}], "application/json; charset=UTF-8", 
        "{\"request\":{
        \"application\": \""?PW_APPLICATION"\",
        \"auth\": \""?PW_AUTH"\",
        \"notifications\": [{
        \"send_date\": \"now\",
        \"content\": "++EncodedMessage++"
        }]}}"},
        %%HTTP options
        [{ssl,[{verify, verify_none}]}, {version, "HTTP/1.0"}],
        %%Options
        []),
    io:format("And received ~p", [Response]).
class PushNotification
 
  #- PushWoosh API Documentation http://www.pushwoosh.com/programming-push-notification/pushwoosh-push-notification-remote-api/ 
  #- Two methods here:
  #     - PushNotification.new.notify_all(message) Notifies all with the same option
  #     - PushNotification.new.notify_devices(notification_options = {}) Notifies specific devices with custom options
 
  include HTTParty #Make sure to have the HTTParty gem declared in your gemfile https://github.com/jnunemaker/httparty
  default_params :output => 'json'
  format :json
 
  def initialize
    #- Change to your settings
    @auth = {:application  => "00000-00000",:auth => "auth_token"}
  end
 
  # PushNotification.new.notify_all("This is a test notification to all devices")
  def notify_all(message)
    notify_devices({:content  => message})
  end
 
  # PushNotification.new.notify_device({
  #  :content  => "TEST",
  #  :data  => {:custom_data  => value},
  #  :devices  => array_of_tokens
  #})
  def notify_devices(notification_options = {})
    #- Default options, uncomment :data or :devices if needed
    default_notification_options = {
                        # YYYY-MM-DD HH:mm  OR 'now'
                        :send_date  => "now",
                        # Object( language1: 'content1', language2: 'content2' ) OR string
                        :content  => {
                            :fr  => "Test",
                            :en  => "Test"
                        },
                        # JSON string or JSON object "custom": "json data"
                        #:data  => {
                        #    :custom_data  => value
                        #},
                        # omit this field (push notification will be delivered to all the devices for the application), or provide the list of devices IDs
                        #:devices  => {}
                      }
 
    #- Merging with specific options
    final_notification_options = default_notification_options.merge(notification_options)
 
    #- Constructing the final call
    options = @auth.merge({:notifications  => [final_notification_options]})
    options = {:request  => options}                                                                                                                             
    #- Executing the POST API Call with HTTPARTY - :body => options.to_json allows us to send the json as an object instead of a string
    response = self.class.post("https://cp.pushwoosh.com/json/1.3/createMessage", :body  => options.to_json,:headers => { 'Content-Type' => 'application/json' })
  end
end
// Uses JSON classes from http://json.org/java/

package com.arellomobile;
 
import org.json.*;
import java.io.*;
import java.net.*;
 
public class SendPushNotificationSample
{
    public static final String PUSHWOOSH_SERVICE_BASE_URL = "https://cp.pushwoosh.com/json/1.3/";
    private static final String AUTH_TOKEN = "YOUR_AUTH_TOKEN";
    private static final String APPLICATION_CODE = "PW_APPLICATION_CODE";
 
    public static void main(String[] args) throws JSONException, MalformedURLException
    {
        String method = "createMessage";
        URL url = new URL(PUSHWOOSH_SERVICE_BASE_URL + method);
 
        JSONArray notificationsArray = new JSONArray()
                .put(new JSONObject().put("send_date", "now")
                                     .put("content", "test")
                                     .put("link", "http://pushwoosh.com/"));
 
        JSONObject requestObject = new JSONObject()
                .put("application", APPLICATION_CODE)
                .put("auth", AUTH_TOKEN)
                .put("notifications", notificationsArray);
 
        JSONObject mainRequest = new JSONObject().put("request", requestObject);
        JSONObject response = SendServerRequest.sendJSONRequest(url, mainRequest.toString());
 
        System.out.println("Response is: " + response);
    }
}
 
class SendServerRequest
{
    static JSONObject sendJSONRequest(URL url, String request)
    {
        HttpURLConnection connection = null;
        try
        {
            connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setDoInput(true);
            connection.setDoOutput(true);
 
            DataOutputStream writer = new DataOutputStream(connection.getOutputStream());
            writer.write(request.getBytes("UTF-8"));
            writer.flush();
            writer.close();
 
            return parseResponse(connection);
        }
        catch (Exception e)
        {
            System.out.println("An error occurred: " + e.getMessage());
            return null;
        }
        finally
        {
            if (connection != null)
            {
                connection.disconnect();
            }
        }
    }
 
    static JSONObject parseResponse(HttpURLConnection connection) throws IOException, JSONException
    {
        String line;
        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
        StringBuilder response = new StringBuilder();
 
        while ((line = reader.readLine()) != null)
        {
            response.append(line).append('\r');
        }
        reader.close();
 
        return new JSONObject(response.toString());
    }
}
import json
 
PW_AUTH = 'API TOKEN'
PW_APPLICATION_CODE = 'APPLICATION CODE'
 
try:
    # For Python 3.0 and later
    from urllib.request import urlopen
    from urllib.request import Request
except ImportError:
    # Fall back to Python 2's urllib2
    from urllib2 import urlopen
    from urllib2 import Request
 
def pw_call(method, data):
    url = 'https://cp.pushwoosh.com/json/1.3/' + method
    data = json.dumps({'request': data})
    req = Request(url, data.encode('UTF-8'), {'Content-Type': 'application/json'})
    try:
        f = urlopen(req)
        response = f.read()
        f.close()
        print('Pushwoosh response: ' + str(response))
    except Exception as e:
        print ('Request error: ' + str(e))
 
if __name__ == '__main__':
    pw_call('createMessage', {
        'auth': PW_AUTH,
        'application': PW_APPLICATION_CODE,
        'notifications': [
            {
                'send_date': 'now',
                'content': 'test',
                'data': {"custom": "json data"},
                'link': 'http://pushwoosh.com'
            }
        ]
    }
    )
using System;
using System.IO;
using System.Net;
using Newtonsoft.Json.Linq;

namespace WebApplication1
{
   public partial class Default : System.Web.UI.Page
   {
       protected void Page_Load(object sender, EventArgs e)
       {
           string pwAuth = "YOUR_AUTH_TOKEN";
           string pwApplication = "PW_APPLICATION_CODE";
           JObject json = new JObject(
               new JProperty("application", pwApplication),
               new JProperty("auth", pwAuth),
               new JProperty("notifications",
                   new JArray(
                       new JObject(
                           new JProperty("send_date", "now"),
                           new JProperty("content", "test"),
                           new JProperty("wp_type", "Toast"),
                           new JProperty("wp_count", 3),
                           new JProperty("data",
                               new JObject(
                                   new JProperty("custom", "json data"))),
                           new JProperty("link", "http://pushwoosh.com/"),
                           new JProperty("conditions",
                               new JArray(
                                   (object)new JArray("Color", "EQ", "black")))))));
           PWCall("createMessage", json);
       }
       private void PWCall(string action, JObject data)
       {
           Uri url = new Uri("https://cp.pushwoosh.com/json/1.3/" + action);
           JObject json = new JObject(new JProperty("request", data));
           DoPostRequest(url, json);
       }
       private void DoPostRequest(Uri url, JObject data)
       {
           HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
           req.ContentType = "text/json";
           req.Method = "POST";
           using (var streamWriter = new StreamWriter(req.GetRequestStream()))
           {
               streamWriter.Write(data.ToString());
           }
           HttpWebResponse httpResponse;
           try
           {
               httpResponse = (HttpWebResponse)req.GetResponse();
           }
           catch (Exception exc)
           {
               throw new Exception(string.Format("Problem with {0}, {1}", url, exc.Message));
           }
           using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
           {
               var responseText = streamReader.ReadToEnd();
               Page.Response.Write(responseText);
           }
       }
   }
}
package main

import
(
	"fmt"
	"encoding/json"
	"net/http"
	"bytes"
	"io/ioutil"
)

const (
	PW_APPLICATION = "APPLICATION CODE"
	PW_AUTH = "API TOKEN"
	PW_ENDPOINT = "https://cp.pushwoosh.com/json/1.3/"
)

func pwCall(method string, data []byte) (bool) {
	url := PW_ENDPOINT + method
	request, err := http.NewRequest("POST", url, bytes.NewBuffer(data))
	request.Header.Set("Content-Type", "application/json")

	client := http.Client{}
	response, err := client.Do(request)
	if err != nil {
		fmt.Println("Error occur: " + err.Error())
		return false
	}
	defer response.Body.Close()

	fmt.Println("Response Status: ", response.Status)
	if (response.StatusCode == 200) {
		body, _ := ioutil.ReadAll(response.Body)
		fmt.Println("Response Body: ", string(body))
		return true
	}
	return false
}

func main() {
	requestData := map[string]interface{}{
		"request": map[string]interface{} {
			"auth": PW_AUTH,
			"application": PW_APPLICATION,
			"notifications": []interface{}{
				map[string]interface{} {
					"send_date": "now",
					"content": "test",
					"link": "https://pushwoosh.com",
				},
			},
		},
	}
	jsonRequest, _ := json.Marshal(requestData)
	requestString := string(jsonRequest)
	fmt.Println("Request body: " + requestString)

	pwCall("createMessage", jsonRequest)
}
$.ajax({
    type: "POST",
    url: "https://cp.pushwoosh.com/json/1.3/createMessage",
    data: JSON.stringify({
        "request": {
            "application": "APPLICATION CODE",
            "auth": "API TOKEN",
            "notifications": [{
                "send_date": "now",
                "ignore_user_timezone": true,
                "content": "Hello world!"
            }]
        }
    }),
    dataType: "json"
}).done(function(data) {
    console.log(data);
});
Suggest Edits

/deleteMessage

Deletes a scheduled message.

 
posthttps://cp.pushwoosh.com/json/1.3/deleteMessage
{
     "request":{
       "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
       "message": "xxxx-xxxxxxx-xxxxxx" // message code obtained in /createMessage    
     }
   }
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.message
string
required

Message code obtained in /createMessage

 

Deletes a scheduled message.

You can't delete messages that have already been sent out.

Status codes:

HTTP Status code
status_code
Description

200

200

Message successfully deleted

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

<?php
// see http://gomoob.github.io/php-pushwoosh/delete-message.html
use Gomoob\Pushwoosh\Model\Request\DeleteMessageRequest;

// creates request instance
$request = DeleteMessageRequest::create()->setMessage('MESSAGE_CODE');

// call '/deleteMessage' Web Service
$response = $pushwoosh->deleteMessage($request);

if($response->isOk()) {
    print 'Great, my message has been deleted !';
} else {
    print 'Oups, the deletion failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/getMessageDetails

Retrieves the message details.

 
posthttps://cp.pushwoosh.com/json/1.3/getMessageDetails
     {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "message": "xxxx-xxxxxxx-xxxxxx" // message code or message ID    
      }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "message": {
      "id": 2068991743,
      "created": "2016-09-14 17:19:42",
      "send_date": "2016-09-14 17:19:41",
      "status": "done",
      "content": {
        "en": "Hello {Name|CapitalizeFirst|friend}! 🚀"
      },
      "platforms": "[1]",
      "ignore_user_timezone": "1",
      "code": "XXXX-92B4C3C5-A7F5EF70"
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.message
string
required

Message code or message ID. Ex: "xxxx-xxxxxxx-xxxxxx"

 

Retrieves the message details.

Suggest Edits

/createTargetedMessage

Creates a new targeted push notification

 
posthttps://cp.pushwoosh.com/json/1.3/createTargetedMessage
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",  // API access token from Pushwoosh Control Panel
    "devices_filter": "FILTER CONDITION",
    "send_date": "now",  // YYYY-MM-DD HH:mm OR 'now'
    "ignore_user_timezone": true,  // or false
    "timezone": "America/New_York",  // optional. If ignored UTC-0 is default for "send_date". See http://php.net/manual/timezones.php for supported timezones.
    "campaign": "CAMPAIGN_CODE",  // optional. Campaign code to which you want to assign this push message.
    "content": {  // object( language1: 'content1', language2: 'content2' ) OR string. Ignored for Windows 8, use "wns_content" instead. (Use \n for multiline text. Ex: "hello\nfriend")
      "en": "English",
      "ru": "Русский",
      "de": "Deutsch"
    },
    "page_id": 39,  // optional, integer. HTML Page ID.
    "rich_page_id": 42,  // optional, integer. Rich Page ID.
    "rich_media": "XXXXX-XXXXX",  // optional, string. Copy the Rich Media code from the URL bar of the Rich Media editor page in Pushwoosh Control Panel. 
    "remote_page": "http://myremoteurl.com",  // optional, string. Remote Rich HTML Page URL. <scheme>://<authority>
    "link": "http://google.com",  // optional, string. For deeplinks add "minimize_link":0
    "minimize_link": 0,   // optional. False or 0 — do not minimize, 1 — Google, 2 — bitly. Default = 1. Google URL shortener is deprecated since March 30, 2018, and will be disabled on March 30, 2019. Please note that shorteners have restrictions on a number of calls.
    "data": {
      "key": "value"  // JSON string or JSON object, will be passed as "u" parameter in the payload (converted to JSON string).
    },
    "preset": "Q1A2Z-6X8SW",  // optional. Push Preset Code from your Control Panel.
    "send_rate": 100,  // throttling. Valid values are from 100 to 1000 pushes/second.
    // To save the message to the Inbox via API, use "inbox_date" or "inbox_image". The message is saved when at least one of these parameters is used. 
    "inbox_date": "2017-02-02",  // optional. Specify when to remove a message from the Inbox. If not specified, the default removal date is the next day after the send date. Ignored if the "users" parameter is specified. 
    "inbox_image": "Inbox image URL",  // optional. The image to be shown near the message.
       // user-centric push notifications
    "users": [
      "user_3078a"  // optional. If set, message will only be delivered to the specified user ID's (set via /registerUser call). If specified together with devices parameter, the latter will be ignored. Not more than 1000 user ID's in an array.
    ],
    "dynamic_content_placeholders": {  // optional. Placeholders for dynamic content instead of device tags.
      "firstname": "John",
      "lastname": "Doe"
    }
  }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.devices_filter
string
required

See remark below

request.send_date
string
required

YYYY-MM-DD HH:mm OR 'now'

request.ignore_user_timezone
boolean
required

YYYY-MM-DD HH:mm OR 'now'

request.timezone
string

If ignored, UTC-0 is default for "send_date"

request.campaign
string

Campaign code to which you want to assign this push message

request.content
string
required

Notification content. See details below

request.page_id
int32

HTML page ID to attach to the push message

request.rich_page_id
int32

Rich Media code to attach to the push message

request.remote_page
string

Remote Rich HTML Page URL

request.link
string

Link to be opened once a user opens a push

request.minimize_link
int32

False or 0 - do not minimize, 1 - Google, 2 - billy

request.data
object

JSON string or JSON object. Will be passed as "u" parameter in the payload (converted to JSON string)

 
request.preset
string

Push Preset code from Pushwoosh Control Panel

request.send_rate
int32

Throttling. Valid values are from 100 to 1000 pushes/second.

request.inbox_date
date

Specify when to remove a message from the Inbox.

request.inbox_image
string

URL of the image to be shown near the message in the Inbox

 

Creates a new targeted push notification.

Platform-specific parameters:

{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",  // API access token from Pushwoosh Control Panel
    "devices_filter": "FILTER CONDITION",
    "send_date": "now",  // YYYY-MM-DD HH:mm OR 'now'
    "ignore_user_timezone": true,  // or false
    "timezone": "America/New_York",  // optional. If ignored UTC-0 is default for "send_date". See http://php.net/manual/timezones.php for supported timezones.
    "campaign": "CAMPAIGN_CODE",  // optional. Campaign code to which you want to assign this push message.
    "content": {  // object( language1: 'content1', language2: 'content2' ) OR string. Ignored for Windows 8, use "wns_content" instead. (Use \n for multiline text. Ex: "hello\nfriend")
      "en": "English",
      "ru": "Русский",
      "de": "Deutsch"
    },
    
    // iOS related
    "ios_badges": 5,  // optional, integer. iOS application badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
    "ios_sound": "sound file.wav",  // optional. Sound file name in the main bundle of application. If left empty, the device will produce no sound upon receiving a push.
    "ios_ttl": 3600,  // optional. Time to live parameter — maximum message lifespan in seconds.
    "ios_silent": 1,  // optional. Enables silent notifications (ignore "sound" and "content").
    "ios_category_id": "1",  // optional, integer. iOS8 category ID from Pushwoosh.
    "ios_root_params": {  // optional. Root level parameters to the aps dictionary.
      "aps": {
        "content-available": "1",
        "mutable-content": 1  // required for iOS 10 Media attachments.
      },
      "attachment": "YOUR_ATTACHMENT_URL",  // iOS 10 media attachment URL.
      "data": << User supplied data, max of 4KB>>
    },
    "apns_trim_content": 1,  // optional. (0|1) Trims the exceeding content strings with ellipsis.
    "ios_trim_content": 1,  // Deprecated, use "apns_trim_content" instead.
    "ios_title": "Title",  // optional. Adds Title for push notification.
    "ios_subtitle": "SubTitle",  // optional. Adds sub-title for push notification.
    
    // Android related
    "android_root_params": {  // optional. Custom key-value object. Root level parameters for the android payload recipients.
      "key": "value"
    },
    "android_sound": "soundfile",  // optional. No file extension. If left empty, the device will produce no sound upon receiving a push.
    "android_header": "header",  // optional. Android notification header.
    "android_icon": "icon",  
    "android_custom_icon": "http://example.com/image.png",  // optional. Full path URL to the image file.
    "android_banner": "http://example.com/banner.png",  // optional. Full path URL to the image file.
    "android_badges": 5,  // optional, integer. Android application icon badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
    "android_gcm_ttl": 3600,  // optional. Time to live parameter — maximum message lifespan in seconds.
    "android_vibration": 0,  // boolean. Android force-vibration for high-priority pushes.
    "android_led": "#rrggbb",  // LED hex color, device will do its best approximation.
    "android_priority": -1,  // Sets the “importance” parameter for devices with Android 8.0 and higher, as well as the “priority” parameter for devices with Android 7.1 and lower. Establishes the interruption level of a notification channel or a particular notification. Valid values are -2, -1, 0, 1, 2.
    "android_delivery_priority": "normal",  // or "high", optional. Enables notification’s delivery when the device is in the power saving mode. 
    "android_ibc": "#RRGGBB",  // icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
    "android_silent": 1,  // optional. 0 or 1, enable silent notificaiton (ignore sound and content).
    
    // Amazon related
    "adm_root_params": {  // custom key-value object
      "key": "value"
    },
    "adm_sound": "push.mp3",
    "adm_header": "Header",
    "adm_icon": "icon",
    "adm_custom_icon": "http://example.com/image.png",
    "adm_banner": "http://example.com/banner.png",
    "adm_ttl": 3600,  // optional. Time to live parameter — the maximum message lifespan in seconds.
    "adm_priority": -1,  // priority of the push in Amazon push drawer, valid values are -2, -1, 0, 1 and 2.
    
    // Windows Phone related.
    "wp_type": "Tile",  // Windows Phone notification type. 'Tile' or 'Toast'. Raw notifications are not supported. 'Tile' is default.
    "wp_background": "/Resources/Red.jpg",  // tile image
    "wp_backbackground": "/Resources/Green.jpg",  // back tile image
    "wp_backtitle": "back title",  // back tile title
    "wp_backcontent": "back content",  // back tile content
    "wp_count": 3,  // optional, integer. Badge for Windows Phone notification.
    
    // BlackBerry related
    "blackberry_header": "header",   // BlackBerry header, applicable to BB10 Series devices.
    
    // Mac OS X related
    "mac_badges": 3,
    "mac_sound": "sound.caf",
    "mac_root_params": {
      "content-available": 1
    },
    "mac_ttl": 3600,  // optional. Time to live parameter — maximum message lifespan in seconds.
    
    // WNS related
    "wns_content": {  // Content (XML or raw) of notification encoded in MIME's base64 in form of Object( language1: 'content1', language2: 'content2' ) OR String
      "en": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9ImF2YWlsYWJsZSIvPg==",
      "de": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YmFkZ2UgdmFsdWU9Im5ld01lc3NhZ2UiLz4="
    },
    "wns_type": "Badge",  // 'Tile' | 'Toast' | 'Badge' | 'Raw'
    "wns_tag": "myTag",  // optional. Used in Tile replacement policy. An alphanumeric string of no more than 16 characters.
    "wns_cache": 1,  // optional. (1|0) Translates into X-WNS-Cache-Policy value.
    "wns_ttl": 600,  // optional. Expiration time for notification in seconds.
    
    // Safari related
    "safari_title": "Title",  // obligatory. Title of the notification.
    "safari_action": "Click here",  // optional
    "safari_url_args": [  // obligatory, but the value may be empty
      "firstArgument",
      "secondArgument"
    ],
    "safari_ttl": 3600,  // optional. Time to live parameter — the maximum lifespan of a message in seconds.
    
    // Chrome related 
    "chrome_title": "Title",  // optional. You can specify the header of the message in this parameter.
    "chrome_icon": "icon_URL",  // full path URL to the icon or extension resources file path
    "chrome_gcm_ttl": 3600,  // optional. Time to live parameter – maximum message lifespan in seconds.
    "chrome_duration": 20,  // optional. Changes chrome push display time. Set to 0 to display push until user interacts with it.
    "chrome_image": "image_URL",  // optional. URL to large image
    "chrome_root_params": {  // optional. Set parameters specific to messages sent to Chrome.
      "key": "value"
    },
    "chrome_button_text1": "1",  // optional
    "chrome_button_url1": "button1_URL",  // optional. Ignored if chrome_button_text1 is not set.
    "chrome_button_text2": "2",  // optional
    "chrome_button_url2": "button2_url",  // optional. Ignored if chrome_button_text2 is not set.
    
    // Firefox-related 
    "firefox_title": "Title",  // optional. You can specify message header here.
    "firefox_icon": "icon_URL",  // full path URL to the icon or path to the file in extension resources.
    "firefox_root_params": {  // optional. Set parameters specific to messages sent to Firefox.
      "key": "value"
    }
  }
}

Hard mode

Should you be using /createMessage instead?

The method is intended for advanced targeting of your messages, and can be used for sending messages across several or all of your apps. If you do not include Application Code in your device filters, the message will be sent to any device registered in your account, that fits the Tag condition.
Please make sure that you target proper applications in order to avoid sending test pushes to the production application.

The basics are very simple – all filters are performed on the sets of entities.

Sets

Sets are defined as:

1. Devices subscribed to the particular app
2. Devices that match the specific tag value
3. Devices subscribed to one app of the app group

Syntax

Let’s try with some samples according to the list above.

A("XXXXX-XXXXX", ["iOS", "Android", "Blackberry", "Windows_Phone”, "OsX", "Windows", "Amazon", "Safari", "Chrome", "Firefox"])

Defines the set of devices that are subscribed to the app with the App Code “XXXXX-XXXXX”. The platform specifier is optional and, if omitted, means that the message will be sent to all platforms available for this app.

T("age", BETWEEN, [17,20])

Defines the set of the devices which have the “age” tag set to one of the values: 17, 18, 19, 20.

G("11111-11111", ["iOS","Android"])

Same as “A” but applicable to the app groups.

AT(“XXXXX-XXXXX”, “TagName”, EQ, “VALUE”)

Applicable to Application-specific Tags only.

Tags

The very important thing to understand is that tags are shared between the apps, and it presents a very powerful instrument for segmenting and filtering your target users without binding yourself to a particular app.

The tag could be one of the three different types: String, Integer, List. This defines different operators you can use for a particular tag.

String: EQ, IN, NOTIN, NOTEQ

Example: T("username", EQ, "my_username"), T("favorite_color", IN, ["red","green","blue"]).

You can use numeric values with the string tags but such values will be converted to a string.

Integer: GTE, LTE, EQ, BETWEEN, NOTIN, IN, NOTEQ

GTE – Greater than or equal to

LTE – Less than or equal to

BETWEEN – T("age", BETWEEN, [min_value,max_value]). ‘min_value’ and ‘max_value’ must be integer numbers. ‘min_value ‘must be less than ‘max_value’.

IN - T("age", IN, [value1, value2]). The tag value should be one of the following values.

NOTIN - T("age", NOTIN, [value1, value2]). The tag value should NOT be one of the following values.

NOTSET - T("username", NOTSET, "")

List: IN only.

Example: T("Category", IN, ["breaking_news","business","politics"]).

Operations

  • “+” – joins two sets
  • “*” – intersects two sets
  • “\” – subtracts one set from another
    All the operations are left associative. “+” and “*” have the same priority. “\” has greater priority. You can use brackets to define priorities of the calculations.

Note that “\” operation is not commutative. A("12345-12345") \ A("67890-67890") is not the same as A("67890-67890") \ A("12345-12345").

Examples

Easy:

A("00000-00000", ["iOS"]) – all iOS devices subscribed to the app 00000-00000

A("00000-00000") * T("gender", EQ, "F") – all devices subscribed to the app 00000-00000, which have the gender tag set to “female”.

A("00000-00000") * T("username", EQ, "myuser") – all devices subscribed to the app 00000-00000 which have the “myuser” username .

Hard:

( A("00000-00000") + A("11111-11111") ) \ A("12345-12345") – all devices subscribed to the app 00000-00000 OR 11111-11111, which don’t have the app 12345-12345 installed

Hardcore:

( A("00000-00000") * T("gender", EQ, "M") ) + ( A("12345-12345") * T("gender", EQ, "F") ) – Targets all men with the app 00000-00000 and all girls with the app 12345-12345

Fun:

T("gender", EQ, "F") * T("age", BETWEEN, [18, 22]) – targets college-aged girls who have any of your apps installed.

Note

You cannot use any of the following targeting-related parameters in the /createTargetedMessage request:

  • "application"
  • "applications_group"
  • "platforms"
  • "devices"
  • "filter"
  • "conditions"

All the other parameters listed in /createMessage guide are supported.

There is a known issue with the /createTargetedMessage method: if you don’t specify any applications in “devices_filter” section, Pushwoosh doesn’t display any applications in push details.

Suggest Edits

/getMsgStats

Gets messages stats.

 
posthttps://cp.pushwoosh.com/json/1.3/getMsgStats
  {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "message": "xxxx-xxxxxxx-xxxxxx" // message code obtained in /createMessage request    
      }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "request_id": "b3337d8ec78f67280a40a5b89050c0c0"
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.message
string
required

Message code obtained in /createMessage. Ex: "770E-F29EDD83-EB4D99A9"

 

Enterprise API

Gets messages stats.

IMPORTANT

Like every scheduled request, /getMsgStats request requires an additional /getResults request

Response body

Field
Type
Description

request_id

string

Scheduled request Id. Please check /getResults method for more information

Scheduled (/getResults) response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "formatter": "minutely",
    "rows": [
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "send",
        "count": "3",
      },
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "open",
        "count": "2",
      },
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "send",
        "count": "59",
      },
      .................
    ]
  }
}
Suggest Edits

/getMsgPlatformsStats

Gets messages statistics for one or several platforms.

 
posthttps://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats
 {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "message": "xxxx-xxxxxxx-xxxxxx", // message code or message ID
        "platforms":[1,2,3,4,5] // list of platform types. Please see /registerDevice for the complete list of platform types     
      }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "request_id": "287870092dc23175af5dc48ba1dc7f3c"
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.message
string
required

Message code obtained in /createMessage. Ex: "770E-F29EDD83-EB2D99A9"

platforms
array of integers
required

List of platform types. Please see /registerDevice for the complete list of platform types

 

Enterprise API

Gets messages statistics for one or several platforms.

IMPORTANT

As every scheduled request, /getMsgPlatformsStats request requires an additional /getResults request.

Response body

Field
Type
Description

request_id

string

Scheduled request Id. Please check /getResults method for more information

Scheduled (/getResults) response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "formatter": "minutely",
    "rows": [
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "send",
        "count": "3",
      },
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "open",
        "count": "2",
      },
      {
        "datetime": "2015-09-30 12:54:00",
        "action": "send",
        "count": "59",
      },
      .................
    ]
  }
}
Suggest Edits

/createPreset

Creates a new push preset

 
posthttps://cp.pushwoosh.com/json/1.3/createPreset
{
  "auth": "yxoPUlwqm…………pIyEX4H", // required, string. API access token from Pushwoosh Control Panel.
  "name": "PRESET_NAME", // required, string.
  "applicationCode": "XXXXX-XXXXX", // required, string. Your 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"
    },
    "action": { // optional, array.
      "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, Google URL 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, array. Custom user data. Will be passed as "u" parameter in the payload (converted to JSON string).
      "CustomData": "value"
    },
    "platforms": { // optional, array. Specific content for different platforms.
      // See the platform-specific examples below. 
    }
  }, 
  "scheduling": { // optional, array. Scheduling options.
    "sendRate": 1000 // optional, integer. Throttling. Valid values are from 100 to 1000 pushes/second.
  },
  "segmentation": { // required, array. 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
   }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.name
string
required

Preset name

request.applicationCode
string
required

Your Pushwoosh application code

request.applicationGroupCode
string

Can be used instead of "applicationCode"

request.campaignCode
string

Code of the campaign to which you want to assign this push preset

request.content
object
 
request.content.message
string
required

String or array. Message content. In case it's a string, the "Default" language will be used.

request.content.action
object
 
request.content.action.type
string

Type of action. Available types: url, deepLink, richMedia, openApp(default).

request.content.action.options
mixed type

Options for action types. Required for all action types except for openApp. See the example above.

request.content.userData
mixed type

Custom user data. Will be passed as "u" parameter in the payload (converted to JSON string).

request.content.platforms
mixed type

Specific content for different platforms. See the example below.

request.scheduling
object
 
request.scheduling.sendRate
int32

Throttling. Valid values are from 100 to 1000 pushes/second.

request.segmentation
object
 
request.segmentation.filter
string

Filter name from Pushwoosh Control Panel.

request.segmentation.platforms
array of integers
required

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

 

Creates a new push preset.

Platform-specific parameters:

{
  "auth": "yxoPUlwqm…………pIyEX4H", // required, string. API access token from Pushwoosh Control Panel.
  "name": "PRESET_NAME", // required, string.
  "applicationCode": "XXXXX-XXXXX", // optional, string. Your Pushwoosh application code, can't be used with applicationGroupCode. ApplicationCode or applicationGroupCode is required.
  "applicationGroupCode": "AAAAA-BBBBB", // optional, string. Application group code, can't be used with applicationCode. ApplicationCode or applicationGroupCode is required.
  "campaignCode": "CCCCC-DDDDD", // optional, string. Campaign code. 
  "content": { // required, array. Contains message data. 
    "platforms": { // required, array. Specific content for different platforms.
    
      // Android related 
      "android": {
        "badge": 12, // optional, integer. Android application icon badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
        "header": "push header", // optional, string. Android notification header.
        "soundOff": false, // optional, boolean. The device will produce no sound upon receiving a push.
        "sound": "soundfile", // optional, string. No file extension. If left empty, the device will produce no sound upon receiving a push.
        "led": "#18e08e", // optional, string. LED hex color, device will do its best approximation.
        "ibc": "#7e9e12", // optional, string. Icon background color on Lollipop, #RRGGBB, #AARRGGBB, "red", "black", "yellow", etc.
        "vibration": true, // optional, boolean. Android force-vibration for high-priority pushes.
        "customIcon": "some_icon", // optional, string. Full path URL to the image file.
        "banner": "some_banner", // optional, string. Full path URL to the image file.
        "lockScreen": 0, // optional. (0|1) Show push notification on lock-screen
        "rootParams": { // optional. Custom key-value object. Root level parameters for the android payload recipients.
          "param1": "value1",
          "param2": "value2"
        },
        "silent": true, // optional. Enables silent notifications (ignore "sound" and "content").
        "deliveryPriority": "normal", // optional, string. Valid values are "normal" or "high". Enables notification’s delivery when the device is in the power saving mode.
        "priority": 1, // Sets the “importance” parameter for devices with Android 8.0 and higher, as well as the “priority” parameter for devices with Android 7.1 and lower. Establishes the interruption level of a notification channel or a particular notification. Valid values are -2, -1, 0, 1, 2.
        "ttl": 172800 // optional, integer. Time to live parameter — maximum message lifespan in seconds.
      },
      
      // iOS related 
      "ios": {
        "badge": 12, // optional, integer. iOS application badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
        "title": "push title", // optional, string. Adds Title for push notification.
        "subtitle": "test subtitle", // optional, string. Adds sub-title for push notification.
        "sound": "sound", // optional, string. Sound file name in the main bundle of application. If left empty, the device will produce no sound upon receiving a push.
        "customIcon": "some_icon", // optional, string. Adds icon for push notification.
        "trimContent": true, // optional, boolean (true|false). Trims the exceeding content strings with ellipsis.
        "rootParams": { // optional. Root level parameters to the aps dictionary.
          "aps": {
            "content-available": "1",
            "mutable-content": 1 // required for iOS 10 Media attachments.
          },
          "attachment": "YOUR_ATTACHMENT_URL", // iOS 10 media attachment URL.
          "data": << User supplied data, max of 4KB>>
        },
        "silent": true, // optional, boolean. Enables silent notifications (ignore "sound" and "content").
        "categoryId": 123, // optional, integer. iOS8 category ID from Pushwoosh.
        "ttl": 172800 // optional, integer. Time to live parameter — maximum message lifespan in seconds.
      },
      
      // Amazon related 
      "amazon": {
        "header": "push header", // optional, string. Amazon notification header.
        "sound": "sound", // optional, string. Sound file name in the main bundle of application. If left empty, the device will produce no sound upon receiving a push.
        "customIcon": "http://example.com/image.png", // optional, string. Adds icon for push notification.
        "icon": "some_icon",
        "rootParams": { // optional. Custom key-value object.
          "param1": "value1",
          "param2": "value2"
        },
        "banner": "http://example.com/banner.png",
        "priority": 2, // priority of the push in Amazon push drawer, valid values are -2, -1, 0, 1 and 2.
        "ttl": 172800 // optional, integer. Time to live parameter — maximum message lifespan in seconds.
      },
      
      // Windows Phone related 
      "wphone": {
        "type": "Tile", // Windows Phone notification type. 'Tile' or 'Toast'. Raw notifications are not supported. 'Tile' is default.
        "frontBackground": "/Resources/Red.jpg", // optional, string. Tile image.
        "backBackground": "/Resources/Green.jpg", // optional, string. Back tile image.
        "backContent": "content", // optional, string. Back tile content.
        "backTitle": "title", // optional, string. Back tile title.
        "count": 2 // optional, integer. Badge for Windows Phone notification.
      },
      
      // Mac OS X related
      "osx": {
        "title": "push title", // optional, string. Adds Title for push notification.
        "subtitle": "push subtitle", // optional, string. Adds subtitle for push notification.
        "badge": 11, // optional, integer. OSX application badge number. Use "+n" or "-n" to increment/decrement the badge value by n.
        "sound": "sound", // optional, string. Sound file name in the main bundle of application. If left empty, the device will produce no sound upon receiving a push.
        "ttl": 3600, // optional, integer. Time to live parameter — maximum message lifespan in seconds.
        "rootParams": {
          "content-available": true
        }
      },
      
      // Windows related 
      "windows": {
        "message": {
          "en": {
            "headLineText": "english head line text",
            "bodyText1": "english body text1",
            "bodyText2": "english body text2"
          },
          "ja": {
            "headLineText": "japan head line text",
            "bodyText1": "japan body text1",
            "bodyText2": "japan body text2"
          }
        },
        "template": "someTemplate",
        "image": "image.jpg",
        "type": "Badge", // 'Tile' | 'Toast' | 'Badge' | 'Raw'
        "tag": "tag", // optional, string. Used in Tile replacement policy. An alphanumeric string of no more than 16 characters.
        "cache": 1, // optional. (1|0) Translates into X-WNS-Cache-Policy value.
        "ttl": 3600 // optional, integer. Time to live parameter — maximum message lifespan in seconds.
      },
      
      // Chrome related
      "chrome": {
        "title": "push title", // optional, string. Adds Title for push notification.
        "icon": "some_icon.ico", // optional, string. Full path URL to the icon or extension resources file path.
        "image": "image.jpg", // optional, string. URL to large image.
        "rootParams": { // optional, key-value object. Set parameters specific to messages sent to Chrome.
          "param1": "value1",
          "param2": "value2"
        },
        "duration": 30, // optional, integer. Changes chrome push display time. Set to 0 to display push until user interacts with it.
        "ttl": 172800, // optional, integer. Time to live parameter — maximum message lifespan in seconds.
        "button1": { // optional
          "text": "button1 text", // optional
          "url": "http://button1.url" // optional. Ignored if chrome_button_text1 is not set.
        },
        "button2": { // optional
          "text": "button2 text", // optional
          "url": "http://button2.url"  // optional. Ignored if chrome_button_text2 is not set.
        }
      },
      
      // Firefox related 
      "firefox": {
        "title": "push title", // optional. Adds Title for push notification.
        "icon": "some_icon.ico", // full path URL to the icon or path to the file in extension resources.
        "rootParams": {  // optional. Set parameters specific to messages sent to Firefox.
          "param1": "value1",
          "param2": "value2"
        }
      },
      
      // Safari related 
      "safari": {
        "title": "push title", // required, string. Title of the notification.
        "action": "Click here", // optional. Action button content.
        "urlArgs": [ // optional
          "firstArgument",
          "secondArgument"
        ],
        "ttl": 3600 // optional, integer. Time to live parameter — the maximum lifespan of a message in seconds.
      }
    }
  }
}

Response:

HTTP Status code
status_code
Description

200

200

Preset successfully created

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

Suggest Edits

/getPreset

Retrieves the parameters of the specific push preset.

 
posthttps://cp.pushwoosh.com/json/1.3/getPreset
    {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "preset_code": "AAAAA-BBBBB" // push preset code to retrieve information for    
      }
    }
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

request
object
 
request.auth
string
required

API access token from the Pushwoosh Control Panel

request.preset_code
string
required

Push preset code to retrieve information for

 

Enterprise API

Retrieves the parameters of the specific push preset.

Response:

{ 
  "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"
      },
      "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,3,2,5,9,4,7,8,10]
    }
  }
}
Suggest Edits

/getPushHistory

Gets push history via the API.

 
posthttps://cp.pushwoosh.com/json/1.3/getPushHistory
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "source": null, // optional. Possible values are null, "CP", "API","GeoZone", "Beacon", "RSS", "AutoPush","Twitter", "A/B Test"
    "searchBy": "applicationCode",  // optional. Possible values are "", "notificationID", "notificationCode", "applicationCode", "campaignCode"
    "value": "C8717-703F2", // optional
    "lastNotificationID": 0 // optional
  }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": {
      "rows":  {
            "id":91133,
            "createDate":"2015-11-27 07:01:31",
            "sendDate":"2015-11-27 07:01:31",
            "content":{"en":"test"},
            "url":null,
            "filter":"#000Integer(\u226045)",
            "richPageId":null,
            "geozone":"{\"lat\":55.002825809793,\"lng\":82.905578613281,\"range\":1000}"
     }
   } 
}

Body Params

request
object
 
request.auth
string
required

API access token from the Pushwoosh control panel

request.source
string

Push history source. Could be null or: "CP", "API","GeoZone", "Beacon", "RSS", "AutoPush", "Twitter", "'A/B Test"

request.searchBy
string

Possible values to search by. Could be null or: "notificationID", "notificationCode", "applicationCode", "campaignCode"

request.value
string

Search value set according to the "searchBy" field.

request.lastNotificationID
string

Used for pagination. Last messageId from the previous call. See more below.

 

Enterprise API

This method will return 1000 messages from the account sorted by message Id. To get the second page specify the last message Id in the lastNotificationId parameter.

Suggest Edits

/getResults

Retrieves the result of a scheduled request.

 
posthttps://cp.pushwoosh.com/json/1.3/getResults
   {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "request_id": "REQUEST_ID" // request ID returned by the scheduled method    
      }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "applications": {
            "formatter": "minutely",
            "rows": []
        },
        "devices": {
            "formatter": "minutely",
            "rows": []
        },
        "messages": {
            "formatter": "minutely",
            "rows": []
        }
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.request_id
string
required

request ID returned by the scheduled method

 

Enterprise API

Retrieves the result of a scheduled request.

IMPORTANT

This method is used with every scheduled request to receive a response.

Suggest Edits

/cancelMessage

 
posthttps://cp.pushwoosh.com/json/1.3/cancelMessage
{
   "request":{
      "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
      "message": "xxxx-xxxxxxx-xxxxxx" // the message code obtained in /createMessage response
   }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

auth
string
required

API access token from Pushwoosh Control Panel

message
string
required

the message code obtained in /createMessage response

 

The method is only allowed for messages that are in the status of pending, waiting or processing.

Status codes:

HTTP Status code
status_code
Description

200

200

Message successfully cancelled

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

Suggest Edits

/registerDevice

Called internally from SDK. Registers device for the application.

 
posthttps://cp.pushwoosh.com/json/1.3/registerDevice

{
   "request":{
      "application": "XXXXX-XXXXX", // API access token from Pushwoosh Control Panel
      "push_token": "dec301908b9ba8df85e57a58e40f96f523f4c2068674f5fe2ba25cdc250a2a41",
      "hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID
      "idfa" : "AEBE52E7-03EE-455A-B3C4-E57283966239", // optional
      "timezone": 3600, // offset in seconds
      "device_type": 1,
      "language": "en", // ISO 639-1|639-2 language code
      "userId": "Alex", // optional, while used only for Runtastic/Emarsys
  
      // system tags, optionals
      "app_version": "1.2.3",
      "device_model": "Samsung SM-G355H",
      "jailbroken": "1", // 1 or 0
      "os_version": "2.3",
  
      // optional encryption keys for chrome/firefox
      "public_key": "BNmDO4BTKEMJqaqprTf7t/HBUd2BQ/orc88cc/scS5CFP6zhQGIHI1/GgRQD8c4kTxTEEF0quvIUiLQqoBY0/Qo=",
      "auth_token": "RlRmCCdGM/s7ouuhjKFzoQ==",
     
      //optional FCM keys for Chrome (for XMPP)
      "fcm_token": "BNmDO4BTKEMJqaqprTf7t/HBUd2BQ/orc88cc/scS5CFP6zhQGIHI1/GgRQD8c4kTxTEEF0quvIUiLQqoBY0/Qo=",
      "fcm_push_set": "RlRmCCdGM/s7ouuhjKFzoQ=="
   }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": null
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.push_token
string
required

Push token for the device

request.language
string

Language locale of the device. Must be a lowercase two-letter code according to ISO-639-1 standard

request.hwid
string
required

Unique string to identify the device (IDFV/IDFA on iOS and "Android Advertising ID" or ANDROID_ID on Android)

request.timezone
int32

Timezone offset in seconds for the device

request.device_type
int32
required

Device type. See possible values below

 

Possible device types:

  • 1 – iOS
  • 2 – BB
  • 3 – Android
  • 5 – Windows Phone
  • 7 – OS X
  • 8 – Windows 8
  • 9 – Amazon
  • 10 – Safari
  • 11 – Chrome
  • 12 – Firefox

For emails call /registerEmail.

Status codes:

HTTP Status code
status_code
Description

200

200

Device successfully registered

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

<?php
//see http://gomoob.github.io/php-pushwoosh/register-device.html
use Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest;

// creates request instance
$request = RegisterDeviceRequest::create()
    ->setDeviceType(DeviceType::iOS())
    ->setHwid('HWID')
    ->setLanguage('fr')
    ->setPushToken('xxxxxxxx')
    ->setTimezone(3600);

// call '/registerDevice' Web Service
$response = $pushwoosh->registerDevice($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/unregisterDevice

Removes device from the application. Called internally from SDK.

 
posthttps://cp.pushwoosh.com/json/1.3/unregisterDevice
   {
       "request":{
          "application": "XXXXX-XXXXX", // your Pushwoosh application code
          "hwid": "8f65b16df378e7a6bece9614e1530fb2" // hardware device ID used in /registerDevice function call    
       }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application code

request.hwid
string
required

Hardware device ID used in /registerDevice function call

 

For emails call /deleteEmail.

Status codes:

HTTP Status code
status_code
Description

200

200

Device successfully unsubscribed

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

<?php
// see http://gomoob.github.io/php-pushwoosh/unregister-device.html
use Gomoob\Pushwoosh\Model\Request\UnregisterDeviceRequest;

// creates request instance
$request = UnregisterDeviceRequest::create()->setHwid('HWID');

// call '/unregisterDevice' Web Service
$response = $pushwoosh->unregisterDevice($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/setBadge

Sends current badge value for a device to Pushwoosh. Called internally from the SDK.

 
posthttps://cp.pushwoosh.com/json/1.3/setBadge
  {
       "request":{
          "application" : "XXXXX-XXXXX", // your Pushwoosh application code
          "hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID used in /registerDevice function call  
          "badge": 4 // current badge on the application  
       }
    }
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

request.badge
int32
required

Current badge on the application

 

Called from the SDK internally. Sends current badge value for a device to Pushwoosh. This happens internally when app changes badge value on iOS device. Allows auto-incrementing badges to work properly.

Important

This method IS NOT used to update the badge value on the device. Instead please use /createMessage request with the "ios_badges" parameter.

<?php
//see http://gomoob.github.io/php-pushwoosh/set-badge.html
use Gomoob\Pushwoosh\Model\Request\SetBadgeRequest;

// Creates the request instance
$request = RegisterDeviceRequest::create()
    ->setBadge(5)
    ->setHwid('HWID');

// Call the '/setBadge' Web Service
$response = $pushwoosh->setBadge($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/applicationOpen

Registers an app open event. Called internally from the SDK.

 
posthttps://cp.pushwoosh.com/json/1.3/applicationOpen
  {
       "request":{
          "application" : "XXXXX-XXXXX", // your Pushwoosh application code
          "hwid": "8f65b16df378e7a6bece9614e1530fb2" // hardware device ID used in /registerDevice function call    
       }
    }
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK"
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

 
Suggest Edits

/pushStat

Registers a push open event. Called internally from the SDK.

 
posthttps://cp.pushwoosh.com/json/1.3/pushStat
    {
       "request":{
          "application" : "XXXXX-XXXXX", // your Pushwoosh application code
          "hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID used in /registerDevice function call  
          "hash": "HASH_TAG" // optional. Hash tag received in push notification (“p” parameter in the push payload) 
       }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device ID used in /registerDevice function call

request.hash
string

Hash tag received in push notification ("p" parameter in the push payload)

 
<?php
//see http://gomoob.github.io/php-pushwoosh/push-stat.html
use Gomoob\Pushwoosh\Model\Request\PushStatRequest;

// Creates the request instance
$request = PushStatRequest::create()
    ->setHash('hash')
    ->setHwid('HWID');

// Call the '/pushStat' Web Service
$response = $pushwoosh->pushStat($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/messageDeliveryEvent

Registers push delivery event for the device. Called internally from the SDK.

 
posthttps://cp.pushwoosh.com/json/1.3/messageDeliveryEvent
 {
       "request":{
          "application" : "XXXXX-XXXXX", // your Pushwoosh application code
          "hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID used in /registerDevice function call  
          "hash": "HASH_TAG" // optional. Hash tag received in push notification (“p” parameter in the push payload) 
       }
 }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

request.hash
string

Hash tag received in push notification ("p" parameter in the push payload)

 
Suggest Edits

/createTestDevice

Registers a test device for the application.

 
posthttps://cp.pushwoosh.com/json/1.3/createTestDevice
{
  "request": {
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "push_token": "DEVICE_PUSH_TOKEN",
    "device_type": 1,
    "language": "en", // optional. Language locale of the device 
    "name": "TEST_DEVICE_NAME",
    "description": "TEST_DEVICE_DESCRIPTION" // optional
  }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": null
}

Body Params

request
object

request.description

 
request.application
string
required

Your Pushwoosh application ID

request.push_token
string
required

Push token of the device

request.device_type
int32
required

Device type. See possible values in /registerDevice function

request.language
string

Language locale of the device. Must be a lowercase two-letter code according to ISO-639-1 standard

request.name
string
required

Test device name

request.description
string

Test device description

 

Enterprise API

Registers a test device for the application.

Suggest Edits

/listTestDevices

Returns all the test devices for the specific application.

 
posthttps://cp.pushwoosh.com/json/1.3/listTestDevices
  {
     "request":{
       "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
       "application" : "XXXXX-XXXXX" // your Pushwoosh application code    
     }
  }
A binary file was returned

You couldn't be authenticated

{
 "status_code": 200,
 "status_message": "OK",
 "response": {
 "TestDevices": [
  {
    "name": "iosDevice",
    "type": "1",
    "pushtoken": "token",
    "description": "ios device",
    "languages": [
       "en",
       "fr"
    ]
 }
} 

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application code

 

Enterprise API

Returns all the test devices for the specific application.

For device types see /registerDevice method.

Suggest Edits

/setPurchase

Records purchase event.

 
posthttps://cp.pushwoosh.com/json/1.3/setPurchase
{
   "request":{
      "transactionDate": "2014-10-30T10:55:14Z", // date of the transaction
      "application": "XXXXX-XXXXX", // your Pushwoosh application code
      "hwid": "F6BA94A2-6BB2-XXXX-XXXX-E945C686240D", // hardware device ID used in /registerDevice function call
      "quantity": 1, // items quantity
      "currency": "USD", // transaction currency
      "productIdentifier": "com.pushon.purchase.1", // product SKU
      "price": 0.99 // item price
   }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": null
}

Body Params

request
object
 
request.transactionDate
string
required

Date of the transaction

request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

request.quantity
int32
required

Items quantity

request.currency
string
required

Transaction currency

request.productIdentifier
string
required

Product SKU

request.price
double
required

Item price

 

Called internally from the SDK. Records purchase event, populates "In-App Product" default tag, and increments value of "In-App Purchase" default tag.

Suggest Edits

/addTag

Creates a new tag in the database

 
posthttps://cp.pushwoosh.com/json/1.3/addTag
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "tag": {
      "name": "TAG_NAME",
      "type": 1, // see possible values below   
      "application_specific": true, // or 'false', optional. Defines whether the tag value should be different for multiple apps or be the same across multiple apps
      "user_specific": true // or 'false', optional, for application_specific tags
    }
  }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "result": true
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.tag
object
 
request.tag.name
string
required

Tag name.

request.tag.type
int32
required

Tag type. See possible values below.

request.tag.application_specific
boolean

Defines whether the tag value should be different for multiple apps or be the same across multiple apps.

 

Enterprise API

Creates a new tag in the database.

Possible tag value types:

  • 1 - Integer
  • 2 - String
  • 3 - List
  • 4 - Date
  • 5 - Boolean
  • 6 - Decimal. Ex: 19.95
  • 7 - Version. Ex: "1.0.0.0"
Suggest Edits

/deleteTag

Completely removes a tag with all the associated information from the database

 
posthttps://cp.pushwoosh.com/json/1.3/deleteTag
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "tag": {
      "name": "TAG_NAME" // name of the tag to delete
    }
  }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "result": true
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from the Pushwoosh control panel

request.tag
object
 
request.tag.name
string
required

Tag name to delete

 

Enterprise API

Completely removes a tag with all the associated information from the database.

Suggest Edits

/listTags

Retrieves a list of tags on the account.

 
posthttps://cp.pushwoosh.com/json/1.3/listTags
  {
     "request":{
       "auth": "yxoPUlwqm…………pIyEX4H" // API access token from Pushwoosh Control Panel
     }
  } 
A binary file was returned

You couldn't be authenticated

{
 "status_code":200,
 "status_message":"OK",
 "response":{
 "tags":[
         {
           "name":"Language",
           "type":2,
           "isApplicationSpecific": false
         },
         {
           "name":"List tag",
           "type":3,
           "isApplicationSpecific": false
         }
    ]
 }
}

Body Params

request
object
 
request.auth
string
required

API access token from the Pushwoosh control panel

 

Enterprise API

Retrieves a list of tags on the account.

Response:

Types:

  • 1 - Integer
  • 2 - String
  • 3 - List
  • 4 - Date
  • 5 - Boolean
  • 6 - Decimal. Ex: 19.95
  • 7 - Version. Ex: "1.0.0.0"
Suggest Edits

/setTags

Sets tag values for the device. (Called from the SDK)

 
posthttps://cp.pushwoosh.com/json/1.3/setTags
{
   "request":{
      "application": "XXXXX-XXXXX", // your Pushwoosh application code
      "hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID used in /registerDevice function call
      "tags": {
           "StringTag": "string value",
           "IntegerTag": 42,
           "ListTag": ["string1","string2"],
           "DateTag": "2015-10-02 22:11", //note the time is in UTC
           "BooleanTag": true,  // valid values are - true, 1, false, 0, null
      }  
   }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": null
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

request.tags
json
required

JSON Object of tags to set, send null to remove the value

 

Sets tag values for the device.

Important

The method is called from SDK. It is possible to call it remotely from your backend, however you need to maintain an up-to-date database of hwid’s on the backend side.

Please avoid setting more that 50 tag values in a single /setTags request.

For emails call /setEmailTags.

Status codes:

HTTP Status code
status_code
Description

200

200

Tags have been successfully set

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

<?php
//see http://gomoob.github.io/php-pushwoosh/set-tags.html
use Gomoob\Pushwoosh\Model\Request\SetTagsRequest;

// Creates the request instance
$request = SetTagsRequest::create()
    ->setTags(
        array(
            'StringTag' => 'string value',
            'IntegerTag' => 'integer value',
            'ListTag' => ['string1', 'string2']
        )
    )
    ->setHwid('HWID');

// Call the '/setTags' Web Service
$response = $pushwoosh->setTags($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/getTags

Retrieves a list of tags with corresponding values for the specific device.

 
posthttps://cp.pushwoosh.com/json/1.3/getTags
{
   "request":{
      "application": "XXXXX-XXXXX", // your Pushwoosh application code
      "hwid": "HWID" // hardware device ID used in /registerDevice function call
   }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "result": {
      "Language": "fr"
    }
  }
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id (HWID) used in /registerDevice function call

 

Retrieves a list of tags with corresponding values for the specific device.

Suggest Edits

/getTagStats

Displays statistics for the specified Tag.

 
posthttps://cp.pushwoosh.com/json/1.3/getTagStats
  {
       "request":{
          "application": "XXXXX-XXXXX", // your Pushwoosh application code
          "tag": "TAG_NAME",
          "applications": ["APPLICATION_1", "APPLICATION_2", "APPLICATION_3"] // optional. Specify only when the tag is app specific     
       }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "request_id": "2702dd59b826e4a23b2f1af24de53108" //request_id for /getResults method
    }
}

Body Params

request
object
 
request.auth
string
required

Your Pushwoosh application code

request.tag
string
required

Tag name

request.applications
array of strings

List of applications (optional). Specify only when the tag is application specific

 

Enterprise API

Displays statistics for the specified Tag.

IMPORTANT

As every scheduled request, /getTagStats request requires an additional /getResults request

/getResults response

{
	"status_code": 200,
	"status_message": "OK",
	"response": {
		"fileName": "DIRECT_FILE_URL.csv" // direct link to the csv file
	}
}

Received file is a csv file with a semicolon ";" separator.

csv file content example:

13C2B-72C62;ua_settingpushbod;3
13C2B-72C62;ua_settingpushhealth;3
13C2B-72C62;ua_settingpushstrength;3
13C2B-72C62;ua_settingpushupdate;2
Suggest Edits

/createFilter

Creates a new filter.

 
posthttps://cp.pushwoosh.com/json/1.3/createFilter
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "name": "filter name",
    "conditions": [["TagName1", "IN", ["value1", "value2"]], ["TagName2", "IN", ["value1", "value2"]]], // optional. Filter conditions
    "operator": "AND", // optional. Operator values: 'AND', 'OR'
    "application": "AAAAA-00000", // optional. This parameter is usable only with High-Speed setup; omit otherwise
    "expiration_date": "2018-12-31" // Filter expiry. The filter will be automatically deleted on date specified, unless it's used in a Push Preset or an RSS feed
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
      "name": "filter name"
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.name
string
required

Filter name

request.conditions
string

Filter conditions. Conditions syntax is explained in /createMessage

request.operator
string

Operator values: AND OR

request.application
string

Pushwoosh App ID. This parameter is usable only with High-Speed setup; omit otherwise.

request.expiration_date
date

Filter expiry. The filter will be automatically deleted on date specified, unless it's used in a Push Preset or an RSS feed.

 

Enterprise API

Creates a filter.

Suggest Edits

/listFilters

Returns a list of available filters.

 
posthttps://cp.pushwoosh.com/json/1.3/listFilters
  {
      "request":{
        "auth": "yxoPUlwqm…………pIyEX4H" // API access token from Pushwoosh Control Panel
      }
  }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
    "filters": [
       {
           "name": "filter name",
           "conditions": "#TagName1(value1, value2) AND #TagName2(value1, value2)",
           "application" : "AAAAA-ZZZZZ", //only for app-specific filters
           "expiration_date": "YYYY-MM-DD", //"null" for filters without expiration date
           "application" : "AAAAA-ZZZZZ" // only for app-specific filters
       }
    ]
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

 

Enterprise API

Returns a list of available filters with their conditions.

Suggest Edits

/deleteFilter

Deletes an existing filter.

 
posthttps://cp.pushwoosh.com/json/1.3/deleteFilter
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "name": "filter name"
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.name
string
required

Filter name

 

Enterprise API

Deletes an existing filter.

Errors:
210 - Filter not found

Suggest Edits

/registerUser

Associates external User ID with the current device.

 
posthttps://cp.pushwoosh.com/json/1.3/registerUser
    {
      "request": {
        "userId": "user_3078a", // type: string. If empty, use hwid
        "application": "XXXXX-XXXXX", // Pushwoosh application code
        "hwid": "8f65b16df378e7a6bece9614e1530fb2", // device hwid
        "tz_offset": -2917, // optional. Timezone offset
        "device_type": 3 // device type, see /registerDevice for device types
      }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200, 
  "status_message": "OK",
  "response":null
}

Body Params

request
object
 
request.userId
string
required

User ID to associate with the device. If empty, use hwid.

request.application
string
required

Your Pushwoosh application code

request.hwid
string
required

Unique string to identify the device (IDFV/IDFA on iOS and "Android Advertising ID" or ANDROID_ID on Android)

request.tz_offset
int32

Timezone offset in seconds for the device

request.device_type
int32
required

Device type. See possible values in /registerDevice function.

 

Associates external User ID with the current device.
Can be used later in /createMessage API call (the users parameter).
This is normal to call this function before you have the push token and before /registerDevice call.

For emails call /registerEmailUser.

Suggest Edits

/postEvent

Calls the event within the app.

 
posthttps://cp.pushwoosh.com/json/1.3/postEvent
{
   "request":{ 
     "hwid": "8f65b16df378e7a6bece9614e1530fb2", // device hwid 
     "application": "XXXXX-XXXXX", // your Pushwoosh application code
     "event": "activityCompleted", // event name exactly as created in Pushwoosh Control Panel
     "attributes": {
        "login": "facebook",
        "success": "yes",
        "internet": "wifi",
        ...
    },
    "timestampUTC": 1435228403, // optional 
    "timestampCurrent": 1435253603, // optional
    "userId": "someuser@user.com", // a user id which is used for identification of users on multiple devices. If empty send HWID
    "device_type": 1
   }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "code": "61BC9-84DD0"
  }
}

Body Params

request
object
 
request.hwid
string
required

Hardware device id used in /registerDevice function call

request.application
string
required

Your Pushwoosh application code

request.event
string
required

Event name as created in Pushwoosh Control Panel

request.attributes
json

JSON Object with the event attributes

request.timestampUTC
int32

Timestamp in UTC

request.timestampCurrent
int32

Timestamp in local time

request.userId
string
required

User Id belonging to the user who has generated the event. If empty - send HWID.

request.device_type
int32
required

Device type. See possible values in '/registerDevice' function.

 

Calls the event within the app. The event's name in the request must match the event name in Pushwoosh Control Panel. Note that "attributes" property may be empty (but not omitted) in case the event has no attributes.

Suggest Edits

/getUsersDetails

Returns mapped devices and tag data for a specified userID.

 
posthttps://cp.pushwoosh.com/json/1.3/getUsersDetails
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "userIds": ["user_id321"]
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "request_id": "12348b2aa4162fb478bd1fb5fcbb1254"
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.userIds
array of strings
required

IDs of the users

 

Enterprise API

Returns mapped devices and tag data for a specified userID.
Like every scheduled request, /getUsersDetails requires an additional /getResults request.

Response body

Field
Type
Description

request_id

string

Scheduled request Id. Please check getResults method for more information

Scheduled (/getResults) response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "devices": [
      {
        "applicationCode": "APPLICATION_CODE",
        "hwid": "HWID",
        "pushToken": "PUSH_TOKEN",
        "type": 3,
        "tzOffset": 0,
        "tags": "{\"First Install\":\"2017-07-25\"}",
        "badges": 0,
        "androidPackages": "[]",
        "latitude": null,
        "longitude": null,
        "publicKey": "",
        "authToken": "",
        "userId": "myuser_id321"
      }
    ]
  }
}
Suggest Edits

/createApplication

Creates a new application on the account.

 
posthttps://cp.pushwoosh.com/json/1.3/createApplication
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "icon": "iVBORw0KGgoAAAANSUhEUgAAAH0AAACVCAIAAAD6...", // optional. Base-64 encoded binary content of png file 
    "authorize_all_tokens" : true, // or 'false', optional. If true, allows all api tokens to communicate with this app
    "sdk_ios": "pw", // optional. Possible values are “pw” or “corona”
    "sdk_android": "pw", // optional. Possible values are “pw”, “corona”, or “phonegap”
    "title": "APP_TITLE" // optional. Title for the new app in Pushwoosh
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "application": "1DC69-73EDB"
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.icon
string

Icon. Optional. Base64-encoded binary content of png file.

request.sdk_ios
string

iOS SDK type. Optional. Could be "pw" or "corona". Push payload is different for Corona.

request.sdk_android
string

Android SDK type. Optional. Could be "pw", "corona", "phonegap". Apppresser users select "phonegap".

request.title
string

Title for the new app in Pushwoosh. Optional.

 

Enterprise API

Creates a new application on the account.

Suggest Edits

/updateApplication

Updates the application on the account.

 
posthttps://cp.pushwoosh.com/json/1.3/updateApplication
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // application code of the app you want to update
    "icon": "iVBORw0KGgoAAAANSUhEUgAAAH0AAACVCAIAAAD6...", // optional. Base-64 encoded binary content of png file 
    "sdk_ios": "pw", // optional. Possible values are “pw” or “corona”
    "sdk_android": "pw", // optional. Possible values are “pw”, “corona”, or “phonegap”
    "title": "APP_TITLE" // optional. New title for the app in Pushwoosh
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Pushwoosh application ID you want to modify

request.icon
string

Icon. Optional. Base64-encoded binary content of png file.

request.sdk_ios
string

iOS SDK type. Optional. Could be "pw" or "corona". Push payload is different for Corona.

request.sdk_android
string

Android SDK type. Optional. Could be "pw", "corona", "phonegap". Apppresser users select "phonegap".

request.title
string

New title for the app in Pushwoosh. Optional.

 

Enterprise API

Updates the application on the account.

Suggest Edits

/deleteApplication

Deletes the application from the account.

 
posthttps://cp.pushwoosh.com/json/1.3/deleteApplication
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX" // your Pushwoosh application code
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

 

Enterprise API

Deletes the application from the account.

Suggest Edits

/getApplication

Gets details about the application.

 
posthttps://cp.pushwoosh.com/json/1.3/getApplication
  {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX" // your Pushwoosh application code
      }
  }
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

 

Enterprise API

Gets details about the application on the account.

Response example

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "application": {
      "adm_cid": "",
      "adm_secret": "",
      "android_api_type": "x31",
      "android_gcm_api_key": "x7836363631366236353566366236353739",
      "android_sdk": "x7077",
      "icon_url": null,
      "ios_apple_appid": "x78343535613336333933363538333633373533356132653633366636643265373037353733363837373666366637333638326537343635373337343631373037303061353037353733363837373666366637333638323035343635373337343230343137303730",
      "ios_apple_team": "x7834313732363536633663366632303464366636323639366336353230346334633433",
      "ios_apple_user": "x7836313730373036633635343036313732363536633663366632643664366636323639366336353265363336663664",
      "ios_gateway": "x783330",
      "ios_key_management_type": "x783631373537343666",
      "ios_key_password": "x7836353336363236353335333736353333",
      "ios_sdk": "x7077",
      "title": "0 Application For test",
      "wp7_state": "x783635366536313632366336353634",
      "wp7_type": "x78373536653631373537343638363536653734363936333631373436353634",
      "providers": {
        "ios": true,
        "android": false,
        "wp7": false,
        "macos": true,
        "blackberry": false,
        "wns": false,
        "adm": false,
        "safari": false
      },
      "languages": {
        "en": "34",
        "zh": "12",
        "sv": "7",
        "de": "6",
        "pt": "6"
      }
    }
  }
}
Suggest Edits

/getApplications

Gets the list of applications on the account.

 
posthttps://cp.pushwoosh.com/json/1.3/getApplications
   {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "page": 2 // optional. The page number for pagination
      }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code":200,
  "status_message":"OK",
  "response": {
    "page" : 1,  // Current page
    "total": 2,  // Total amount of pages
    "applications":
    {
      "APPLICATION_CODE":"MyApp1",
      "APPLICATION_CODE":"MyApp2"
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.page
int32

The page number for pagination

 

Enterprise API

Gets the list of applications on the account. This method can return result with pagination.

Response example:

{
  "status_code":200,
  "status_message":"OK",
  "response":{
    "page": 1,   // Current page
    "total": 2,   // Total amount of pages
    "applications":
      {
        "57ADE-6B5F3":"MyApp1",
        "82BB2-64A12":"MyApp2",
        "82BB2-64A12":"MyApp99"
      }
  }
}
Suggest Edits

/getApplicationFile

Gets the configuration files related to the application.

 
posthttps://cp.pushwoosh.com/json/1.3/getApplicationFile
  {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX", // your Pushwoosh application code
        "file": "ios_auto_privatekey" // identifier of the file to retrieve. See values below
      }
  }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.file
string
required

Identifier of the file to retrieve. Possible values: ios_auto_privatekey, ios_manual_privatekey, ios_auto_certificate, ios_manual_certificate, ios_push_certificate, ios_provisioning_profile, macos_manual_privatekey, macos_manual_certificate, macos_push_certificate, safari_manual_privatekey, safari_push_certificate, safari_push_package, wp7_cert, wp7_key, wp7_caw

 

Enterprise API

Gets the configuration files related to the application.

Response example:

-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
Suggest Edits

/getApplicationSubscribersStats

Displays the app's subscribers list by the types of their devices.

 
posthttps://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats
   {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX" // your Pushwoosh application code
      }
   }
A binary file was returned

You couldn't be authenticated

{
 "status_code": 200,
 "status_message": "OK",
 "response": {
        "IOS": 1,
        "BLACKBERRY": 0,
        "ANDROID": 1,
        "WINDOWS_PHONE": 0,
        "OSX": 0,
        "WINDOWS": 0,
        "AMAZON": 0,
        "SAFARI": 0,
        "FIREFOX": 0 
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

 

Enterprise API

Displays the app's subscribers list by the types of their devices.

Suggest Edits

/getAppStats

Gets the statistics for the application.

 
posthttps://cp.pushwoosh.com/json/1.3/getAppStats
    {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX", // your Pushwoosh application code
        "datefrom": "2013-06-04 00:00:00", // date and time, start of the reporting period
        "dateto": "2013-06-07 00:00:00" // date and time, end of the reporting period
      }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "request_id": "c93a202f439235f9adaaa06d651548ab"
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.datefrom
string
required

Date and time, start of the reporting period. Formatted date: Y-m-d H:i:s

request.dateto
string
required

Date and time, end of the reporting period. Formatted date: Y-m-d H:i:s

 

Enterprise API

Gets the statistics for the application.

Statistic displays registered actions for application, device or message, for the timeframe specified.

Reports are automatically aggregated using the following rules:
yearly > 1 year
monthly > 1 month
daily > 1 day
hourly > 3 hours
minutely in other cases

Actions:
Application Level: open, install

Device Level: register, unregister

Message level: send, open

All statistics objects have the same format:

Field
Type
Description

formatter

string

report scale: yearly, monthly, daily, hourly, minutely

rows

list

report rows

Each of the report rows is a dictionary:

Field
Type
Description

count

int

registered actions count

action

string

registered action

datetime

string

Formatted date: Y-m-d H:i:s

IMPORTANT

As every scheduled request, /getAppStats request requires an additional /getResults request

Response body

Field
Type
Description

request_id

string

Scheduled request ID. Please check /getResults method for more information

Scheduled (/getResults) response body

Field
Type
Description

applications

dictionary

statistics for applications

devices

dictionary

statistics for devices

messages

dictionary

statistics for messages

{
	"error": {
		"code": 0,
		"message": "OK"
	},
	"json_data": {
		"applications": {
			"formatter": "hourly",
			"rows": [{
				"count": 0,
				"action": "open",
				"datetime": "2013-06-06 00:00:00"
			}, ...
      ]
		}
	}
}
Suggest Edits

/setApplicationPlatformStatus

Changes the platform's status of an app.

 
posthttps://cp.pushwoosh.com/json/1.3/setApplicationPlatformStatus
{
    "request": {
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "platform": 1, // 1 — iOS; 2 — BlackBerry; 3 — Android; 5 — Windows Phone; 7 — OS X; 8 — Windows 8; 9 — Amazon; 10 — Safari; 11 — Chrome; 12 — Firefox
    "status": "disable" // or "enable"
    }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "message": "iOS pushes are disabled",
        "available_platforms": {
            "iOS": false,
            "BlackBerry": false,
            "Android": true,
            "Windows Phone": false,
            "OS X": false,
            "Windows": false,
            "Amazon": false,
            "Safari": false,
            "Chrome": true,
            "Firefox": false,
            "Internet Explorer 11": false
        }
    }
}
{
    "status_code": 210,
    "status_message": "Platform already disabled", // or "Platform is not configured"
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.platform
int32
required

The platform number

request.status
string
required

"enable" or "disable"

 

Enterprise API

Suggest Edits

/createCampaign

Creates a push campaign within the application.

 
posthttps://cp.pushwoosh.com/json/1.3/createCampaign
    {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX", // your Pushwoosh application code
        "name": "CAMPAIGN_NAME", 
        "description": "CAMPAIGN_DESCRIPTION" // optional
      }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaign": "XXXXX-XXXXX"
  }
}

Body Params

request
object

request.description

 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.name
string
required

Campaign name

request.description
string

Campaign description

 

Enterprise API

Creates a push campaign within the application.

Suggest Edits

/deleteCampaign

 
posthttps://cp.pushwoosh.com/json/1.3/deleteCampaign
  {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "campaign": "XXXXX-XXXXX" // ID of the campaign to delete
      }
  }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.campaign
string
required

ID of the campaign to delete

 

Enterprise API

Deletes the particular push campaign.

Suggest Edits

/getCampaignStats

 
posthttps://cp.pushwoosh.com/json/1.3/getCampaignStats
    {
      "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "campaign": "XXXXX-XXXXX", // campaign ID
        "datefrom": "Y-m-d H:i:s", // date and time, start of the reporting period
        "date": "Y-m-d H:i:s" // date and time, end of the reporting period
      }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "request_id": "a3ef436445abfdef6255cc2f65ce7614"
    }
}
{
    "status_code": 210,
    "status_message": "Campaign not found",
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.campaign
string
required

campaign ID

datefrom
string
required

Date and time, start of the reporting period. Formatted date: Y-m-d H:i:s

dateto
string
required

Date and time, end of the reporting period. Formatted date: Y-m-d H:i:s

 

Enterprise API

Displays statistics of the particular push campaign.

IMPORTANT

As every scheduled request, /getCampaignStats request requires an additional /getResults request

/getResults response:

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "formatter": "hourly",
        "rows": [
            {
                "count": 0,
                "action": "open",
                "datetime": "2018-05-09 00:00:00",
                "platformid": 14
            },
            {
                "count": 0,
                "action": "send",
                "datetime": "2018-05-09 00:00:00",
                "platformid": 14
            },
            {
                "count": 0,
                "action": "send",
                "datetime": "2018-05-11 00:00:00",
                "platformid": 14
            }
        ]
    }
}
Suggest Edits

/getCampaigns

Retrieves the list of campaigns for the app.

 
posthttps://cp.pushwoosh.com/json/1.3/getCampaigns
{
     "request": {
       "auth": "jLcRP74KodNa2UW........ztFSOJAQNAB9f5Za", // API access token from Pushwoosh Control Panel
       "application": "XXXXX-XXXXX", // your Pushwoosh application code
       "cursor": "+4PxJPhhwITD4PFsiKui1BA==", // optional. Indicates the last campaign retrieved in the previous request. 
       "limit": 100 // optional. The max number of campaigns for a single response.
     }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "campaigns": [
            {
                "code": "7CFF3-63A7B",
                "name": "CAMPAIGN_NAME_1",
                "description": "DESCRIPTION1"
            },
            {
                "code": "C284C-33DD3",
                "name": "CAMPAIGN_NAME_2",
                "description": "DESCRIPTION2"
            }
        ],
        "limit": 100,
        "cursor": "+4PxJPhhwITD4PFsiKui1BA=="
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application code

cursor
string

Indicates the last campaign retrieved in the previous request

limit
int32

The max number of campaigns for a single response

 
Suggest Edits

/getNearestZone

 
posthttps://cp.pushwoosh.com/json/1.3/getNearestZone
    {
      "request": {
        "application": "APPLICATION_CODE", // your Pushwoosh application code
        "hwid": "HWID", // hardware device ID used in /registerDevice function call
        "lat": 10.12345, // latitude of the device
        "lng": 28.12345 // longitude of the device
      }
    }
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": {  // returns zone which is the closest to the position provided in the request
      "name":"zone name",
      "lat":42,
      "lng":42,
      "range":1234,         // range in meters
      "distance":4715784 // distance in meters
   }
}

Body Params

request
object
 
request.application
string
required

Your Pushwoosh application ID

request.hwid
string
required

Hardware device id used in /registerDevice function call

request.lat
string
required

Latitude of the device

request.lng
string
required

Longitude of the device

 

Called internally from the SDK. Gets the parameters of the nearest geozone and a distance to it.
Also records the device location for geo push notifications.

<?php
//see http://gomoob.github.io/php-pushwoosh/get-nearest-zone.html
use Gomoob\Pushwoosh\Model\Request\GetNearestZoneRequest;

// Creates the request instance
$request = GetNearestZoneRequest::create()
    ->setHwid('HWID')
    ->setLat(10.12345)
    ->setLng(28.12345);

// Call the '/getNearestZone' Web Service
$response = $pushwoosh->getNearestZone($request);

if($response->isOk()) {
    print 'Zone name : ' . $response->getResponse()->getName();
    print 'Latitude : ' . $response->getResponse()->getLat();
    print 'Longitude : ' . $response->getResponse()->getLng();
    print 'Range : ' . $response->getResponse()->getRange();
    print 'Distance : ' . $response->getResponse()->getDistance();
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Suggest Edits

/addGeoZone

 
posthttps://cp.pushwoosh.com/json/1.3/addGeoZone
{
    "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "application": "XXXXX-XXXXX", // your Pushwoosh application code
        "geozones": [{
            "name": "Statue of George",
            "lat": "40.70087797",
            "lng": "-73.931851387",
            "cooldown": 60, // in seconds
            "range": 50, // in meters, from 50 to 1000 
            "content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", // or array
            "presetCode": "AAAAA-BBBBB",
            "cluster": "GEOZONE CLUSTER CODE", // optional. Specify null to unbind cluster from GeoZone
            "campaign": "CAMPAIGN_CODE", // optional. Specify null to unbind Campaign from GeoZone. If omit then Campaign value will not be changed. Has higher priority than Campaign from preset
            "timetable": { // optional
                "timezone": 1234, // in seconds
                "Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending stopped for missing day in list
                    {
                      "start": "04:11",
                      "stop": "12:00"
                    }
                ],
                "Sun": [
                   { // one or two intervals
                     "start": "01:11",
                     "stop": "17:00"
                   },
                   {
                     "start": "18:01",
                     "stop": "23:59"
                   }
                ]
             }
        }]
    }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "GeoZones": [550]	//geozone ids
    }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.geozones
object

Geozone. Could be a JSON array.

 
request.geozones.name
string
required

Geozone name

request.geozones.lat
string
required

Latitude

request.geozones.lng
string
required

Longitude

request.geozones.cooldown
integer
required

Silent period after sending a notification, in seconds

request.geozones.range
integer
required

Range of the geozone. In meters, from 50 to 1000.

request.geozones.content
string

content of the push message. Note: REQUIRED if presetCode field is empty.

request.geozones.presetCode
string

Push preset could be used instead of content field. Note: REQUIRED if content field is empty

request.geozones.cluster
string

Geozone cluster. Optional. Specify null to unbind the cluster from GeoZone.

request.geozones.campaign
string

Campaign code fore reporting. Optional. Specify null to unbind Campaign from GeoZone. If omitted then Campaign value will not be changed. Has higher priority than Campaign from preset.

request.geozones.timetable
json

Geozone timetable. Optional. JSON object. See below for more info.

 

Enterprise API

Add Geozones to the particular application.

Geozone timetable

"timetable": { // optional
  "timezone": 1234, // in seconds
  "Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending stopped for missing day in list
    {
      "start": "04:11",
      "stop": "12:00"
    }
  ],
  "Sun": [
    { // one or two intervals
      "start": "01:11",
      "stop": "17:00"
    },
    {
      "start": "18:01",
      "stop": "23:59"
    }
  ]
}
Suggest Edits

/updateGeoZone

 
posthttps://cp.pushwoosh.com/json/1.3/updateGeoZone
{
    "request": {
        "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
        "geoZoneId": 100016750, // from /addGeoZone method
        "name": "new geozone name",
        "cooldown": 222, // in seconds
        "status": 0, // 0 - deactivated, 1 - activated
        "presetCode": "BBBBB-AAAAA", // cannot be used along with "content"
        "content": "new geozone content", // cannot be used along with "presetCode"
        "cluster": "GEOZONE CLUSTER CODE", // optional. Specify null to unbind cluster from GeoZone
        "campaign": "CAMPAIGN_CODE", // optional. Specify null to unbind Campaign from GeoZone. If omit then Campaign value will not be changed. Has higher priority than Campaign from preset
        "lat" : 10.56, //geozone latitude 
        "lng" : 12.523,//geozone longitude 
        "range" : 500, ////geozone range 
        "timetable": { // optional
                "timezone": 1234, // in seconds
                "Mon": [ // available days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Push sending stopped for missing day in list
                    {
                      "start": "04:11",
                      "stop": "12:00"
                    }
                ],
                "Sun": [
                   { // one or two intervals
                     "start": "01:11",
                     "stop": "17:00"
                   },
                   {
                     "start": "18:01",
                     "stop": "23:59"
                   }
                ]
             }
    }
}
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.geoZoneId
string
required

Geozone Id from '/addGeozone' method

request.name
string

New geozone name to update

request.cooldown
int32

Cooldown to update, in seconds.

request.status
int32

0 - deactivated, 1 - activated

request.presetCode
string

New preset code to associate with Geozone

request.content
string

Content for push notification. Cannot be used with presetCode.

request.cluster
string

New cluster name. Specify null to unbind cluster from GeoZone.

request.campaign
string

New campaign ID. Specify null to unbind Campaign from GeoZone. If omit then Campaign value will not be changed. Has higher priority than Campaign from preset.

request.lat
double

Latitude

request.lng
double

Longitude

request.range
int32

New range in meters

request.timetable
json

See timetable description in '/addGeoZone' method.

 

Enterprise API

Updates a Geozone properties.

Suggest Edits

/deleteGeoZone

 
posthttps://cp.pushwoosh.com/json/1.3/deleteGeoZone
    {
       "request": {
         "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
         "application": "XXXXX-XXXXX", // your Pushwoosh application code 
         "geozones": [550,526] // geozones IDs
       }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.geozones
array of strings

Array of ids or single id of the Geozone to remove

 

Enterprise API

Removes Geozones from the application.

Suggest Edits

/addGeoZoneCluster

 
posthttps://cp.pushwoosh.com/json/1.3/addGeoZoneCluster
    {
        "request": {
            "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
            "application": "XXXXX-XXXXX", // your Pushwoosh application code 
            "name": "Raccoon city", // cluster name 
            "cooldown": 3210 // in seconds
        }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "GeoZoneCluster": "EA1CE-69405" //geozone cluster id
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.name
string
required

Cluster name

request.cooldown
int32

Delay before single user can receive two same messages from the geozone cluster in seconds.

 

Enterprise API

Add Geozone Cluster to the application.

Suggest Edits

/deleteGeoZoneCluster

 
posthttps://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster
    {
       "request": {
         "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
         "application": "XXXXX-XXXXX", // your Pushwoosh application code
         "geoZoneCluster": "EA1CE-69405" // cluster ID
       }
    }
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": null
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.geoZoneCluster
string

ID of the Geozone cluster to remove

 

Enterprise API

Removes Geozone Cluster from the application.

Suggest Edits

/listGeoZones

 
posthttps://cp.pushwoosh.com/json/1.3/listGeoZones
    {
       "request":{
          "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
          "application": "XXXXX-XXXXX" // your Pushwoosh application code 
       }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "clusters": [
      {
        "name": "Geozones without Cluster",
        "geoZones": [
          {
            "id": 17528,
            "name": "Statue of George",
            "lat": 40.70088,
            "lng": -73.93185,
            "cooldown": 60,
            "range": 50,
            "presetCode": null,
            "content": {
              "default": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
            },
            "status": true,
            "campaign_id": 0,
            "timetable": null
          }
        ]
      }
    ]
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

 

Enterprise API

Lists Geozones for the application.

Example response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "clusters": [
      {
        "name": "Cluster",
        "geoZones": [
          {
            "name": "Geozone 1",
            "lat": 52.26816,
            "lng": -109.6875,
            "cooldown": 86340,
            "range": 100,
            "presetCode": null,
            "content": {
              "default": "Push for Geozone 1"
            },
            "status": true, //or false if the geozone is paused,
            "campaign_id": 15, //assigned campaign id
            "timetable": { //timetable, HH:mm
                "Mon": [ //days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. Geozone is not sending notifications during the days that are missing from the list
                    {
                      "start": "04:11",
                      "stop": "12:00"
                    }
                ],
            }
          }
        ]
      },
      {
        "name": "Geozones without cluster",
        "geoZones": [
          {
            "name": "Center",
            "lat": 22.33,
            "lng": 44.55,
            "cooldown": 86400,
            "range": 100,
            "presetCode": null,
            "content": {
              "default": "Push for Geozone Center"
            }
          },
          {
            "name": "Left",
            "lat": 55.01985,
            "lng": 82.94802,
            "cooldown": 86400,
            "range": 801,
            "presetCode": "74096-FDFF1",
            "content": {
              "default": ""
            }
          }
        ]
      }
    ]
  }
}
Suggest Edits

/listGeoZoneClusters

 
posthttps://cp.pushwoosh.com/json/1.3/listGeoZoneClusters
    {
       "request":{
          "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
          "application": "XXXXX-XXXXX" // your Pushwoosh application code 
       }
    }
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "clusters": [
      {
        "code": "AE2C4-4E070",
        "cooldown": 86400,
        "geozones": 1,
        "name": "Cluster on Times"
      },
      {
        "code": "4F244-17CDD",
        "cooldown": 86400,
        "geozones": 1,
        "name": "Cluster on Union"
      }
    ]
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

 

Enterprise API

Lists Geozone Clusters for the application.

Suggest Edits

/configureApplication for iOS

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 1, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari
    "ios_key_management_type": "manual", // "manual" (one step) | "auto" (few steps)
    "ios_key_file": "MIIMY...BAQ==", // base64-encoded iOS key file content
    "ios_key_password": "password",
    "ios_gateway": "1", // "0" (sandbox) | "1" (production)
    "ios_framework": "native" // possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": false,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.device_type
int32
required

Device type. Must be 1 for iOS platform.

request.ios_key_management_type
string
required

"manual" (one step) | "auto" (few steps)

request.ios_key_file
string
required

base64-encoded iOS key file content

request.ios_key_password
string
required

Password for iOS key file

request.ios_gateway
string
required

"0" (sandbox) | "1" (production)

request.ios_framework
string
required

possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"

 

Enterprise API

Configures application on the account.

Auto configuration

Step 1
Create the app and provide the Apple ID information.

Request

{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 1,
    "ios_key_management_type": "auto",
    "step": "1",
    "ios_apple_id": "xxx@xxxxx.xxx",
    "ios_apple_password": "xxxxxx",
    "ios_framework": "native" // possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"
  }
}

Response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "step_data": {
      "teams": {
        "12345ABCDE": {
          "name": "Pushwoosh team",
          "memberid": "XXXXXXXXXX"
        }
      },
      "step": 2 // proceed to step 2
    }
  }
}

Step 2
Select the Team ID.

Request

{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 1,
    "ios_key_management_type": "auto",
    "step": "2",
    "ios_apple_id": "xxx@xxxxx.xxx",
    "ios_apple_password": "xxxxxx",
    "ios_framework": "native", // possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"
    "team_id":"12345ABCDE"
 }
}

Response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "step_data": {
      "appids": [
        {
          "appIdId": "67890FGHIJ",
          "name": "My Application",
          "appIdPlatform": "ios",
          "prefix": "12345ABCDE",
          "identifier": "com.xxxxxxx.xxxxxxx",
          "isWildCard": false,
          "isDuplicate": false,
          "features": {
            "push": true,
            "iCloud": false,
            "inAppPurchase": true,
            "gameCenter": true,
            "XXXXXXXXXX": false,
            "passbook": false,
            "YYYYYYYYYY": false,
            "dataProtection": ""
          },
          "enabledFeatures": [
            "push",
            "inAppPurchase",
            "gameCenter"
          ],
          "isDevPushEnabled": false,
          "isProdPushEnabled": true
        },
        ...
      ],
      "step": 3 // proceed to step 3
    }
  }
}

Step 3
Select the App Id.

Request

{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 1,
    "ios_key_management_type": "auto",
    "step": "3",
    "ios_apple_id": "xxx@xxxxx.xxx",
    "ios_apple_password": "xxxxxx",
    "ios_framework": "native", // possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"
    "team_id": "12345ABCDE",
    "appid": "67890FGHIJ"
 }
}

Response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "step_data": {
      "step": 4 // proceed to step 4
    }
  }
}

Step 4
Select the apns_type. Configure the app for Dev or Prod.

Request

{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 1,
    "ios_key_management_type": "auto",
    "step": "4",
    "ios_apple_id": "xxx@xxxxx.xxx",
    "ios_apple_password": "xxxxxx",
    "ios_framework": "native", // possible values: "native", "cordova", "titanium", "marmalade", "adobeAir", "corona", "xamarin", "phoneGapBuild", "triggerIO", "unity"
    "team_id": "12345ABCDE",
    "appid": "67890FGHIJ",
    "apns_type": "0" // "0" - configure certificate for Development | "1" - configure certificate for Production
 }
}

Response

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "step_data": {
      "appIdProfiles":[
        {
          "profileId":"KLMNOPQRS1",
          "name":"iOS Team Provisioning Profile: com.xxxxx.xxxxx"
        },
        {
          "profileId":"KLMNOPQRS2",
          "name":"XXXXXXX"
        }
      ],
      "certificates": [
        {
          "value": "PY986727N9",
          "name": "Developer (Expiry Feb 13, 2016)"
        }
      ],
      "step": 5 // proceed to step 5
    }
  }
}

Step 5
Select the certificate and provisioning profile.

Request

{
  "request":{
    "auth":"API_ACCESS_TOKEN",
    "application":"APPLICATION_CODE",
    "device_type":"1",
    "ios_key_management_type":"auto",
    "step":"5",
    "ios_apple_id":"xxx@xxxxx.xxx",
    "ios_apple_password":"xxxxxx",
    "ios_framework": "native", // one of native, cordova, titanium, marmalade, adobeAir, corona, xamarin, phoneGapBuild, triggerIO, unity
    "team_id":"12345ABCDE",
    "appid":"67890FGHIJ",
    "apns_type": "0",
    "auto_update_profile": "1", // "0" - manual profile update | "1" - auto profile update
    "profile": "KLMNOPQRS2",
    "certificate" : "PY986727N9"
  }
}

Response

{
  "status_code": 200,
  "status_message": "OK",
  "response":{
    "providers":{
      "ios":true,
      "android":false,
      "wp7":false,
      "macos":false,
      "blackberry":false,
      "wns":false,
      "adm":false,
      "safari":false
    },
    "needTouchProvProfile":true,   // User choosed to auto-update profile
    "provProfileTouchedSuccessfully":true, // Profile changed on Apple side
    "provProfileUploadSuccessfully":true   // Profile created in Pushwoosh
  }
}
Suggest Edits

/configureApplication for Android

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 3, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "android_gcm_api_key": "AIzaSyA…………….7rM", // Android GCM/FCM API Key
    "android_gcm_sender_id": "4821……4542", // Android GCM/FCM Sender ID
    "android_framework": "native" // see possible values below
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": true,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.device_type
int32
required

Device type. Must be 3 for Android platform.

request.android_gcm_api_key
string
required

Android GCM/FCM API Key

request.android_gcm_sender_id
string
required

Android GCM/FCM Sender ID

request.android_framework
string
required

Android framework. Could be: native, cordova, marmalade, adobeAir, corona, xamarin, phoneGanBuild, triggerIO, titanium, unity

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Windows Phone

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 5, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "wp7_state": "enabled", // optional. Possible values are "enabled" and "disabled", "disabled" will disable the platform 
    "wp7_type": "authenticated", // or "unauthenticated", optional 
    "wp7_cert": "iVBORw0KGgoAAAANSUhEUgAABB…", // required when authenticated. Base64-encoded content of certificate file
    "wp7_key": "iVBORw0KGgoAAAANSUhEUgAABB…", // required when authenticated. Base64-encoded content of key file
    "wp7_ca": "iVBORw0KGgoAAAANSUhEUgAABB…", // required when authenticated. Base64-encoded content of certificate authority file
    "wp7_framework": "native" // see possible values below 
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": true,
      "request.device_typewp7": true,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.device_type
string
required

Device type. Must be "5" for windows phone platform.

request.wp7_state
string

Could be "enabled" or "disabled". Must be "enabled". "disabled" will disable the platform.

request.wp7_type
string

Could be: "authenticated" or "unauthenticated"

request.wp7_cert
string

Required when authenticated. Base64-encoded content of certificate file

request.wp7_key
string

Required when authenticated. Base64-encoded content of key file.

request.wp7_ca
string

Required when authenticated. Base64-encoded content of certificate authority file.

request.wp7_framework
string
required

WP framework. Could be: native, phoneGapBuild, marmalade, unity

 

Enterprise Api

Configures application on the account.

Suggest Edits

/configureApplication for Mac OS X

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 7, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "macos_key_management_type": "manual", 
    "macos_cert_file": "iVBORw0KGgoAAAANSUhEUgAABB…", // optional. Base64-encoded content of Mac OS X certificate file 
    "macos_key_file": "iVBORw0KGgoAAAANSUhEUgAABB…", // optional. Base64-encoded content of Mac OS X key file 
    "macos_key_password": "PASSWORD", // optional. Key file password 
    "macos_gateway": 1 // push gateway. "0" for sandbox or "1" for production 
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": true,
      "wp7": true,
      "macos": true,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.device_type
int32
required

Device type. Must be 7 for Mac platform

request.macos_key_management_type
string
required

Only "manual" mode is available currently.

request.macos_cert_file
string

Base64-encoded Mac OS X certificate file content

request.macos_key_file
string

Base64-encoded Mac OS X key file content

request.macos_key_password
string

Key file password.

request.macos_gateway
int32
required

Push gateway. "0" (sandbox), "1" (production).

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Windows 8

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 8, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "wns_psid": "ms-app://…", // package security identifier of the app from Windows Store
    "wns_secret": "CLIENT_SECRET" // Windows client secret 
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": true,
      "wp7": true,
      "macos": true,
      "blackberry": true,
      "wns": true,
      "adm": false,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.device_type
int32
required

Device type. Must be 8 for Windows platform.

request.wns_psid
string
required

Package security identifier from Windows Store for the app. Starts with "ms-app://"

request.wns_secret
string
required

Client Secret from the same page as info above.

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Amazon

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 9, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "adm_cid": "CLIENT_ID", // Amazon client ID
    "adm_secret": "CLIENT_SECRET", // Amazon Client Secret  
    "adm_framework": "native" // see possible values below
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": true,
      "android": true,
      "wp7": true,
      "macos": true,
      "blackberry": true,
      "wns": true,
      "adm": true,
      "safari": false
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.device_type
int32
required

Device type. Must be 9 for Amazon platform

request.adm_cid
string
required

Amazon client id

request.adm_secret
string
required

Amazon client secret

request.adm_framework
string
required

Amazon framework. Could be: native, unity, adobeAir

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Chrome

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 11, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "chrome_gcm_api_key": "AIzaSyA…………….7rM", // GCM/FCM API key for Google Chrome 
    "chrome_gcm_project_number": "557…919" // GCM/FCM project number 
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": false,
      "android": true,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false,
      "asha": false,
      "chrome": true
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.device_type
int32
required

Device type. Must be 11 for Chrome platform.

request.chrome_gcm_api_key
string
required

GCM/FCM API key for Google Chrome.

request.chrome_gcm_project_number
string

GCM/FCM Project number

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Safari

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 10, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "safari_key_management_type": "manual", 
    "safari_website_name": "WEBSITE_NAME", // optional 
    "safari_allowed_domains": ["http://site1.com", "https://site2.com"], // optional
    "safari_url_template": "https://%@", 
    "safari_icon_file": "iVBORw0KGgoAAAANSUhEUgAABB…", // optional. Base64-encoded content of 256x256px png file
    "safari_key_file": "MIIMY...BAQ==", // base64-encoded Safari .p12 key file content  
    "safari_key_password": "PASSWORD" // optional. Password to the key file above  
  }
}
A binary file was returned

You couldn't be authenticated


{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": false,
      "android": false,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": true
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application ID

request.device_type
int32
required

Device type. Must be 10 for Safari platform.

request.safari_key_management_type
string

Only "manual" mode is available currently

request.safari_website_name
string

Website name.

request.safari_allowed_domains
array of strings

Safari allowed domains. Ex: ["http://site1.com/", "https://www.site2.com"]

request.safari_url_template
string
required

Safari URL template. Ex:

request.safari_icon_file
string

Base64-encoded content of 256x256px png file

request.safari_key_file
string
required

Base64-encoded Safari .p12 key file content

request.safari_key_password
string

Password to the key file above

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Firefox

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "lZcoO8ZDvg8nIVh6kS6LWHwcRCS13KxarteY41Alv+a96CKEK+CTUwLszZMbWeuYdTC8KgxphbtAHZ6RQ153",
    "application": "1DC69-73EDB",
    "device_type": "12",
    "firefox_is_enabled": true,
    "firefox_fcm_sender_id": "123123123", // optional for fastpushes
    "firefox_fcm_api_key" : "sdfsdfsfsddfdsf" // optional for fastpushes
  }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": false,
      "android": true,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false,
      "asha": false,
      "firefox": true
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh Control Panel

request.application
string
required

Your Pushwoosh application code

request.device_type
int32
required

Device type. Must be 12 for Firefox platform.

request.firefox_is_enabled
boolean
required

Enables push notifications for Firefox

request.fcm_sender_id
string

Optional for fast pushes

request.fcm_api_key
string

Optional for fast pushes

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Email

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX", // your Pushwoosh application code
    "device_type": 14, // 1 - ios, 2 - blackberry, 3 - android, 5 - windows phone, 7 - osx, 8 - windows, 9 - amazon, 10 - safari, 11 - chrome, 14 - email
    "from_email": "email@domain.com", // email address should be valid and verified
    "from_name": "SENDER_NAME",  
    "reply": "email@domain.com" // optional. Email address to reply should be valid and verified
  }
}
A binary file was returned

You couldn't be authenticated


{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "providers": {
      "ios": false,
      "android": false,
      "wp7": false,
      "macos": false,
      "blackberry": false,
      "wns": false,
      "adm": false,
      "safari": false,
      "emai": true
    }
  }
}

Body Params

request
object
 
request.auth
string
required

API access token from Pushwoosh control panel

request.application
string
required

Your Pushwoosh application code

request.device_type
int32
required

Device type. Must be 14 for Email platform.

request.from_email
string
required

Email address. Should be valid and verified as per our Email Verification guide.

request.from_name
string
required

Sender name.

request.reply
string

Email address to reply. Should be valid and verified as per our Email Verification guide.

 

Enterprise API

Configures application on the account.

Suggest Edits

/createEmailMessage

 

Here's an example of request to send an email message:

{
    "request": {
        "application": "APPLICATION_CODE",
        "applications_group": "GROUP_CODE", // optional. Can be used instead of "application".
        "auth": "API_ACCESS_TOKEN",
        "notifications": [{
            "campaign": "CAMPAIGN_CODE", // optional. To assign this email message to a particular campaign, add a campaign code here. 
            "send_date": "now", // YYYY-MM-DD HH:mm  OR 'now'
            "ignore_user_timezone": true, // or false
            "email_template": "ERDWE-32GFR", // email template code. Copy the template code from the URL bar of the Email Templates editor page in Pushwoosh Control Panel. 
            "timezone": "America/New_York", // optional. Specify to send the message according to timezone set on user's device. 
            "filter": "FILTER_NAME", // optional. Send the email message to specific users meeting filter conditions. 
            "devices": ["email_address1", "email_address2", ..., "email_addressN"], // optional. Specify email addresses to send targeted email messages. Not more than 1000 addresses in an array. If set, the message will only be sent to the addresses on the list. Ignored if the Application Group is used.
            "users": ["userId1", "userId2", ..., "userIdN"], // optional. If set, the email message will only be delivered to the specified user IDs (registered via /registerUser call). Not more than 1000 user IDs in an array. If the "devices" parameter is specified, the "users" parameter will be ignored. 
            "subject": [
                {"default": "Hello {firstname|CapitalizeFirst|user}."},
                {"ru": "Привет, {firstname_ru|CapitalizeFirst|пользователь}."},
                {"en": "Hello {firstname_en|CapitalizeFirst|user}."}
            ],
            "dynamic_content_placeholders": { 
                "firstname": "John",
                "firstname_ru": "Джон",
                "firstname_en": "John"
            }, // optional, placeholders for dynamic content instead of device tag values.
            "conditions": [TAG_CONDITION1, TAG_CONDITION2, ..., TAG_CONDITIONN], // optional. See remark below. 
            "from": {"name": "alice", "email": "from-email@email.com"}, //optional.  Specify a sender name and sender email address to replace the default "From name" and "From email" set up in application properties. Please note that "from_email" value should be previously verified for your account. 
            "reply-to": "reply-to@email.com" //optional. Specify an email address to replace the default "Reply to" set up in application properties. Please note that "reply-to" value should be previously verified for your account.
           }]
    }
}

Tag conditions

Each tag condition is an array like [tagName, operator, operand] where

  • tagName: name of a tag
  • operator: "EQ" | "IN" | "NOTEQ" | "NOTIN" | "LTE" | "GTE" | "BETWEEN"
  • operand: string | integer | array | date

Operand description

  • EQ: tag value is equal to operand;
  • IN: tag value intersects with operand (operand must always be an array);
  • NOTEQ: tag value is not equal to an operand;
  • NOTIN: tag value does not intersect with operand (operand must always be an array);
  • GTE: tag value is greater than or equal to operand;
  • LTE: tag value is less than or equal to operand;
  • BETWEEN: tag value is greater than or equal to min operand value but less than or equal to max operand value (operand must always be an array).

String tags

Valid operators: EQ, IN, NOTEQ, NOTIN
Valid operands:

  • EQ, NOTEQ: operand must be a string;
  • IN, NOTIN: operand must be an array of strings like ["value 1", "value 2", "value N"];

Integer tags

Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE
Valid operands:

  • EQ, NOTEQ, GTE, LTE: operand must be an integer;
  • IN, NOTIN: operand must be an array of integers like [value 1, value 2, value N];
  • BETWEEN: operand must be an array of integers like [min_value, max_value].

Date tags

Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE
Valid operands:

  • "YYYY-MM-DD 00:00" (string)
  • unix timestamp 1234567890 (integer)
  • "N days ago" (string) for operators EQ, BETWEEN, GTE, LTE

Boolean tags

Valid operators: EQ
Valid operands: 0, 1, true, false

List tags

Valid operators: IN
Valid operands: operand must be an array of strings like ["value 1", "value 2", "value N"].

Remember that “filter” and “conditions” parameters should not be used together.
Also, both of them will be ignored, if the "devices" parameter is used in the same request.

Country and Language tags

Language tag value is a lowercase two-letter code according to ISO-639-1
Country tag value is an UPPERCASE two-letter code according to ISO_3166-2
For example, to send push a notification to Portuguese-speaking subscribers in Brazil, you will need to specify the following condition: "conditions": [["Country", "EQ", "BR"],["Language", "EQ", "pt"]]

Suggest Edits

/registerEmail

Registers email for the application.

 
posthttps://cp.pushwoosh.com/json/1.3/registerEmail

{
    "request" : {
        "auth" : "API-Token", //API Token with restriction "Email API",
        "application" : "APPLICATION_CODE",
        "email" : "email@domain.com",
        "language" : "ru",  //optional
        "userId" : "userId", //optional
        "tz_offset" : 3600 //optional, offset in seconds
    }
}
A binary file was returned

You couldn't be authenticated

{
   "status_code":200,
   "status_message":"OK",
   "response": null
}
{
  "status_code": 210,
  "status_message": "Email is invalid",
  "response": null
}
{
  "status_code": 403,
  "status_message": "Token restrictions forbid this operation",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API Token with restriction "Email API"

request.application
string
required

Your Pushwoosh application code

request.email
string
required

Email address

request.language
string

Language locale of the device. Must be a lowercase two-letter code according to ISO-639-1 standard

request.userId
string

UserId to associate with the email

request.tz_offset
int32

Timezone offset in seconds

 

Status codes

HTTP Status code
status_code
Description

200

200

Email successfully registered

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

Suggest Edits

/deleteEmail

Removes email from your account.

 
posthttps://cp.pushwoosh.com/json/1.3/deleteEmail
{
   "request" : {
      "auth" : "nnFuCDrKT8mVnQPyYRCoXGMwFmXhMcxzjBYVGg7q70SmfQogLZd001llMqcp8PPUnZoxA7XAqq1ZaCvTgNyd",
      "email" : "email@domain.com"
   }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
{
  "status_code": 210,
  "status_message": "Email not found",
  "response": null
}

Body Params

request
object
 
request.auth
string
required

API Token with restriction "Email API"

request.email
string
required

Email address used in /registerEmail function call

 

Status codes:

HTTP Status code
status_code
Description

200

200

Email successfully deleted

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

Suggest Edits

/setEmailTags

 
posthttps://cp.pushwoosh.com/json/1.3/setEmailTags
{
   "request" : {
      "auth" : "nnFuCDrKT8mVnQPyYRCoXGMwFmXhMcxzjBYVGg7q70SmfQogLZd001llMqcp8PPUnZoxA7XAqq1ZaCvTgNyd",
      "email" : "email@domain.com",
      "application" : "APPLICATION_CODE",
      "tags" : {
        "StringTag": "string value",
           "IntegerTag": 42,
           "ListTag": ["string1","string2"],
           "DateTag": "2015-10-02 22:11", //note the time is in UTC
           "BooleanTag": true  // valid values are - true, 1, false, 0, null
      },
        "userId" : "userId" //optional
   }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "skipped": []
  }
}
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "skipped": [
      {
        "tag": "TTT",
        "reason": "Not found"
      }
    ]
  }
}

Body Params

request
object
 
request.auth
string
required

API Token with restriction "Email API"

request.application
string
required

Your Pushwoosh application code

request.email
string
required

Email address

request.tags
json
required

JSON Object of tags to set, send null to remove the value

request.userId
string

UserId associated with the email

 

Set tag values for the email.

Important

For other device types will be returned 200 OK, though tags won't be saved.

Please avoid setting more than 50 tag values in a single /setEmailTags request.

Status codes:

HTTP Status code
status_code
Description

200

200

Tags have been successfully set

200

210

Argument error. See status_message for more info

400

N/A

Malformed request string

500

500

Internal error

Suggest Edits

/registerEmailUser

 
posthttps://cp.pushwoosh.com/json/1.3/registerEmailUser
{
    "request" : {
        "auth" : "API Token", //API Token with restriction "Email API"
        "application" : "APPLICATION_CODE",
        "email" : "email@domain.com",
        "userId" : "userId",
        "tz_offset" : 3600 //optional
    }
}
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
{
  "status_code": 210,
  "status_message": "Application not found."
}
{
  "status_code": 400,
  "status_message": "Request format is not valid."
}
{
  "status_code": 403,
  "status_message": "Forbidden."
}

Body Params

request
object
 
request.auth
string
required

API Token with restriction "Email API"

request.application
string
required

Your Pushwoosh application code

request.email
string
required

Email address

request.userId
string
required

UserId to associate with the email

request.tz_offset
int32

Timezone offset in seconds for the device

 

Associates external User ID with the current email address.
Can be used later in /createEmailMessage API call (the users parameter).