Skip to content

/createMessage parameters

Here you’ll find the descriptions of the /createMessage API parameters.

  • Required parameters must be included to successfully send a /createMessage API request and broadcast a push notification at the specified time.

  • Optional parameters allow you to customize push notification properties.

Required parameters

Anchor link to

Required parameters are obligatory to use in /createMessage requests. Otherwise, the request won’t be submitted.

application

Anchor link to

Unique code of an app created in your Pushwoosh account. App code can be found at the top left corner of the Control Panel or in response to a /createApplication request. The app code is a hyphen-separated set of 10 characters (both letters and digits).

Pushwoosh application code displayed in the Control Panel at the top left corner

When creating an app via the API, you’ll get an app code in response to your /createApplication request.

To obtain a code of a previously created app via the API, call /getApplications. In response to the /getApplications request, you’ll receive the list of all apps created in your Pushwoosh account with their names and codes.

API access token from Pushwoosh Control Panel. Go to SettingsAPI Access and copy a token you’d like to use or generate a new one.

API Access settings page in Pushwoosh Control Panel showing API access tokens

When generating an access token, specify its permissions. Check the checkboxes for those types of activities you’re going to use the API token with. You can create app-specific API tokens by checking the Applications checkboxes.

API token generation dialog with permissions and application checkboxes

The string or object that defines the message content. The “content” parameter submitted with a string type value will send the same message for all recipients.

String
"content": "Hello world!",

JSON objects are used for specifying content using Dynamic Content, for example, for multi-language messages.

Object
"content": {
"en": "Hello!",
"es": "¡Hola!",
"de": "Hallo!"
},

notifications

Anchor link to

The JSON array of push properties. Must include at least the required content and send_date parameters.

Optional parameters to use within the “notifications” array:

Date and time on which the message is sent. Can be any date and time formatted as YYYY-MM-DD HH:mm or ‘now’. If set to ‘now’, the message will be sent immediately after submitting the request.

Optional parameters

Anchor link to

The code of a Campaign. To obtain a Campaign code, go to StatisticsAggregated statistics and select the Campaign you’re going to use. The campaign code will be visible at the end of the page URL in the format XXXXX-XXXXX.

Example:

URL: https://app.pushwoosh.com/applications/AAAAA-AAAAA/statistics/aggregated-message?campaignCode=XXXXX-XXXXX

Campaign code: XXXXX-XXXXX

To obtain a list of Campaigns with their codes, call /getCampaigns. In response to the /getCampaigns request, you’ll receive the list of all Campaigns created for a particular app in your Pushwoosh account, with their codes, names, and descriptions.

capping_days

Anchor link to

Period to be applied for frequency capping, in days (max 30 days). See Frequency capping for details.

capping_count

Anchor link to

The maximum number of pushes that can be sent from a specific app to a particular device within a “capping_days” period. In case the message created exceeds the “capping_count” limit for a device, it won’t be sent to that device. See Frequency capping for details.

conditions

Anchor link to

Conditions are arrays like [tagName, operator, operand] used for sending targeted messages based on Tags and their values, where:

  • tagName — the name of a tag to apply,
  • operator — a value comparison operator (“EQ” | “IN” | “NOTEQ” | “NOTIN” | “LTE” | “GTE” | “BETWEEN” | “NOTSET” | “ANY”),
  • operand — Tag values of any of the following types: string | integer | array | date | boolean | list

Operator description

Anchor link to
EQtag value is equal to operand.
INtag value intersects with operand (operand must always be an array).
NOTEQtag value is not equal to an operand.
NOTINtag value does not intersect with operand (operand must always be an array).
GTEtag value is greater than or equal to operand.
LTEtag value is less than or equal to operand.
BETWEENtag 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).
NOTSETtag is not set. Operand is not considered.
ANYtag has any value. Operand is not considered.

String tags

Anchor link to

Valid operators: EQ, IN, NOTEQ, NOTIN, NOTSET, ANY

Valid operands:

EQ, NOTEQoperand must be a string
IN, NOTINoperand must be an array of strings like ["value 1", "value 2", "value N"]
NOTSETtag is not set. Operand is not considered
ANYtag has any value. Operand is not considered

Integer tags

Anchor link to

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

Valid operands:

EQ, NOTEQ, GTE, LTEoperand must be an integer
IN, NOTINoperand must be an array of integers like [value 1, value 2, value N]
BETWEENoperand must be an array of integers like [min_value, max_value]
NOTSETtag is not set. Operand is not considered
ANYtag has any value. Operand is not considered

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

Valid operands:

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

Boolean tags

Anchor link to

Valid operators: EQ, NOTSET, ANY

Valid operands: 0, 1, true, false

Valid operators: IN, NOTIN, NOTSET, ANY

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

conditions_operator

Anchor link to

Logical operator for conditions arrays. Possible values: AND | OR. AND is default.

If the operator applied is AND (when no operator is specified, or the ‘conditions_operator’ param has the ‘AND’ value), devices simultaneously complying with all the conditions will receive the push notification.

If the operator is OR, devices that comply with any of the specified conditions will receive the message.

JSON string or JSON object used to pass any custom data in the push payload; is passed as “u” parameter in the payload (converted to JSON string).

The array of push tokens or hwids to send targeted push notifications. If set, the message will only be sent to the devices on the list.

dynamic_content

Anchor link to

Placeholders for Dynamic Content to be used instead of device Tag values. The example below will send the “Hello, John!” message to every user you target. If not set, the Dynamic Content values are taken from the device Tags.

"content": "Hello, {firstname|CapitalizeFirst}!",
"dynamic_content_placeholders": {
"firstname": "John",
"lastname": "Doe"
},

The name of a Segment exactly as it’s created in Pushwoosh Control Panel or via a /createFilter API request. Go to the AudienceSegments section and check the list of Segments created.

Segments list in the Audience section of Pushwoosh Control Panel

To get Segments list via the API, call the /listFilters API method. In response to the /listFilters request, you’ll receive the list of all Segments created in your Pushwoosh account, with Segments’ names, conditions, and expiration dates.

ignore_user_timezone

Anchor link to

If set to ‘true’, sends the message at the time and date specified in the “send_date” parameter according to UTC-0.

If set to ‘false’, users will receive the message at the specified local time according to their device’s settings.

inbox_date

Anchor link to

The date until which the message should be kept in users’ Inbox. If not specified, the message will be removed from Inbox on the next day after the sending date.

inbox_image

Anchor link to

The URL of the custom image to be shown near the message in Inbox.

inbox_days

Anchor link to

The lifetime of an inbox message in days, up to 30 days. After this period, the message will be removed from the inbox. Can be used instead of the inbox_date parameter.

The URL to be opened once a user opens a push notification.

Anchor link to

Shortener to minimize the URL submitted in the “link” parameter. Please note that push notification payload size is limited, so consider creating short URLs not to exceed the limit. Available values: 0 — do not minimize, 2 — bitly. Default = 2. Google URL shortener is disabled since March 30, 2019.

The array of platform codes to send the message to specific platforms only.

Available platform codes include: 1 — iOS, 3 — Android, 7 — Mac OS X, 8 — Windows, 9 — Amazon, 10 — Safari, 11 — Chrome, 12 — Firefox, 14 — Email, 17 — Huawei, 18 — SMS, and 21 — WhatsApp.

The code of a Preset created in Pushwoosh Control Panel or via API. To obtain a preset code, go ContentPresets, expand the preset you are going to use, and copy the Preset Code from preset’s details.

Presets list in Content section showing Preset Code

rich_media

Anchor link to

The code of a Rich Media page you’re going to attach to your message. To obtain a code, go to ContentRich Media, open a Rich Media page you are going to use, and copy the code from the URL bar of your browser. The code is a hyphen-separated set of 10 characters (both letters and digits).

Rich Media page in Content section with Rich Media code in the browser URL bar

Throttling to restrain the push sending speed. Valid values are from 100 to 1000 pushes/second.

Timezone to be taken into account when the message is sent on a particular date and time. If set, the device’s timezone is ignored. If ignored, the message is sent in UTC. See https://php.net/manual/timezones.php for supported timezones.

template_bindings

Anchor link to

Template placeholders to use in your content template. See the Liquid Templates guide for details.

transactionId

Anchor link to

Unique message identifier to prevent duplicating messages in case of network problems. You can assign any ID to a message created via the /createMessage or /createTargetedMessage request. Stored on the side of Pushwoosh for 5 minutes.

The array of userIds. User ID is a unique user identifier set by a /registerUser, /registerDevice, or /registerEmail API request.