{"action":"created","issue":{"url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/98","labels_url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/98/comments","events_url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/98/events","html_url":"https://github.com/volunteer-planner/lagesonum/issues/98","id":113174200,"number":98,"title":"Telegram notifications","user":{"login":"ffflorian","id":5497598,"avatar_url":"https://avatars.githubusercontent.com/u/5497598?v=3","gravatar_id":"","url":"https://api.github.com/users/ffflorian","html_url":"https://github.com/ffflorian","followers_url":"https://api.github.com/users/ffflorian/followers","following_url":"https://api.github.com/users/ffflorian/following{/other_user}","gists_url":"https://api.github.com/users/ffflorian/gists{/gist_id}","starred_url":"https://api.github.com/users/ffflorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ffflorian/subscriptions","organizations_url":"https://api.github.com/users/ffflorian/orgs","repos_url":"https://api.github.com/users/ffflorian/repos","events_url":"https://api.github.com/users/ffflorian/events{/privacy}","received_events_url":"https://api.github.com/users/ffflorian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/volunteer-planner/lagesonum/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-24T17:49:28Z","updated_at":"2015-10-25T15:30:52Z","closed_at":null,"body":"For the Telegram notifications (which will be a Node.js application) we will send and expect the following JSON POST requests to and from the server:\r\n\r\n### From the app to the server\r\n#### When the app checks if a ticket exists\r\n```json\r\n{\r\n\t\"requestid\": \"4yX4h9HZg\",\r\n\t\"search\": true,\r\n\t\"ticket\": \"B123\"\r\n}\r\n```\r\n\r\n#### When the user subscribes to a ticket\r\n```json\r\n{\r\n\t\"requestid\": \"rUyI1NEbSA\",\r\n\t\"userid\": 123456789,\r\n\t\"language\": \"de_DE\",\r\n\t\"ticket\": \"B123\",\r\n\t\"subscribe\": true\r\n}\r\n```\r\n\r\n#### When the user unsubscribes from a ticket\r\n```json\r\n{\r\n\t\"requestid\": \"JSv4btdNHt\",\r\n\t\"userid\": 123456789,\r\n\t\"ticket\": \"B123\",\r\n\t\"subscribe\": false\r\n}\r\n```\r\n\r\n#### When the user unsubscribes from all tickets\r\n```json\r\n{\r\n\t\"requestid\": \"JSv4btdNHt\",\r\n\t\"userid\": 123456789,\r\n\t\"subscribe\": false\r\n}\r\n```\r\n\r\n#### When the user requests a list of their currently subscribed tickets\r\n```json\r\n{\r\n\t\"requestid\": \"JSv4btdNHt\",\r\n\t\"userid\": 123456789,\r\n\t\"list\": true\r\n}\r\n```\r\n\r\nThe field ```requestid``` is for internal verification, it just needs to be returned.\r\n\r\n### From the server to the app\r\n#### When a user needs to be notified because their ticket was seen\r\n```json\r\n{\r\n\t\"userid\": 123456789,\r\n\t\"message\": \"Dein Ticket B123 wurde um 12:48 Uhr gesehen.\"\r\n}\r\n```\r\n\r\n#### When the user requests a list of their currently subscribed tickets\r\n```json\r\n{\r\n\t\"requestid\": \"JSv4btdNHt\",\r\n\t\"userid\": 123456789,\r\n\t\"success\": true,\r\n\t\"data\": {\r\n\t\t\"tickets\": [\r\n\t\t\t\"B123\",\r\n\t\t\t\"X456\"\r\n\t\t]\r\n\t}\r\n}\r\n```\r\n\r\n#### A failed request (e.g. because of a database error)\r\n```json\r\n{\r\n\t\"requestid\": \"rUyI1NEbSA\",\r\n\t\"success\": false,\r\n\t\"message\": \"Database error\"\r\n}\r\n```\r\n\r\nThe field ```message``` will be sent to the developers. The user will be shown a more helpful status message.\r\n\r\nThe website link for subscribing is `https://telegram.me/Lagesonum_bot`."},"comment":{"url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/comments/150934944","html_url":"https://github.com/volunteer-planner/lagesonum/issues/98#issuecomment-150934944","issue_url":"https://api.github.com/repos/volunteer-planner/lagesonum/issues/98","id":150934944,"user":{"login":"jlev","id":294964,"avatar_url":"https://avatars.githubusercontent.com/u/294964?v=3","gravatar_id":"","url":"https://api.github.com/users/jlev","html_url":"https://github.com/jlev","followers_url":"https://api.github.com/users/jlev/followers","following_url":"https://api.github.com/users/jlev/following{/other_user}","gists_url":"https://api.github.com/users/jlev/gists{/gist_id}","starred_url":"https://api.github.com/users/jlev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlev/subscriptions","organizations_url":"https://api.github.com/users/jlev/orgs","repos_url":"https://api.github.com/users/jlev/repos","events_url":"https://api.github.com/users/jlev/events{/privacy}","received_events_url":"https://api.github.com/users/jlev/received_events","type":"User","site_admin":false},"created_at":"2015-10-25T15:30:52Z","updated_at":"2015-10-25T15:30:52Z","body":"Todo:\r\n[] create telegram_confirmed field on Subscription\r\n[] create TelegramNotificationView at notifications.telegram.views"}}