{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","params":[],"results":{"codes":[]}},"next":{"description":"","pages":[]},"title":"Response Pairs","type":"basic","slug":"response-pairs","excerpt":"Two custom buttons for responding straight from the notification itself.","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]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55b9ba07baf4cd2300bc5703","createdAt":"2015-07-30T05:45:43.686Z","githubsync":"","__v":18,"category":{"sync":{"isSync":false,"url":""},"pages":["55bc2617e554822b00f3127a","55bc2620e554822b00f3127c","55bc2b3676754617002aa89b"],"title":"Actionable Notifications","slug":"actionable-notifications","order":7,"from_sync":false,"reference":false,"_id":"55bc25ee76754617002aa893","createdAt":"2015-08-01T01:50:38.022Z","__v":3,"project":"54295508cd35120800fceca2","version":"55b9611eb42b610d00c9b28d"},"project":"54295508cd35120800fceca2","user":"542954f6cd35120800fceca0","version":{"version":"2.0","version_clean":"2.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55b9611fb42b610d00c9b28e","55b9611fb42b610d00c9b28f","55b9611fb42b610d00c9b290","55b9611fb42b610d00c9b291","55b9611fb42b610d00c9b292","55b9611fb42b610d00c9b293","55bc25ee76754617002aa893","56ae7f53be2c040d00d5a09b","56ae7f7b0c1cab0d009f65d1"],"_id":"55b9611eb42b610d00c9b28d","__v":4,"createdAt":"2015-07-29T23:26:22.532Z","project":"54295508cd35120800fceca2","releaseDate":"2015-07-29T23:26:22.532Z"}}
Response Pairs
Two custom buttons for responding straight from the notification itself.