{"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"
{"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}}}
{"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"
{"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}}
{"status_code":200,"status_message":"OK","response": null}
The method is called from SDK. It is possible to call it remotely from your backend, however you need to maintain an up-to-date database of hwid’s on the backend side.
Please avoid setting more that 50 tag values in a single /setTags
request.
Example{"request":{"application": "XXXXX-XXXXX", // Pushwoosh application code"hwid": "8f65b16df378e7a6bece9614e1530fb2", // hardware device ID used in /registerDevice function call"tags": {"StringTag": "string value","IntegerTag": 42,"ListTag": ["string1","string2"], // sets the list of values for Tags of List type"DateTag": "2015-10-02 22:11", // note the time is in UTC"BooleanTag": true, // valid values are - true, 1, false, 0, null}}}
To extend the List Tag with new values, use the operation
parameter with the "append" value as follows:
Example{"request": {"hwid": "3d124a793575f189a5ca7dfd96e8aafd", // hardware device ID used in /registerDevice function call"application": "61A79-C09B3", // Pushwoosh application code"tags": {"ListTag": {"operation": "append", // appends following values to the Tag's list of values"value": [ // values to append"tag2","tag3"]}}}}
To set tags for all devices associated to a particular User ID, use the "userId" parameter instead of "hwid":
Example{"request":{"application": "AAAAA-BBBBB", // Pushwoosh app code"userId": "some_user", // user ID you'd like to set tags for"tags": { // tags and values to set"Language": "es"}}}
For emails call /setEmailTags
.
Status codes:
HTTP Status code | status_code | Description |
200 | 200 | Tags have been successfully set |
200 | 210 | Argument error. See status_message for more info. |
400 | N/A | Malformed request string |
500 | 500 | Internal error |
PHP<?php//see http://gomoob.github.io/php-pushwoosh/set-tags.htmluse Gomoob\Pushwoosh\Model\Request\SetTagsRequest;// Creates the request instance$request = SetTagsRequest::create()->setTags(array('StringTag' => 'string value','IntegerTag' => 'integer value','ListTag' => ['string1', 'string2']))->setHwid('HWID');// Call the '/setTags' Web Service$response = $pushwoosh->setTags($request);if($response->isOk()) {print 'Ok, operation successful.';} else {print 'Oups, the operation failed :-(';print 'Status code : ' . $response->getStatusCode();print 'Status message : ' . $response->getStatusMessage();}
{"response":"None","status_code":200,"status_message":"OK"}
{"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.