messaging_optins
Webhook Event ReferenceA Messaging Opt In Webhook Event is triggered when a person opts in to receiving Marketing Messages or taps on a Send to Messenger plugin.
When using the Send to Messenger 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.
Your app will receive opt in webhook notification when the following occurs:
{ "sender": { "id": "PSID", }, "recipient": { "id": "PAGE-ID", }, "timestamp": "TIMESTAMP", "optin": { "type": "notification_messages", "payload": "ADDITIONAL-INFORMATION", "notification_messages_token": "NOTIFICATION-MESSAGES-TOKEN", "notification_messages_frequency": "FREQUENCY", "notification_messages_timezone": "TIMEZONE-ID", "token_expiry_timestamp": "TIMESTAMP", "user_token_status": "TOKEN-STATUS", "notification_messages_status": "NOTIFICATION-STATUS", "title": "TITLE" } }
optin
Property | Description |
---|---|
| Additional information that you want to include in the webhooks notification |
| The title displayed in the template |
| The token that represents the person who opted in, with the specific topic and message frequency, that is used to send Marketing Messages |
DAILY, WEEKLY, MONTHLY } | The value can be one of the following:
(Removed in API v16) |
| Timezone for the person receiving the message |
STOP NOTIFICATIONS, RESUME NOTIFICATIONS } | This field is present only when the user stops or resumes Marketing Messages. The value can be one of the following:
|
| Date when the the notification message token expires |
| Value must be |
REFRESHED, NOT_REFRESHED } | The value can be one of the following:
|