Filters

API methods to manage Filters

post
/createFilter

https://cp.pushwoosh.com/json/1.3/createFilter
Creates a new filter.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
name
required
string
Filter name.
conditions
optional
array
Filter conditions. Conditions syntax is explained in /createMessage.
operator
optional
string
Operator values: 'AND', 'OR'.
application
optional
string
Pushwoosh application code. This parameter is usable only with High-Speed Setup; omit otherwise.
expiration_date
optional
string
Filter expiry. The filter will be automatically deleted on a date specified, unless it's used in a Preset or an RSS Feed.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"name": "filter name"
}
}

For Private Offering subscriptions only.

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"name": "filter name",
"conditions": [["TagName1", "IN", ["value1", "value2"]], ["TagName2", "IN", ["value1", "value2"]]], // optional. Filter conditions
"operator": "AND", // operator values: 'AND', 'OR'
"application": "AAAAA-00000", // this parameter is usable only with High-Speed setup; omit otherwise
"expiration_date": "2018-12-31" // Filter expiry. The filter will be automatically deleted on date specified, unless it's used in a Push Preset or an RSS feed
}
}
// creating Filters for Timezones
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"name": "timezone name",
"conditions": [["Timezone", "BETWEEN", ["UTC-12:00", "UTC+14:00"]]],
}
}

post
/listFilters

https://cp.pushwoosh.com/json/1.3/listFilters
Returns a list of available filters with their conditions.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"filters": [
{
"name": "filter name",
"conditions": "#TagName1(value1, value2) AND #TagName2(value1, value2)",
"application" : "AAAAA-ZZZZZ", //only for app-specific filters
"expiration_date": "YYYY-MM-DD", //"null" for filters without expiration date
"application" : "AAAAA-ZZZZZ" // only for app-specific filters
}
]
}
}

For Private Offering subscriptions only.

Example
{
"request":{
"auth": "yxoPUlwqm…………pIyEX4H" // API access token from Pushwoosh Control Panel
}
}

post
/deleteFilter

https://cp.pushwoosh.com/json/1.3/deleteFilter
Deletes an existing filter.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
name
required
string
Filter name.
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": null
}

For Private Offering subscriptions only.

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"name": "filter name"
}
}

post
/exportSegment

https://cp.pushwoosh.com/json/1.3/exportSegment
A scheduled request. Exports the list of subscribers that fall under specified Filter conditions.
Request
Response
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
devices_filter
required
string
Filter conditions
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"request_id": "b3337d8ec78f67280a40a5b89050c0c0"
}
}

For Private Offering subscriptions only.

Example
{
"request":{
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"devices_filter": "T(\"Language\", EQ, \"ru\")" // filter conditions.
}
}

Please find Filter conditions syntax reference here.

Like every scheduled request, /exportSegment 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:

Example success response
Example error response
{
"status_code": 200,
"status_message": "OK",
"response": {
"devices_count": 50,
"public_url" : "https://static.pushwoosh.com/segment-export/segment.zip"
}
}