Segmentation (Filters) API
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/api/v2/audience
/exportSegment
/exportSegment
For Private Offering subscriptions only.
Example
1
{
2
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
3
"filterExpression": "AT(\"12345-67890\", \"Name\", any)",
4
"exportData": ["hwids", "tags"]
5
}
Copied!
Please find Segmentation Language reference for writing filter expressions here.
For example, to export all subscribers of a particular app, use the following Filter conditions:
1
{
2
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
3
"filterExpression": "A(\"AAAAA-BBBBB\")" // Pushwoosh app code
4
}
Copied!
In the response, you'll get the task_id to get the resulting CSV. Then, call /exportSegment/result with that task_id in the request body to retrieve the resulting CSV.

/exportSegment results

post
https://cp.pushwoosh.com/api/v2/audience
/exportSegment/result
/exportSegment/result
Pass the "task_id" received in your /exportSegment response in the /exportSegment/result request body.
In /exportSegment/result response, you'll get the "csvFilename" parameter; go to the link specified as that param value. A ZIP archive will be downloaded automatically. Unpack the archive to get the CSV file with the devices' data.
If you specify the "exportData" in your /exportSegment request, the CSV downloaded will contain the data requested. By default, 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