Tags API
addTag
POST
https://api.pushwoosh.com/json/1.3/addTag
Creates a tag in your account.
Request Body
Name | Type | Description |
---|---|---|
auth* | string | API access token from Pushwoosh Control Panel. |
tag* | object | Tag parameters. |
tag.name* | string | Tag name. |
tag.type* | integer | Tag type. See possible values below. |
tag.application_specific | boolean | Defines whether the tag value should be different for multiple apps or be the same across multiple apps. |
{ "status_code": 200, "status_message": "OK", "response": { "result": true }}
{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "tag": { "name": "TAG_NAME", // required. "type": 1, // required. See possible values below "application_specific": true, // optional. Defines whether the tag value should be different // for multiple apps or be the same across multiple apps "user_specific": true // optional. 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”
deleteTag
POST
https://api.pushwoosh.com/json/1.3/deleteTag
Completely removes a tag with all the associated information from the database.
Request Body
Name | Type | Description |
---|---|---|
auth* | string | API access token from Pushwoosh Control Panel. |
tag* | object | Tag parameters. |
tag.name* | string | Name of a tag to delete. |
{ "status_code": 200, "status_message": "OK", "response": { "result": true }}
{ "request": { "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel "tag": { "name": "TAG_NAME" // required. Name of a tag to delete } }}
listTags
POST
https://api.pushwoosh.com/json/1.3/listTags
Retrieves a list of tags on the account.
Request Body
Name | Type | Description |
---|---|---|
auth* | string | API access token from Pushwoosh Control Panel. |
{ "status_code": 200, "status_message": "OK", "response": { "tags": [{ "name":"Language", "type":2, "isApplicationSpecific": false }, { "name":"List tag", "type":3, "isApplicationSpecific": false }] }}
{ "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”
bulkSetTags
POST
https://api.pushwoosh.com/api/v2/audience/bulkSetTags
Sets tag values for the list of devices.
Request Body
Name | Type | Description |
---|---|---|
application* | String | Pushwoosh app code. |
auth* | String | API access token from Pushwoosh Control Panel. |
create_missing_tags | Boolean | If true, missing tags are created automatically. |
devices* | Object | Array of devices. |
devices.hwid | String | Can be used to identify a device instead of user_id or push_token |
devices.user_id | String | Can be used to identify a user instead of hwid or push_token |
devices.push_token | String | Can be used to identify a device instead of hwid or user_id |
devices.list_operator | String | Defines how to set values for tags of the list type: set, append, or remove |
devices.tags* | Object | Values to set for the tags specified. |
{ "request_id": "request_id to use in GET method to obtain job status", "status": "Pending"}
{ "message": "invalid request"}
{ "application": "application code", // required. Pushwoosh app code "auth": "Pushwoosh auth token", // required. API access token from Pushwoosh Control Panel "create_missing_tags": false, // optional. Should automatically create missing tags "devices": [{ // required. Array of devices "hwid": "device hwid", // optional. Can be used to identify a device instead of // "user_id" or "push_token". "user_id": "user ID", // optional. Can be used to identify a user instead of "hwid" or "push_token". "push_token": "device push token", // optional. Can be used to identify a device instead of "hwid" or "user_id". "list_operator": "set", // required. For list tags. Defines how to set values for // tags of the list type: set, append, or remove "tags": { // required. Values to set for the tags specified. "tag_name": "tagvalue", // use correct value type "tag_name2": "tagvalue2" } }]}
{ "request_id": "request_id to use in GET method to obtain job status", "status": "Pending"}
bulkSetTags status
GET
https://api.pushwoosh.com/api/v2/audience/bulkSetTags/{request_id}?detailed=false
Returns the status of /bulkSetTags operation
Path Parameters
Name | Type | Description |
---|---|---|
request_id | String | request id from previous /bulkSetTags call |
Query Parameters
Name | Type | Description |
---|---|---|
detailed | Boolean | (true/false) whether to return detailed per-device info |
{ "request_id": "id of the request", "status": "Completed", // also "Pending", "Failed" "progress": 100, // jobs progress 0-100 "devices_success": 100, // good devices "devices_not_found": 0, // devices not found in Pushwoosh "devices_failed": 0, // errored "devices": [{ // device report (only in detailed = true) "hwid": "device hwid", "status": "done", // also "failed", "not found" "tags": { "tagName": "ok", "tagName2": "tag not found", "tagName3": "wrong value. expect :string", } }]}