messaging_optins
Webhook Event ReferenceThis callback will occur when the send to Messenger plugin has been tapped, a user has accepted a message request using customer matching, or a user has opted in to receive messages via the checkbox plugin.
When using the plugin, the optin.ref
parameter is set by the data-ref
field on the "Send to Messenger" plugin. This field can be used by the developer to associate a click event on the plugin with a callback.
You can subscribe to this callback by selecting the messaging_optins
field when setting up your webhook.
{ "sender": { "id": "<PSID>" }, "recipient": { "id": "<PAGE_ID>" }, "timestamp": 1234567890, "optin": { "ref": "<PASS_THROUGH_PARAM>", "user_ref": "<REF_FROM_CHECKBOX_PLUGIN>" } }
messaging_optin
events triggered when the user accepts a message request received from customer matching via the Send API, the following property will also be included in the optin
object:
"message_request": "accept"
sender
The sender
object is not included for messaging_optins
events triggered by the checkbox plugin.
Property | Type | Description |
---|---|---|
| String | The PSID of the user that triggered the webhook event. |
| String | The user_ref of the user that triggered the webhook event. This is only available for webhook event from the chat plugin. |
recipient
Property | Type | Description |
---|---|---|
| String | Your Page ID. |
optin
Property | Type | Description |
---|---|---|
| String |
|
| String | Checkbox plugin only. |