The Marketing Message API for Messenger is available exclusively to tech providers with an existing app that has successfully completed Meta App Review for the following permissions:
Currently, tech providers can only serve businesses located in the following regions:
|
|
|
|
In addition, messages can be sent to users/subscribers in all regions except:
|
The Marketing Message API for Messenger is only available for Web applications.
This document shows you how to configure Facebook Login for Business to onboard businesses to your Marketing Messages on Messenger app.
NOTE: In this guide, business refers to the business portfolios onboarding to your app (your app's user).
Messenger > Messenger API Settings > Advanced and accept Terms to use Marketing Message API for Messenger.In the following steps, you are creating a login configuration that requires the business to select the following assets for sending marketing messages:
Note: If the business does not have one of the required assets (Facebook Page, a Meta business portfolio, or a Meta ad account), the business can create any, or all, of these assets during the login flow.
| Launch the Graph API Explorer |
Your Marketing Message API for Messenger login configuration is complete.
We recommend testing the login flow in Meta's Graph API Explorer.
| Launch the Graph API Explorer |
Upon successful log in, your app creates a non-expiring system business access token for the business.
Click the triangle icon to view the following access token information:
Click Open in Access Token Tool to view more information about this access token.
We recommend implementing the Javascript SDK from Meta in your web app to invoke the login dialog flow.
Set the config_id attribute to your configuration's ID in the fb:login-button element to invoke your configuration during login
<fb:login-button config_id="<CONFIG_ID>" onlogin="checkLoginState();"> </fb:login-button>
Use the JavaScript SDK from Meta's FB.login() method in your web app to use a specific configuration to get a system user access token.
config_id to your configuration's IDresponse_type to code – authorization code grant type required for system user access tokensoverride_default_response_type to true – any response types passed in take precedence over the default types
FB.login(
function(response) [
console.log(response);
],
[
config_id: '<CONFIG_ID>',
response_type: 'code',
override_default_response_type: true
]
);
When your app user completes the login dialog flow, Meta redirects the user to your redirect URL and includes the authorization code. You must then exchange this code for an access token by performing a server-to-server call to Meta servers.
curl https://graph.facebook.com/<API_VERSION/oauth/access_token? client_id=<APP_ID> &client_secret=<APP_SECRET> &code=<AUTHORIZATION_CODE>
See Exchanging Code for an Access Token for more information about this step.
Implement the following recommendations to help businesses discover and onboard to your app.
Place the entry point to Marketing Messages in your app's primary navigation, or near the relevant messaging flows, with an informational banner or a contextual guidance card.
Link your Marketing Messages onboarding flow to your app's Get started action button.
Now that you have onboarded businesses to your app, get a list of subscribers to send paid marketing messages.