Facebook Messenger

Marketing Messages events

There are various types of events that can occur when using Marketing Messages.

Opt-In event

There are two scenarios for which you will receive this event:

  1. When the user opts-in to receive your Marketing Messages based on a set frequency. (OptInSubscribed)
  2. When the user clicks on the Continue messages button just before the token expires. This will refresh the NotificationToken of the user and extend the TokenExpiryTimestamp. (OptInExtended)

Example Opt-In Event (OptInSubscribed)

{ 
  "from": { 
    "number": "Recipients PSID" 
  }, 
  "to": { 
    "number": "Your Facebook account ID" 
  }, 
  "event": {
        "type": "OptInSubscribed",
        "reference": "A reference to the object or message that triggered the event",
        "custom": {
          "notificationToken": "123456789987654321",
          "tokenExpiry" : "2023-04-10T12:00:00Z"
        }
    },    
    "timeUtc": "2022-10-10T12:00:00",
    "channel": "Facebook Messenger"
}

Re Opt-In event

Just before the token associated with the Marketing Message opt-in is about to expire, users will automatically receive a re opt-in request. Users will then have the choice of whether to continue receiving the Marketing Messages. The re opt-in request will only be sent to the user when the reoptin field of the original opt-in notification is set to True, otherwise the opt-in will stop automatically.

Recurring Notification FrequencyRe Opt-In Request Sent
DailyAfter six months

Example Re Opt-In Event (OptInExtended)

{ 
  "from": { 
    "number": "Recipients PSID" 
  }, 
  "to": { 
    "number": "Your Facebook account ID" 
  }, 
  "event": {
        "type": "OptInExtended",
        "reference": "A reference to the object or message that triggered the event",
        "custom": {
          "notificationToken": "123456789987654321",
          "tokenExpiry" : "2023-04-10T12:00:00Z"
        }
    },    
    "timeUtc": "2022-10-10T12:00:00",
    "channel": "Facebook Messenger"
}

Manage Opt-In Event

Once users opt-in, they can easily manage their Marketing Messages, including stopping and resuming them, by clicking the “Manage” button. This will result in the following scenario’s:

  1. When a user presses the Stop these messages button. Resulting in a temporary block of your messages. (OptInSuspended)

  2. When a user presses the Resume these messages button after they have suspended your messages. (OptInResumed)

Example Manage Opt-In Event (OptInSuspended)

{ 
  "from": { 
    "number": "Recipients PSID" 
  }, 
  "to": { 
    "number": "Your Facebook account ID" 
  }, 
  "event": {
        "type": "OptInSuspended",
        "reference": "A reference to the object or message that triggered the event",
        "custom": {
          "notificationToken": "123456789987654321",
          "tokenExpiry" : "2023-04-10T12:00:00Z"
        }
    },    
    "timeUtc": "2022-10-10T12:00:00",
    "channel": "Facebook Messenger"
}

Example Manage Opt-In Event (OptInResumed)

{ 
  "from": { 
    "number": "Recipients PSID" 
  }, 
  "to": { 
    "number": "Your Facebook account ID" 
  }, 
  "event": {
        "type": "OptInResumed",
        "reference": "A reference to the object or message that triggered the event",
        "custom": {
          "notificationToken": "123456789987654321",
          "tokenExpiry" : "2023-04-10T12:00:00Z"
        }
    },    
    "timeUtc": "2022-10-10T12:00:00",
    "channel": "Facebook Messenger"
}