Hi, I am using pushwoosh in trial account. I set tags by API using setTags method and It response was status code 200.

But I haven't can push when set that tag to device filter (using createTargetedMessage method of API).

Can I set tag in trial account? Or did I mistake usage?

asked 15 Apr '14, 17:13
haruna%20nishiwaki's gravatar image

haruna nishi...
112

Hello,

Actually, there are no such limitations on a trial account. However, as I can see, none of your Tags has any values set. Could you please provide the setTags request you are sending? Most probably, there is some kind of a misprint there.

permanent link
answered 16 Apr '14, 06:12
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

I ran this script (PHP) :


function doPostRequest($url, $data, $optional_headers = null) {
$params = array(
'http' => array(
'method' => 'POST',
'content' => $data,
));
if ($optional_headers !== null) {
$params['http']['header'] = $optional_headers;
}
$ctx = stream_context_create($params);
$fp = fopen($url, 'rb', false, $ctx);
if (!$fp)
throw new Exception("Problem with $url, $php_errmsg");

$response = stream_get_contents($fp);
if ($response === false)
return false;
return $response;
}

function pwCall($action, $data = array()) {
$url = 'https://cp.pushwoosh.com/json/1.3/' . $action;
$json = json_encode(array('request' => $data));
$res = doPostRequest($url, $json, 'Content-Type: application/json');
print_r(json_decode($res, true));
}

pwCall( 'setTags', array(
'application' => PW_APPLICATION,
'hwid' => MY_HARDWARE_ID,
'tags' => array(
'gameuserid' => 1234,
)
)
);


Then, response is this:


Array ( [status_code] => 200 [status_message] => OK [response] => Array ( [skipped] => Array ( )

    )

)


Next, I ran this:


pwCall( 'compileFilter', array(
'auth' => PW_AUTH,
'devices_filter' => 'A("' . PW_APPLICATION . '") * T("gameuserid", EQ, 1234)'
)
);


Then, response is this:


Array ( [status_code] => 200 [status_message] => OK [response] => Array ( [devices_count] => 0 )

)


Did I mistake usage?

permanent link
answered 16 Apr '14, 06:35
haruna%20nishiwaki's gravatar image

haruna nishi...
112

1

It looks that everything is correct in the request. Could you please provide the HWID you are using in the request? The only thing we can think of is that it's not in our database for some reason. Please note that you can start a support ticket via Contact Us form on our website.

(16 Apr '14, 07:42) Dmitry Dyudeev Dmitry%20%20Dyudeev's gravatar image

Thanks, I will do so.

(16 Apr '14, 07:50) haruna nishi... haruna%20nishiwaki's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×120
×64
×37
×10

question asked: 15 Apr '14, 17:13

question was seen: 1,875 times

last updated: 16 Apr '14, 07:50