messaging_optins Webhook Event Reference

This 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.

Example

{
  "sender": {
    "id": "<PSID>"
  },
  "recipient": {
    "id": "<PAGE_ID>"
  },
  "timestamp": 1234567890,
  "optin": {
    "ref": "<PASS_THROUGH_PARAM>",
    "user_ref": "<REF_FROM_CHECKBOX_PLUGIN>"
  }
}    

Properties

sender

The sender object is not included for messaging_optins events triggered by the checkbox plugin.

PropertyTypeDescription

id

String

The PSID of the user that triggered the webhook event.

recipient

PropertyTypeDescription

id

String

Your Page ID.

optin

Property Type Description

ref

String

data-ref attribute that was defined with the entry point.

user_ref

String

Checkbox plugin only. user_ref attribute that was defined in the checkbox plugin include.