post https://cp.pushwoosh.com/json/1.3/setTags
Sets tag values for the device. (Called from the SDK)
Sets tag values for the device.
Important
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.
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
//see http://gomoob.github.io/php-pushwoosh/set-tags.html
use 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();
}