Filters
API methods to manage Filters

createFilter

post
https://cp.pushwoosh.com/json/1.3
/createFilter
/createFilter
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"name": "filter name",
5
"conditions": [["TagName1", "IN", ["value1", "value2"]], ["TagName2", "IN", ["value1", "value2"]]], // optional. Filter conditions
6
"operator": "AND", // operator values: 'AND', 'OR'
7
"application": "AAAAA-00000", // this parameter is usable only with High-Speed setup; omit otherwise
8
"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
9
}
10
}
11
12
// creating Filters for Timezones
13
{
14
"request": {
15
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
16
"name": "timezone name",
17
"conditions": [["Timezone", "BETWEEN", ["UTC-12:00", "UTC+14:00"]]],
18
}
19
}
Copied!

listFilters

post
https://cp.pushwoosh.com/json/1.3
/listFilters
/listFilters
For Private Offering subscriptions only.
Example
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H" // API access token from Pushwoosh Control Panel
4
}
5
}
Copied!

deleteFilter

post
https://cp.pushwoosh.com/json/1.3
/deleteFilter
/deleteFilter
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"name": "filter name"
5
}
6
}
Copied!

exportSegment

post
https://cp.pushwoosh.com/json/1.3
/exportSegment
/exportSegment
For Private Offering subscriptions only.
Example
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"devices_filter": "T(\"Language\", EQ, \"ru\")" // filter conditions.
5
}
6
}
Copied!
Please find Filter conditions syntax reference here.
To export all subscribers of a particular app, use the following Filter conditions:
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"devices_filter": "A(\"AAAAA-BBBBB\")" // Pushwoosh app code
5
}
6
}
Copied!
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
1
{
2
"status_code": 200,
3
"status_message": "OK",
4
"response": {
5
"devices_count": 50,
6
"public_url" : "https://static.pushwoosh.com/segment-export/segment.zip"
7
}
8
}
Copied!
1
{
2
"status_code":210,
3
"status_message":"Errors occured while compiling filter",
4
"response":{
5
"errors":[
6
{
7
"message":"Numeric or string constant expected.",
8
"type":"syntax",
9
"near":"en"
10
}
11
]
12
}
13
}
Copied!
Go to the link from the "public_url" parameter of the response to the /getResults request. A ZIP archive will be downloaded automatically. Unpack the archive to get the CSV file with the devices' data.
The CSV file contains the following data:
Field
Description
Example of value
Hwid
Hardware ID of a device
01D1BA5C-AAAA-0000-BBBB-9B81CD5823C8
User ID
User ID associating a device with a particular user. If no User ID assigned, the HWID is used.
user8192
Push Token
Unique identifier assigned to a device by cloud messaging gateways.
eeeb2fd7....0fc3547
Type
Platform type (integer).
1
Type (humanized)
Platform type (string).
iOS
Age
Value of the default Age tag.
29
ApplicationVersion
Value of the default Application Version tag.
1.12.0.0
City
Value of the default City tag.
us, boston
TagName
Value of a tag created in your account.
TagValue
Last modified 1mo ago