Tags API
API methods to manage Tags
To set tag values for HWIDs and UserIDs, use the /setTags method from Device API.

addTag

post
https://cp.pushwoosh.com/json/1.3
/addTag
/addTag
Creates a tag in your account.
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"tag": {
5
"name": "TAG_NAME",
6
"type": 1, // see possible values below
7
"application_specific": true, // or 'false'. Defines whether the tag value should be different for multiple apps or be the same across multiple apps
8
"user_specific": true // or 'false', used for application_specific tags
9
}
10
}
11
}
Copied!
Possible tag value types:
  • 1 - Integer
  • 2 - String
  • 3 - List
  • 4 - Date
  • 5 - Boolean
  • 6 - Decimal. Ex: 19.95
  • 7 - Version. Ex: "1.0.0.0"

deleteTag

post
https://cp.pushwoosh.com/json/1.3
/deleteTag
/deleteTag
Completely removes a tag with all the associated information from the database.
For Private Offering subscriptions only.
Example
1
{
2
"request": {
3
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
4
"tag": {
5
"name": "TAG_NAME" // name of a tag to delete
6
}
7
}
8
}
9
10
Copied!

listTags

post
https://cp.pushwoosh.com/json/1.3
/listTags
/listTags
Retrieves a list of tags on the account.
For Private Offering subscriptions only.
Example
1
{
2
"request":{
3
"auth": "yxoPUlwqm…………pIyEX4H" // API access token from Pushwoosh Control Panel
4
}
5
}
Copied!
Tag types:
  • 1 - Integer
  • 2 - String
  • 3 - List
  • 4 - Date
  • 5 - Boolean
  • 6 - Decimal. Ex: 19.95
  • 7 - Version. Ex: "1.0.0.0"

getTags

post
https://cp.pushwoosh.com/json/1.3
/getTags
/getTags
Retrieves a list of tags with corresponding values for the specific device.
Example
1
{
2
"request":{
3
"application": "XXXXX-XXXXX", // Pushwoosh application code
4
"hwid": "HWID", // optional, hardware device ID used in /registerDevice function call
5
"userId": "The ID of a specific user" // optional, can be used instead of "hwid" to retrieve tags for a specific user
6
}
7
}
Copied!

bulkSetTags

post
https://api.pushwoosh.com/api/v2/audience
/bulkSetTags
/bulkSetTags
Sets tag values for the list of devices.
Request:
1
{
2
"application" : "application code",
3
"auth" : "Pushwoosh auth token",
4
"create_missing_tags" : false, // should automatically create missing tags
5
"devices" : [{ // array of devices
6
"hwid" : "device hwid", // device hwid (one of: "hwid", "pushtoken" or "userid")
7
"user_id" : "user ID", // (one of: "hwid", "pushtoken" or "userid")
8
"push_token" : "device push token", // (one of: "hwid", "pushtoken" or "userid")
9
"list_operator" : "set", // how to set list tags (could be: "set", "append", "remove")
10
"tags" : {
11
"tag_name" : "tagvalue", // use correct value type
12
"tag_name2" : "tagvalue2"
13
}
14
}]
15
}
16
Copied!
Response:
1
{
2
"request_id" : "request_id to use in GET method to obtain job status",
3
"status" : "Pending"
4
}
Copied!
get
https://api.pushwoosh.com/api/v2/audience
/bulkSetTags/{request_id}?detailed=false
/bulkSetTags status
Returns the status of /bulkSetTags operation
Response:
1
{
2
"request_id": "id of the request",
3
"status": "Completed", // also "Pending", "Failed"
4
"progress": 100, // jobs progress 0-100
5
"devices_success": 100, // good devices
6
"devices_not_found": 0, // devices not found in Pushwoosh
7
"devices_failed": 0, // errored
8
"devices": [ // device report (only in detailed = true)
9
{
10
"hwid": "device hwid",
11
"status": "done", // also "failed", "not found"
12
"tags": {
13
"tagName": "ok",
14
"tagName2": "tag not found",
15
"tagName3": "wrong value. expect :string",
16
}
17
}
18
]
19
}
20
Copied!