{ "id": "127402", "key": "AC-1375", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-03-14T08:46:30.000+0000", "created": "2014-03-07T08:33:39.000+0000", "labels": [ "Cloud", "PushNotifications", "expire_after_seconds" ], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:47.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "h5. Problem Description:\r\nWe are unable to use the expire_after_seconds option when using the REST API\r\nWe are getting the following response\r\n{\r\n \"meta\": {\r\n \"code\": 400,\r\n \"status\": \"fail\",\r\n \"message\": \"Invalid json format on options parameter: can't convert ActiveSupport::HashWithIndifferentAccess into String\"\r\n }\r\n}\r\n\\\\\r\nh5. Testcase:\r\nUri\r\nhttps://api.cloud.appcelerator.com/v1/push_notification/notify_tokens.json?key=\r\n\\\\\r\nh5. Request headers\r\nUser-Agent: Fiddler\r\nHost: api.cloud.appcelerator.com\r\nContent-Length: 174\r\nCookie: \r\nContent-Type: application/json\r\n\\\\\r\nh5. Request body (POST)\r\n{code:json}\r\n{\r\n\t\"channel\": \"test\",\r\n\t\"to_tokens\": \"everyone\",\r\n\t\"payload\": {\r\n\t\t\"alert\": \"Push Notification Test\",\r\n\t\t\"title\": \"this is the title\"\r\n\t},\r\n \"options\": {\"expire_after_seconds\": 86400}\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Cloud PushNotifications expire_after_seconds issue", "creator": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Cloud REST API", "comment": { "comments": [ { "id": "296539", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi, \n\nI tested that API and check the source code. Are you sure you set options by the exactly same format {\"expire_after_seconds\": 86400}.\nbecause if you use single quotation marks like {'expire_after_seconds': 86400}, it will cause error then get the exception like you got.\n\nAnd there is something wrong with the documents. we have to use double quotation marks here.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-11T09:17:03.000+0000", "updated": "2014-03-11T09:17:03.000+0000" }, { "id": "296540", "author": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes we are using double quotes\nWe are still getting the same error as described above", "updateAuthor": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-11T09:26:51.000+0000", "updated": "2014-03-11T09:26:51.000+0000" }, { "id": "296716", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Would please tell me do you use the notify_token API in a app, or a curl commands?\r\nAnd can you pass parts of the code you wrote, I have to make sure the data format.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-12T01:40:48.000+0000", "updated": "2014-03-12T01:43:42.000+0000" }, { "id": "296748", "author": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We have tried using the notify_tokens API both from .NET 4.0 and Fiddler\r\nHere's a screenshot of how we compose the fiddler request: \r\n!https://www.dropbox.com/s/fz41rw3d4r7z625/fiddler.jpg! https://www.dropbox.com/s/fz41rw3d4r7z625/fiddler.jpg\r\n\r\nWe are also having trouble showing the letters æøå on android devices, they are being shown as ? symbols\r\nUTF-8 encoding is being used from our .NET application", "updateAuthor": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-12T08:39:43.000+0000", "updated": "2014-03-12T08:42:13.000+0000" }, { "id": "297173", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi, \n\nI am still testing notidy_tokens API's issue. Will notice you as soon as solve it.\n\nFor the letter display problem, you may use ASCII code.\nRef: http://www.ascii-code.com/", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-14T01:33:10.000+0000", "updated": "2014-03-14T01:33:10.000+0000" }, { "id": "297192", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-14T03:13:52.000+0000", "updated": "2014-03-14T03:13:52.000+0000" }, { "id": "297223", "author": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the update\n\nWe can't get the ASCII encoding to work with Å, Æ, Ø\nThe iPhone accepts displays the ascii encoded characters correctly, but our android devices still shows ? symbols\n\nYour options fix seems to be working, so thanks for that :)\nShould I open a new issue about the encoding problem?", "updateAuthor": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-14T08:12:00.000+0000", "updated": "2014-03-14T08:12:00.000+0000" }, { "id": "297227", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Ye, Please create a new issue about encoding problem, thanks.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-14T08:45:14.000+0000", "updated": "2014-03-14T08:45:14.000+0000" }, { "id": "297228", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Customer's options issue fixed.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-03-14T08:46:30.000+0000", "updated": "2014-03-14T08:46:30.000+0000" }, { "id": "307151", "author": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The fix is no longer working.\r\nEverytime we try and apply the option expire_after_seconds, the API responds with a 500 Internal Server Error.\r\nYou could guys Please fix the problem without having to apply a workaround.\r\n\r\nh5. Test with previous workaround applied:\r\n{code:json}\r\n{\r\n\t\"channel\": \"test\",\r\n\t\"to_tokens\": \"everyone\",\r\n\t\"payload\":{\r\n\t\t\"alert\": \"Test message.\",\r\n\t\t\"title\": \"\"\r\n\t},\r\n\t\"options\": '{\"expire_after_seconds\": 3600}'\r\n}\r\n{code}\r\n\r\nh5. Response:\r\n{code:json}\r\n{\r\n \"meta\": {\r\n \"status\":\"fail\",\r\n \"code\":500,\r\n \"message\":\"Internal server error. The Appcelerator Cloud Services Team has just been notified of this problem.\"\r\n }\r\n}\r\n{code}", "updateAuthor": { "name": "stsje", "key": "stsje", "displayName": "Stephan Jensen", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-02T07:09:36.000+0000", "updated": "2014-06-02T07:12:12.000+0000" }, { "id": "307305", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nFirst of all, the \"expire_after_seconds\" quotes issue has been fixed, and will be deployed to production in next release. By the time, you won't need work around any more. \r\n\r\nThen, I have tested your problem in last comment. I can't reproduce your problem. The code works well for me. So would you please try \"curl\" command again, if still not working, can you send me part of your code which I can find the problem.\r\n\r\nRef my example:\r\n{code}\r\nAppc-MBP:Documents shuoliang$ curl -b cookies.txt -c cookies.txt -F \"channel=Test 1\" -F \"to_tokens=everyone\" -F \"payload=Test Message\" -F 'options={\"expire_after_seconds\":86400}' 'https://api.cloud.appcelerator.com/v1/push_notification/notify_tokens.json?key=H3PcVB7YSocRMbC8iGUoFtRxrGDFUfd1'\r\n{\r\n \"meta\": {\r\n \"status\": \"ok\",\r\n \"code\": 200,\r\n \"method_name\": \"NotifyTokens\"\r\n }\r\n}\r\n{code}\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-06-03T07:05:47.000+0000", "updated": "2014-06-03T07:05:47.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }