GET request to the /<PAGE_ID>/notification_message_tokens endpoint, where <PAGE_ID> represents the business’ Facebook Page, to get a list of all the subscription tokens for that Facebook Page.curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<PAGE_ID>/notification_message_tokens" \ -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>"
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
limit | Number | false | The maximum number of tokens to return in a single request. Default: 100 Maximum: 1000 | limit=100 |
do_not_return_duplicates | Boolean | false | If true, prevents returning multiple tokens for the same recipient. Use to avoid sending multiple Marketing Messages to the same recipient. | do_not_return_duplicates=true |
custom_audience_ids | Array | false | Filters subscription tokens for one or more custom audience IDs. To safeguard user privacy, the endpoint will only return subscription tokens for a Custom Audience if there are 100 or more matched users in the upload. If fewer than 100 users match, tokens for that Custom Audience will be excluded from the response. | custom_audience_ids=123456789,9876543211 |
{ "data":[ { "notification_messages_token":"<SUBSCRIPTION_TOKEN_ID_1>", "recipient_id":"<PSID_1>", "notification_messages_reoptin":"<RE_OPT_IN_STATUS>", "creation_timestamp":<TIMESTAMP>, "token_expiry_timestamp":<UNIX_TIMESTAMP_EXPIRATION_DATE>, "user_token_status":"<TOKEN_STATUS>", "topic_title":"<NOTIFICATION_TITLE>", "notification_messages_timezone":"<TIMEZONE_ID>", "next_eligible_time": <TIMESTAMP> }, ... { "notification_messages_token":"<SUBSCRIPTION_TOKEN_ID_1>", "topic_title":"<NOTIFICATION_TITLE>", "notification_messages_reoptin":"<RE_OPT_IN_STATUS>", "custom_audience_ids": [ "<CUSTOM_AUDIENCE_ID>", "<CUSTOM_AUDIENCE_ID>", "<CUSTOM_AUDIENCE_ID>" ] }, ], "paging":{"cursors":{"before":"QVFIU...","after":"QVFIU..."},"next":"https:\/\/graph.facebook.com\/<API_VERSION>\/<PAGE_ID>\/notification_message_tokens?access_token=<pPAGE_ACCESS_TOKEN>"}
GET request to the /notification_messages_<NOTIFICATION_MESSAGES_TOKEN> endpoint to get information about the token.curl -i -X GET "https://graph.facebook.com/<API_VERSION>/notification_messages_<SUBSCRIPTION_TOKEN_ID>" \ -H "Authorization: Bearer <PAGE_ACCESS_TOKEN>"
{ "notification_messages_token": "<SUBSCRIPTION_TOKEN_ID>", "recipient_id": "<PSID>", "creation_timestamp": "<TIMESTAMP>", "token_expiry_timestamp": "<TIMESTAMP>", "user_token_status": "REFRESHED", "notification_messages_reoptin": "ENABLED", "notification_messages_timezone": "<TIMEZONE_ID>" "next_eligible_time": <TIMESTAMP> }
{ "notification_messages_token":"<SUBSCRIPTION_TOKEN_ID_1>", "topic_title":"<NOTIFICATION_TITLE>", "notification_messages_reoptin":"<RE_OPT_IN_STATUS>", "custom_audience_ids": [ "<CUSTOM_AUDIENCE_ID>", "<CUSTOM_AUDIENCE_ID>", "<CUSTOM_AUDIENCE_ID>" ] },