Obtain Facebook Messenger credentials

Before you can connect to Facebook Messenger, you need the following tokens:

  • Page Access Token: a token generated by Facebook for you to use to prove your identity when posting to Messenger.
  • Verify Token: a token generated by you for Facebook to use to verify your application endpoint
    1. Create a Verify Token. (You can simply create and save a Verify Token in a text editor.)This token should only be known by you. You use it to verify that incoming requests are valid. This can be any text and should be difficult for anybody else to guess, for example:


      The next steps show you how to generate a Page Access Token from Facebook.

    2. Open the web page https://developers.facebook.com/docs/messenger-platform
    3. Under Implementation, click Getting Started.

      You will follow the steps on the Quick Start Guide to register a new app and create a new page. Those step are described in this lab.

      1. Click Facebook App. Then, log in to Facebook.
      2. If you are not registered, register as a Facebook Developer.

        1. If you are already registered as a Facebook developer, click Add a New App. If you have newly registered as part of this lab, you will not see this button. Instead, go to the next step.

          1. On the Create a New App ID form, enter a display name for your application and select a category. Then, click Create App ID.

            1. Enter the obfuscated text as part of the security check.
            1. On the Messenger page, find the Token Generation section. If you already have a page that you want to integrate, select that page. If not, click Create a new Page.

            1. Select a page option, for example, Cause or Community.

              1. Enter a name for your new page. Then, click Get Started.

                1. Enter some text for the About section for the page. Then, click Save Info.

                  1. Optional: Add a profile picture. If you don’t want to add a picture or other information for your, click Skip in each tab. On the last tab, click Save.

                    You should now have a new page. Note the Message link. This is where you will see your bot conversation, which you will be coding soon.

                    1. Go back to the Token Generation section on the Developers page.

                      1. Click Select a Page. You might need to refresh the page to see your new page in the list.
                      2. Click Continue As <your_user_name>.

                        1. Click OK to grant access permissions to your page.

                          1. Copy the Page Access Token so that you can enter it later.

                            1. Be sure you have a copy both the Page Access Token and the Verify Token that you created previously.