On Oct 29, 2019 we introduced new webhook fields that allow apps to get user replies to a message and reactions to messages.
Users can react or reply to messages that are in the thread (both a Page message or referencing their one of their own messages). We observe that users naturally use this expression actions, common in individual conversations, with Pages as well. These webhooks allow apps to get the context of the reply that the user id referencing and subscribe to reactions.
For details see Messages Webhook Event Reference
message:{ text: 'I have an issue with an order' mid: '<MID>' reply_to: { mid: '<MID_OF_MESSAGE_BEING_REPLIED_TO>', } }
Reactions have their own subscription field called message_reactions
. Reactions, like other user actions, open the 24-hr standard messaging window. For details see Reactions Webhook Event Reference
message:{ reaction: { reaction: 'smile|angry|sad|wow|love|like|dislike|other', emoji: '\u{2764}\u{FE0F}', action: 'react|unreact', mid: '<MID_OF_ReactedTo_Message>', } }
This section applies to apps created before Dec 4, 2019. Apps should use the standard webhooks defined above.
To help apps provide a complete user experience we are releasing a helper that allows existing apps to get reactions and replies in the form of message webhooks. When messages are ultimately getting read by a human these helpers can result in support for reactions and replies with no code changes.
The helper webhooks described in this section are a temporary aid that allow apps to get reactions and replies as message webhooks. As temporary we expect to deprecated them on December 04, 2020.
Apps that show messages directly to human agents and were created before the availability reaction and replies webhooks. Apps in this category can get support for reactions and replies without code changes and have up to a year to implement the standard webhooks related to reactions and replies.
These helpers can be enabled or disabled via toggles on the Messenger Settings of the App Dashboard. If the app was created before Dec 4, 2019 two toggles should be visible under the Webhooks section.
The webhook below will adjust the text
field to describe the context that this is a reply. original_text
field appears only for replies helper webhooks, contains the unaltered text that the user wrote.
"message": { "mid": "m_Azh9c_bpCZ-tUy9lnE9hJ7IfLZDamVrALniheUYEDdHHl8xzaqkhcJPuAvZHpYjotySGirfwWwWBCeCQGoV-rg", "text": "I have an issue with an order (replied to - 'What we can do to help you today?')", "reply_to": { "mid": "m_O26bdn-DW_wQSY5rOZwoILIfLZDamVrALniheUYEDdEET7k2PRBmugCCw6WHB_Xc2Q95zKWRgqt_7mEFUvNSWA" }, "original_text": "I have an issue with an order" }
The webhook below will insert a message field to the reaction webhook. Since there is no new message but rather an update to a previous message the mid
references the original message with the appended '_reaction' to not be confused as duplicate webhook of previous message.
One limitation of these helper webhooks, is that for non plain-text messages the content will default to 'attachment'. Like shown in the example below.
"reaction": { "mid": "m_oyU9yvUs0lZixb_pHaK6n7IfLZDamVrALniheUYEDdHo7lzd6t5egmvcpmc1fGTO4q92bvfK-8is-RFsSkxyaw", "action": "react", "emoji": "\ud83d\ude0d", "reaction": "love" }, "message": { "text": "(reacted 'love' to - 'attachment')", "mid": "m_oyU9yvUs0lZixb_pHaK6n7IfLZDamVrALniheUYEDdHo7lzd6t5egmvcpmc1fGTO4q92bvfK-8is-RFsSkxyaw_reaction" }