Facebook Messenger

Recurring Notifications events

There are various types of events that can occur when using recurring notifications.

Opt-In event

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

  1. When the user opts-in to receive your Recurring Notifications based on a set frequency such as "Get Daily Messages". (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 Recurring Notification opt-in is about to expire, users will automatically receive a re opt-in request. Users will then have the choice of whether or not to continue receiving the Recurring Notifications. The re opt-in request will only be sent to the user when the reoptin field of the original opt-in notification is set on True, otherwise the opt-in will stop automatically.

Recurring Notification FrequencyRe Opt-In Request Sent
DailyAfter six months
WeeklyAfter nine months
MonthlyAfter twelve 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 Recurring Notifications, including stopping and resuming them, by clicking the “Manage” button. This will result in the following scenario’s:

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

  2. When an 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"
}