Tags

API methods to manage Tags

post
/addTag

https://cp.pushwoosh.com/json/1.3/addTag
Creates a new tag in the database.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
tag
required
object
Tag parameters.
tag.name
required
string
Tag name.
tag.type
required
integer
Tag type. See possible values below.
tag.application_specific
optional
boolean
Defines whether the tag value should be different for multiple apps or be the same across multiple apps.
Response
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"result": true
}
}

For Private Offering subscriptions only.

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"tag": {
"name": "TAG_NAME",
"type": 1, // see possible values below
"application_specific": true, // or 'false'. Defines whether the tag value should be different for multiple apps or be the same across multiple apps
"user_specific": true // or 'false', used for application_specific tags
}
}
}

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"

post
/deleteTag

https://cp.pushwoosh.com/json/1.3/deleteTag
Completely removes a tag with all the associated information from the database.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
tag
required
object
Tag parameters.
tag.name
required
string
Name of a tag to delete.
Response
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"result": true
}
}

For Private Offering subscriptions only.

Example
{
"request": {
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"tag": {
"name": "TAG_NAME" // name of a tag to delete
}
}
}

post
/listTags

https://cp.pushwoosh.com/json/1.3/listTags
Retrieves a list of tags on the account.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
Response
200: OK
{
"status_code":200,
"status_message":"OK",
"response":{
"tags":[
{
"name":"Language",
"type":2,
"isApplicationSpecific": false
},
{
"name":"List tag",
"type":3,
"isApplicationSpecific": false
}
]
}
}

For Private Offering subscriptions only.

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

Tag types:

  • 1 - Integer

  • 2 - String

  • 3 - List

  • 4 - Date

  • 5 - Boolean

  • 6 - Decimal. Ex: 19.95

  • 7 - Version. Ex: "1.0.0.0"

post
/getTags

https://cp.pushwoosh.com/json/1.3/getTags
Retrieves a list of tags with corresponding values for the specific device.
Request
Response
Request
Body Parameters
application
required
string
Pushwoosh application code.
userId
optional
string
User identifier to be used instead of "hwid". If used together with a "hwid", the "hwid" prevails.
hwid
optional
string
Hardware device ID used in /registerDevice request.
Response
200: OK
{
"status_code": 200,
"status_message": "OK",
"response": {
"result": {
"Language": "fr"
}
}
}
Example
{
"request":{
"application": "XXXXX-XXXXX", // Pushwoosh application code
"hwid": "HWID", // optional, hardware device ID used in /registerDevice function call
"userId": "The ID of a specific user" // optional, can be used instead of "hwid" to retrieve tags for a specific user
}
}

post
/bulkSetTags

https://cp.pushwoosh.com/json/1.3/bulkSetTags
Sets tag values for the list of devices.
Request
Response
Request
Body Parameters
auth
required
string
API access token from Pushwoosh Control Panel.
application
required
string
Pushwoosh app code.
devices
required
array
An array of JSON objects. See the example request for the details. Max 1000 devices.
Response
200: OK
OK
Error
OK
{
"response":"None",
"status_code":200,
"status_message":"OK"
}
Error
{
"message": "invalid request",
"errors": [
"tags [TagName] not found"
]
}
Example
{
"request":{
"application": "AAAAA-BBBBB", // Pushwoosh app code
"auth": "yxoPUlwqm…………pIyEX4H", // API access token from Pushwoosh Control Panel
"devices":[
{
"hwid":"15fbe9125b1b0c07b9315703", // hardware ID of a device
"tags":{ // tags to set values for
"Age":18, // tag name and value
"Name":"Anna"
}
},
{
"hwid":"ba08e11ea6485d867",
"tags":{
"Age":19,
"Name":"Kevin"
}
}
]
}
}

To set tags for all devices associated to a particular User ID, use the "userId" parameter instead of "hwid":

Example
{
"request": {
"auth":"yxoPUlwq......QmpIyEX4H",
"application": "AAAAA-BBBBB",
"devices":[
{
"userId": "some_user",
"tags":{
"some boolean tag": false
}
}
]
}
}

The maximum number of devices in a single request is 1000.