Mandrill search for non-english phrase
Try POST request with search query to:
https://mandrillapp.com/api/1.0/messages/search.json
{
"key": "secret_api_key",
"query": "subject:\"МАМОНТёнок\"",
"date_from": "2016-05-12",
"date_to": "2016-05-13",
"api_keys": [
"secret_api_key"
],
"limit": 100
}
And you will got a wrong response. You need to encode text to UTF, for example you can use http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_unescape and replace line
document.write(escape("Need tips? Visit W3Schools!"));
with
document.write(unescape(encodeURIComponent("МАМОНТёнок")));
And you will got an appropriate search query value: «ÐÐÐÐÐТÑнок», use it in request:
{
"key": "secret_api_key",
"query": "subject:\"ÐÐÐÐÐТÑнок\"",
"date_from": "2016-05-12",
"date_to": "2016-05-13",
"api_keys": [
"secret_api_key"
],
"limit": 100
}
Thanks
Ответить