createMessage "210 - can not parse date" response
AnsweredHi. 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
-
Hi!
The proper parameter name is
"send_date":""
, not"sendDate":""
, please refer to Remote API guide.
Please sign in to leave a comment.
Comments
4 comments