Suggest Edits

/createMessage

Creates a new push notification

 

Creates a new push notification.

Request:

Here’s a simple request that will send a Hello world! push notification to all subscribers of the app:

{
    "request": {
        "application": "APPLICATION_CODE",
        "auth": "API_ACCESS_TOKEN",
        "notifications": [{
            "send_date": "now", // YYYY-MM-DD HH:mm  OR 'now'
            "ignore_user_timezone": true, // or false
            "content": "Hello world!"
        }]
    }
}

Below is an advanced createMessage request that contains all available parameters:

/createMessage

{
   "request":{
      "application":"APPLICATION_CODE",
      "applications_group":"GROUP_CODE",   // optional. Can be used instead of "application"
      "auth": "API_ACCESS_TOKEN",
      "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 in "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. HTML Pages. integer
            "rich_page_id": 42,            // optional. Rich Pages. integer
            "rich_media": "XXXX-XXXX",     // optional. Rich Media code. string
            "remote_page" : "http://myremoteurl.com",  // 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 
            "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",        // Push Preset Code from your Control Panel
            "send_rate": 100,              // throttling. Valid values are from 100 to 1000 pushes/second.
            "devices": ["dec301908b9ba8df85e57a58e40f96f523f4c2068674f5fe2ba25cdc250a2a41"], // 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. Ignored if the Applications Group is used. iOS push tokens can only be lower case.
           
            // user-centric push notifications
            "users":["user_3078a"],       // optional. If set, message will only be delivered to the specified users Id's (specified via /registerUser call). If specified together with devices parameter, the latter will be ignored.

            //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 remark
 
            // 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. Enable 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. Add Title for push notification
           "ios_subtitle" : "SubTitle", //Optional. Added sub-title for push notification
           
            // Android related
            "android_root_params": {"key": "value"}, // 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,   // Android force-vibration for high-priority pushes, boolean
            "android_led":"#rrggbb",  // LED hex color, device will do its best approximation
            "android_priority":-1,  // priority of the push in the Android push drawer, valid values are -2, -1, 0, 1 and 2
            "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' if 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":"", // optional. You can specify the header of the message in this parameter
            "chrome_icon":"", // 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_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":"", // optional. You can specify message header here
            "firefox_icon":"", // full path URL to the icon or path to the file in extension resources 
         }
      ]
   }
}

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

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 Push 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 push history. Debug mode turns OFF automatically after 1 hour.

Debug Mode can be activated on the Push 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 the last used user's device.

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"
  • 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"]]

/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);
});

/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 Push History, even if you are sending them to less than 10 devices via devices parameter. Therefore, such pushes are also throttled.

Suggest Edits

/deleteMessage

 
posthttps://cp.pushwoosh.com/json/1.3/deleteMessage
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteMessage
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteMessage' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteMessage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteMessage");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteMessage"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/getMessageDetails
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getMessageDetails
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getMessageDetails' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getMessageDetails")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getMessageDetails");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getMessageDetails"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/createTargetedMessage
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/createTargetedMessage
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/createTargetedMessage' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/createTargetedMessage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/createTargetedMessage");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/createTargetedMessage"

response = requests.request("POST", url)

print(response.text)
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.send_date
string

Date when to deliver the message (YYYY-MM-DD HH:mm) or "now"

request.content
string
required

Content of the push messager

request.devices_filter
string
required

Filter expression string. See below for more info.

 

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.

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.

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.

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

 
posthttps://cp.pushwoosh.com/json/1.3/getMsgStats
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getMsgStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getMsgStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getMsgStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getMsgStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getMsgStats"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getMsgPlatformsStats"

response = requests.request("POST", url)

print(response.text)
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

Get messages statistics for one or many 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

/getPreset

Retrieves the parameters of the specific push preset.

 
posthttps://cp.pushwoosh.com/json/1.3/getPreset
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getPreset
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getPreset' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getPreset")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getPreset");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getPreset"

response = requests.request("POST", url)

print(response.text)
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.

Suggest Edits

/getPushHistory

Gets push history via the API.

 
posthttps://cp.pushwoosh.com/json/1.3/getPushHistory
{
  "request":{
    "auth":"AUTH_TOKEN",
    "source": null, // null, "CP", "API","GeoZone", "Beacon", "RSS", "AutoPush","Twitter", "'A/B Test"
    "searchBy":"applicationCode",  // "","notificationID", "notificationCode", "applicationCode", "campaignCode"
    "value": "C8717-703F2",
    "lastNotificationID":0
  }
}
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.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

 
posthttps://cp.pushwoosh.com/json/1.3/getResults
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getResults
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getResults' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getResults")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getResults");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getResults"

response = requests.request("POST", url)

print(response.text)
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

/registerDevice

Called internally from SDK. Registers device for the application.

 
posthttps://cp.pushwoosh.com/json/1.3/registerDevice
{
   "request":{
      "application":"APPLICATION_CODE",
      "push_token":"DEVICE_PUSH_TOKEN",
      "language":"en",  // optional
      "hwid": "hardware device id",
      "timezone": 3600, // offset in seconds 
      "device_type":1
   }
}
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

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/unregisterDevice
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/unregisterDevice' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/unregisterDevice")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/unregisterDevice");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/unregisterDevice"

response = requests.request("POST", url)

print(response.text)
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

 

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/setBadge
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/setBadge' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/setBadge")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/setBadge");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/setBadge"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/applicationOpen
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/applicationOpen' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/applicationOpen")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/applicationOpen");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/applicationOpen"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/pushStat
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/pushStat' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/pushStat")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/pushStat");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/pushStat"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/messageDeliveryEvent
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/messageDeliveryEvent' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/messageDeliveryEvent")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/messageDeliveryEvent");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/messageDeliveryEvent"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/createTestDevice
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/createTestDevice
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/createTestDevice' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/createTestDevice")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/createTestDevice");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/createTestDevice"

response = requests.request("POST", url)

print(response.text)
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 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

 
posthttps://cp.pushwoosh.com/json/1.3/listTestDevices
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/listTestDevices
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/listTestDevices' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/listTestDevices")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/listTestDevices");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/listTestDevices"

response = requests.request("POST", url)

print(response.text)
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 ID

 

Enterprise API

Returns all the test devices for the specific application.

For device types see /registerDevice method.

Suggest Edits

/setPurchase

 
posthttps://cp.pushwoosh.com/json/1.3/setPurchase
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/setPurchase
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/setPurchase' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/setPurchase")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/setPurchase");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/setPurchase"

response = requests.request("POST", url)

print(response.text)
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 even, populates "In App Product" default tag and increments value of "In-app Purchase" default tag.

JSON Example

{
   "request":{
      "transactionDate":"2014-10-30T10:55:14Z", // Date of the transaction
      "application":"XXXXX-XXXXX", // Your Pushwoosh application ID
      "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
   }
}
Suggest Edits

/addTag

Creates a new tag in the database

 
posthttps://cp.pushwoosh.com/json/1.3/addTag
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/addTag
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/addTag' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/addTag")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/addTag");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/addTag"

response = requests.request("POST", url)

print(response.text)
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 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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteTag
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteTag' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteTag")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteTag");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteTag"

response = requests.request("POST", url)

print(response.text)
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

Retrieve a list of tags on the account.

 
posthttps://cp.pushwoosh.com/json/1.3/listTags
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/listTags
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/listTags' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/listTags")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/listTags");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/listTags"

response = requests.request("POST", url)

print(response.text)
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

 

Enterprise API

Retrieve 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"
{
 "status_code":200,
 "status_message":"OK",
 "response":{
 "tags":[
         {
           "name":"Language",
           "type":2,
           "isApplicationSpecific": false
         },
         {
           "name":"List tag",
           "type":3,
           "isApplicationSpecific": false
         }
    ]
 }
}
Suggest Edits

/setTags

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

 
posthttps://cp.pushwoosh.com/json/1.3/setTags
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/setTags
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/setTags' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/setTags")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/setTags");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/setTags"

response = requests.request("POST", url)

print(response.text)
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

 

Set 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.

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();
}
{
   "request":{
      "application":"DEAD0-BEEF0",
      "hwid": "device hardware id",
      "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
      }  
   }
}
Suggest Edits

/getTags

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

 
posthttps://cp.pushwoosh.com/json/1.3/getTags
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getTags
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getTags' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getTags")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getTags");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getTags"

response = requests.request("POST", url)

print(response.text)
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

 

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

Suggest Edits

/getTagStats

 
posthttps://cp.pushwoosh.com/json/1.3/getTagStats
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getTagStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getTagStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getTagStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getTagStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getTagStats"

response = requests.request("POST", url)

print(response.text)
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 ID

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

 
posthttps://cp.pushwoosh.com/json/1.3/createFilter
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/createFilter
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/createFilter' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/createFilter")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/createFilter");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/createFilter"

response = requests.request("POST", url)

print(response.text)
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
required

Your Pushwoosh application ID

 

Enterprise API

Creates a filter.

{
  "request": {
    "auth": "API_ACCESS_TOKEN",
    "name": "filer name",
    "conditions": [["TagName1", "IN", ["value1", "value2"]], ["TagName2", "IN", ["value1", "value2"]]],
    "operator": "AND",
    "application" : "AAAAA-00000"
  }
}
Suggest Edits

/listFilters

 
posthttps://cp.pushwoosh.com/json/1.3/listFilters
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/listFilters
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/listFilters' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/listFilters")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/listFilters");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/listFilters"

response = requests.request("POST", url)

print(response.text)
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
       }
    ]
  }
}

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

 
posthttps://cp.pushwoosh.com/json/1.3/deleteFilter
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteFilter
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteFilter' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteFilter")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteFilter");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteFilter"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/registerUser
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/registerUser
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/registerUser' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/registerUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/registerUser");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/registerUser"

response = requests.request("POST", url)

print(response.text)
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

UserId to associate with the device

request.application
string
required

Your Pushwoosh application ID

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.

{
  "request": {
    "userId": "user_3078a", //type: string
    "application": "XXXXX-XXXXX", //Pushwoosh application code
    "hwid": "8f65b16df378e7a6bece9614e1530fb2", //device hwid
    "tz_offset": -2917, //timezone offset
    "device_type": 3 //device type, see registerDevice for device types
  }
}
Suggest Edits

/postEvent

 
posthttps://cp.pushwoosh.com/json/1.3/postEvent
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/postEvent
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/postEvent' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/postEvent")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/postEvent");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/postEvent"

response = requests.request("POST", url)

print(response.text)
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 ID

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 particular application. Event name is humanized, and should match the event name in Pushwoosh Control Panel. Note that "attributes" property may be empty in case the event has no attributes.

{
   "request":{ 
     "hwid": "device hardware id",
     "application": "APPLICATION_CODE",
     "event": "activityCompleted", // event name as created in Pushwoosh Control Panel
     "attributes": {
        "login": "facebook",
        "success": "yes",
        "internet": "wifi",
        ...
    },
    "timestampUTC": 1435228403,
    "timestampCurrent": 1435253603,
    "userId": "someuser@user.com" // a user id which is used for identification of users on multiple devices. if empty send HWID
    "device_type":1
   }
}
Suggest Edits

/getUsersDetails

 
posthttps://cp.pushwoosh.com/json/1.3/getUsersDetails
{
  "request": {
    "auth" : "API_ACCESS_TOKEN",
    "application": "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

 
posthttps://cp.pushwoosh.com/json/1.3/createApplication
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/createApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/createApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/createApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/createApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/createApplication"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/updateApplication
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/updateApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/updateApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/updateApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/updateApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/updateApplication"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/deleteApplication
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteApplication"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/getApplication
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getApplication"

response = requests.request("POST", url)

print(response.text)
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 ID

 

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

 
posthttps://cp.pushwoosh.com/json/1.3/getApplications
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getApplications
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getApplications' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getApplications")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getApplications");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getApplications"

response = requests.request("POST", url)

print(response.text)
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.

Suggest Edits

/getApplicationFile

 
posthttps://cp.pushwoosh.com/json/1.3/getApplicationFile
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getApplicationFile
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getApplicationFile' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getApplicationFile")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getApplicationFile");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getApplicationFile"

response = requests.request("POST", url)

print(response.text)
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 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.

{
  "request":{
    "auth":"API_ACCESS_TOKEN",
    "application":"APPLICATION_CODE",
    "file":"ios_auto_privatekey"
  }
}
Suggest Edits

/getApplicationSubscribersStats

 
posthttps://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getApplicationSubscribersStats"

response = requests.request("POST", url)

print(response.text)
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

 
posthttps://cp.pushwoosh.com/json/1.3/getAppStats
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getAppStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getAppStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getAppStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getAppStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getAppStats"

response = requests.request("POST", url)

print(response.text)
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 ID

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

/createCampaign

 
posthttps://cp.pushwoosh.com/json/1.3/createCampaign
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/createCampaign
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/createCampaign' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/createCampaign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/createCampaign");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/createCampaign"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "campaign": "33655-8AA38"
  }
}

Body Params

request
object
 
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteCampaign
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteCampaign' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteCampaign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteCampaign");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteCampaign"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getCampaignStats
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getCampaignStats' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getCampaignStats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getCampaignStats");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getCampaignStats"

response = requests.request("POST", url)

print(response.text)
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

Suggest Edits

/getNearestZone

 
posthttps://cp.pushwoosh.com/json/1.3/getNearestZone
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/getNearestZone
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/getNearestZone' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/getNearestZone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/getNearestZone");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/getNearestZone"

response = requests.request("POST", url)

print(response.text)
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":100,         // 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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/addGeoZone
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/addGeoZone' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/addGeoZone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/addGeoZone");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/addGeoZone"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
    "status_code": 200,
    "status_message": "OK",
    "response": {
        "GeoZones": [550, 551]	//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 an JSON array.

 
request.geozones.name
string

Geozone name

request.geozones.lat
string
required

Latitude

request.geozones.lng
string

Longitude

request.geozones.cooldown
integer

Silent period after sending a notification, in seconds

request.geozones.range
integer

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

request.geozones.content
string

content of the push message.

request.geozones.presetCode
string

Push preset could be used instead of content field

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/updateGeoZone
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/updateGeoZone' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/updateGeoZone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/updateGeoZone");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/updateGeoZone"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteGeoZone
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteGeoZone' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteGeoZone")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteGeoZone");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteGeoZone"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster"

response = requests.request("POST", url)

print(response.text)
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 ID

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster"

response = requests.request("POST", url)

print(response.text)
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.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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/listGeoZones
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/listGeoZones' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/listGeoZones")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/listGeoZones");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/listGeoZones"

response = requests.request("POST", url)

print(response.text)
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 ID

 

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters"

response = requests.request("POST", url)

print(response.text)
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 ID

 

Enterprise API

Lists Geozone Clusters for the application.

Suggest Edits

/configureApplication for iOS

 

Enterprise API

Configures application on the account. There are separate requests for auto- and manual configuration.

Manual configuration

Request

{
  "request":{
    "auth":"API_ACCESS_TOKEN",
    "application":"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" // one of native, cordova, titanium, marmalade, adobeAir, corona, xamarin, phoneGapBuild, triggerIO, unity
  }
}

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
    }
  }
}

Auto configuration

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

Request

{
  "request":{
    "auth":"API_ACCESS_TOKEN",
    "application":"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" // one of 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":"API_ACCESS_TOKEN",
    "application":"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", // one of 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":"API_ACCESS_TOKEN",
    "application":"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", // one of 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":"API_ACCESS_TOKEN",
    "application":"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", // one of 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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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 ID

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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 ID

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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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.

 

Enterprise API

Configures application on the account.

Suggest Edits

/configureApplication for Safari and Chrome

 
posthttps://cp.pushwoosh.com/json/1.3/configureApplication
curl --request POST \
  --url https://cp.pushwoosh.com/json/1.3/configureApplication
var request = require("request");

var options = { method: 'POST',
  url: 'https://cp.pushwoosh.com/json/1.3/configureApplication' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://cp.pushwoosh.com/json/1.3/configureApplication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://cp.pushwoosh.com/json/1.3/configureApplication");

xhr.send(data);
import requests

url = "https://cp.pushwoosh.com/json/1.3/configureApplication"

response = requests.request("POST", url)

print(response.text)
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.