Hi. Im trying to send createMessage request from Unity3d game. This is how i add a send_date field:

{"sendDate", DateTime.Now.AddSeconds(RefillGasTank.RefillSecondsRemainingFull).ToUniversalTime().ToString("yyyy-MM-dd HH:mm")}

And this is the JSON string that i pass to request:

{"request":{"application":"APP_CODE","auth":"MY_API_TOKEN","notifications":[{"content":"blah blah!","sendDate":"2015-04-28 09:16"},{"content":"blah blah!","sendDate":"2015-04-28 19:00"}],"conditions":"[\"playerId\",\"EQ\",\"918762\"]","wp_type":"Toast"}}

This is how i send a request:

var headers = new Dictionary<string, string>() { { "Content-Type", "text/json" } };
var request = new WWW(PUSHWOOSH_API_PATH + "/createMessage", Encoding.UTF8.GetBytes(json), headers);

And when it finishes i get this response: "status_code":210,"status_message":"Cannot parse date","response":null

So, what`s wrong? How to pass date properly? Thank You

asked 28 Apr '15, 10:23
andreykhorkov's gravatar image

andreykhorkov
214

edited 28 Apr '15, 12:11

Alex%20Spotar's gravatar image

Alex Spotar
3.6k6

Hi!

The proper parameter name is "send_date":"", not "sendDate":"", please refer to Remote API guide.

permanent link
answered 28 Apr '15, 11:51
Alex%20Spotar's gravatar image

Alex Spotar
3.6k6

edited 28 Apr '15, 12:35

i just type it wrong at this post header. In my request i use "sendDate"

(28 Apr '15, 12:20) andreykhorkov andreykhorkov's gravatar image

Right, but it must be "send_date" instead of "sendDate"

(28 Apr '15, 12:24) Alex Spotar Alex%20Spotar's gravatar image

omg)) thank you

(28 Apr '15, 12:29) andreykhorkov andreykhorkov'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
×88
×52
×11

question asked: 28 Apr '15, 10:23

question was seen: 859 times

last updated: 28 Apr '15, 12:35