/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 codestatus_codeDescription
200200Tags have been successfully set
200210Argument error. See status_message for more info
400N/AMalformed request string
500500Internal 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();
}
Language
Click Try It! to start a request and see the response here!