{"__v":18,"_id":"55b9ba07baf4cd2300bc5703","category":{"__v":3,"_id":"55bc25ee76754617002aa893","pages":["55bc2617e554822b00f3127a","55bc2620e554822b00f3127c","55bc2b3676754617002aa89b"],"project":"54295508cd35120800fceca2","version":"55b9611eb42b610d00c9b28d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-01T01:50:38.022Z","from_sync":false,"order":7,"slug":"actionable-notifications","title":"Actionable Notifications"},"project":"54295508cd35120800fceca2","user":"542954f6cd35120800fceca0","version":{"__v":4,"_id":"55b9611eb42b610d00c9b28d","project":"54295508cd35120800fceca2","createdAt":"2015-07-29T23:26:22.532Z","releaseDate":"2015-07-29T23:26:22.532Z","categories":["55b9611fb42b610d00c9b28e","55b9611fb42b610d00c9b28f","55b9611fb42b610d00c9b290","55b9611fb42b610d00c9b291","55b9611fb42b610d00c9b292","55b9611fb42b610d00c9b293","55bc25ee76754617002aa893","56ae7f53be2c040d00d5a09b","56ae7f7b0c1cab0d009f65d1"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-30T05:45:43.686Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Yo's notification platform allows developers to define a pair of custom responses on each notification.\n* Each notification can optionally have 2 (exactly 2) responses - a **response pair**. \n* A **response pair** is a string with 2 substrings separated by a dot (.) in this format: \"<left button>.<right button>. \n* For example: \"No.Yes\", \"nope.yup\", \"Dismiss.Deploy\".\n* The response pair **must** exist in our **available response pairs** document.\n* When sending a Yo via /yos POST api call, provide `response_pair` parameter to provide the 2 responses to the recipient.\n* Swiping the notification itself (currently iOS only) will present the 2 buttons.\n* If the user taps a button and your client has a callback defined, the response will be supplied in the callback request to your server, in the `context` parameter.\n\nAvailable response pairs:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n   \\\"😁.😝\\\",\\n   \\\"πŸ˜‚.😁\\\",\\n   \\\"πŸ˜–.😳\\\",\\n   \\\"😍.☺️\\\",\\n   \\\"😜.😝\\\",\\n   \\\"πŸ‘Ž.πŸ‘\\\",\\n   \\\"😍.πŸ’\\\",\\n   \\\"😒.😜\\\",\\n   \\\"😘.😍\\\",\\n   \\\"text.πŸ‘\\\",\\n   \\\"πŸ˜•.πŸ˜‚\\\",\\n   \\\"Dismiss.Deploy\\\",\\n   \\\"🐢.πŸ˜‚\\\",\\n   \\\"Dismiss.1-Click Buy\\\",\\n   \\\"Text.Call\\\",\\n   \\\"Nope.Yup\\\",\\n   \\\"Nah.Hell Yeah\\\",\\n   \\\"Review.Merge\\\",\\n   \\\"😁.Hell Yeah\\\",\\n   \\\"Dismiss 🚫.Send\\\",\\n   \\\"On my way πŸƒ.I am here too πŸ‘‹\\\",\\n   \\\"Great. See you soon.πŸ‘\\\",\\n   \\\"Text πŸ’¬.Call πŸ“ž\\\",\\n   \\\"Dismiss 🚫.1-Click Buy πŸ’³\\\"\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe callback configured under the account that sent the Yo with `response_pair` will get a POST request when a response Yo occurs.\nSample payload:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"username\\\":\\\"JOE\\\",\\n   \\\"display_name\\\":\\\"Joe D.\\\",\\n   \\\"reply\\\":{\\n      \\\"text\\\":\\\"Yes\\\"\\n   },\\n   \\\"reply_to\\\":{\\n      \\\"yo_id\\\":\\\"233423423654758674\\\",\\n      \\\"text\\\":\\\"Beer?\\\"\\n   }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"Two custom buttons for responding straight from the notification itself.","slug":"response-pairs","type":"basic","title":"Response Pairs"}

Response Pairs

Two custom buttons for responding straight from the notification itself.

Yo's notification platform allows developers to define a pair of custom responses on each notification. * Each notification can optionally have 2 (exactly 2) responses - a **response pair**. * A **response pair** is a string with 2 substrings separated by a dot (.) in this format: "<left button>.<right button>. * For example: "No.Yes", "nope.yup", "Dismiss.Deploy". * The response pair **must** exist in our **available response pairs** document. * When sending a Yo via /yos POST api call, provide `response_pair` parameter to provide the 2 responses to the recipient. * Swiping the notification itself (currently iOS only) will present the 2 buttons. * If the user taps a button and your client has a callback defined, the response will be supplied in the callback request to your server, in the `context` parameter. Available response pairs: [block:code] { "codes": [ { "code": "[\n \"😁.😝\",\n \"πŸ˜‚.😁\",\n \"πŸ˜–.😳\",\n \"😍.☺️\",\n \"😜.😝\",\n \"πŸ‘Ž.πŸ‘\",\n \"😍.πŸ’\",\n \"😒.😜\",\n \"😘.😍\",\n \"text.πŸ‘\",\n \"πŸ˜•.πŸ˜‚\",\n \"Dismiss.Deploy\",\n \"🐢.πŸ˜‚\",\n \"Dismiss.1-Click Buy\",\n \"Text.Call\",\n \"Nope.Yup\",\n \"Nah.Hell Yeah\",\n \"Review.Merge\",\n \"😁.Hell Yeah\",\n \"Dismiss 🚫.Send\",\n \"On my way πŸƒ.I am here too πŸ‘‹\",\n \"Great. See you soon.πŸ‘\",\n \"Text πŸ’¬.Call πŸ“ž\",\n \"Dismiss 🚫.1-Click Buy πŸ’³\"\n]", "language": "json" } ] } [/block] The callback configured under the account that sent the Yo with `response_pair` will get a POST request when a response Yo occurs. Sample payload: [block:code] { "codes": [ { "code": "{\n \"username\":\"JOE\",\n \"display_name\":\"Joe D.\",\n \"reply\":{\n \"text\":\"Yes\"\n },\n \"reply_to\":{\n \"yo_id\":\"233423423654758674\",\n \"text\":\"Beer?\"\n }\n}", "language": "json" } ] } [/block]