Facebook Messenger integration

Learn how to integrate the Facebook Messenger.

With almost 2 billion of active users worldwide, Facebook integration will enable your business to have a global reach. By using the same platform where your users are already communicating with their friends and family, you will be present where your customers already are.

It’s a great way to interact with your customers - if you want to engage them with content or provide additional services in order to provide an excellent customer experience.

It will create communication that is more personal, building a strong relationship with your brand.

Facebook page

Facebook pages are used by brands, businesses, organizations and public figures to create a presence on Facebook, whereas profiles represent individual people. Anyone with an account can create a Page or help in managing one if they have a role of page admin or editor. If you don’t have a Facebook page yet, you can create one here.

Facebook users can use Facebook messenger to contact your organization through your Facebook page.

Assuming that you already have your organization page up and running, you are ready to start with the setup steps listed below.

Facebook Application setup

1. Visit https://developers.facebook.com/apps and create a new Application.
2. Name it and click Create App ID and select category Messenger. You should end up on application dashboard.
3. In the Token Generation section select your page and a new Page Access Token will be generated.

Page Access Token

Copy and save your Page Access Token somewhere convenient as you will need it in next steps.

  1. Obtain the App secret by clicking on the Show button and App ID

App secret and App ID

Copy and save your App secret and App ID somewhere convenient as you will need it in next steps.

Integration setup

To start sending messages over FB, you first need to register your FB application on Infobip’s platform. This is done by adding the FB integration to the application you have already created here.

Use the Page Access Token from the previous step as a value of the accessToken parameter, App secret as a value of the secret parameter and App ID as a value of the id parameter.

Request example

POST /omnichat/1/applications/0F3C3F29829FAB88714BA205BEC6D28F/integrations/facebook HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json

  "page": {
    "accessToken": "EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd..."
  "application": {
    "id": 1654219114885622,
    "secret": "cf074b2e96390b3600031c751d9bf590"


  "page": {
    "accessToken": "EAAXggzrE7uYBAM38UXko5vWxi98mZCgH2klIHSwd..."
  "application": {
    "id": 1654219114885622,
    "secret": "cf074b2e96390b3600031c751d9bf590",
    "name": "My application name",
    "imageUrl": "https://scontent.xx.fbcdn.net/t39...0696#_n.png"

That’s it!

You are now ready to send test messages by using ‘Send chat message API’ method.

Every message we receive from your subscriber will be forwarded to the URL you provided and is described in more details in the Receive message section.

How can my organization contact people over Facebook?

People can register to receive information from you on Facebook by entering into a conversation with you from a number of different places or entry points. For more details see here.

Test mode

At this point the Facebook Messenger application is still in test mode, so only the administrator and testers specified under the Roles section in the left sidebar can actually use this Messenger integration.

At this point, you should apply for Facebook approval since it may take up to two weeks. You can find more details on how to get approved here.