We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Facebook integration

In this article

    This document describes how to set up Facebook integration with Customer Service. With the integration, you will be able to import messages and comments from page wall as requests in Customer Service. You will also be able to reply to these messages/comments, and they will be posted back on Facebook.

    Prerequisites

    You will need a developer access on Facebook: https://developers.facebook.com/

    You also need a Facebook page which is where Service will get posts and post back replies to: https://www.facebook.com/pages/create/

    Please note that screens may differ, but if you experience problems please contact our support or use the Feedback button.

    Steps

    Create an application on Facebook

    First you will need to create an application on Facebook with the user you want to retrieve messages from, or the owner of the page.

    Go to http://developers.facebook.com/apps (make sure you are logged in to Facebook first, or click apps from developers.facebook.com)

    Click Create a new App or Add a new App if you have other apps already.

    You will be presented with the dialog to Create a New App ID where you add Display Name and Contact Email, note that the Display name is who will be posting messages on your page later. 

    Under category choose Apps for Pages

     

    After you click Create App ID you will be redirected to the Add Product, but move up to Settings

     

     

    Here you want to add Platform

    Choose Website

    And you will be allowed to add a Site URL:

    Customer Service installation with FastCgi: Https://support.yourdomain.com/scripts/admin.fcgi?action=registerFacebook

    Customer Service installation without FastCgi: https://support.yourdomain.com/scripts/admin.exe?action=registerFacebook 

    Note - the URLs must be available on the internet since Facebook will be pushing changes to this URL. And the urls must be running on HTTPS, since we are using WebHooks and Facebook will only allow this via the secure protocol.

    When you are done you will need to make your app available, this is done under App Review and change it to Yes.


     

    Getting the values you need to set up inside Customer Service

    App ID and App Secret

    This is found under Dashboard. If the App secret is hidden, click to show and write it down. You will need these when you authenticate later. Note that the App ID in this screenshot is just an example.

     

     

    Page ID

    You also need to provide a Page ID. The Page ID can be obtained by Going to the About screen for your page:

     

     

    You are now ready to set up a Facebook account in Service

    You need to configure Service to retrieve messages from Facebook using the application you just created. Make sure that you are either logged out of Facebook, or logged in with the same user you used when creating the application. Failing to do so will result in incorrect behaviour. 

    Go to Settings->E-mail and click the New Facebook application icon

    Enter the Application ID and Page ID which you noted earlier. 

    Fill in the rest of the information and click Ok

    You will now be redirected to Facebook, where it will ask for some permission for the application you created.

     

    You will now be asked for the Client secret which is the same as the App Secret from your Facebook application. Click OK. 

    When done you will see your Facebook account together with the other mailboxes.

    By default, the integration will start to import messages the time when you add the App Secret on the mail box. Old post on your page will not be added.

    To manually post messages to Facebook, add Facebook as one of the recipients on a ticket

     

    Troubleshooting

    If you receive this error after you have added Application ID and Page ID inside Customer Service, then verify that the Site URL you gave in your Facebook application is correct and points to your Customer Service installation:

    Customer Service installation with FastCgi: Https://support.yourdomain.com/scripts/admin.fcgi?action=registerFacebook

    Customer Service installation without FastCgihttps://support.yourdomain.com/scripts/admin.exe?action=registerFacebook 

    { "error": { "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.", "type": "OAuthException", "code": 191 } }

    Make sure you are running Service on HTTPS: 

    From Facebook documentation:
    New Webhook subscriptions must use a secure HTTPS callback URL as of v2.5. With the next version of the Graph API we will stop sending updates to non-HTTPS callback URLs. 
    If you need more information about setting up HTTPS for your callback URL, check out the Getting Started guide from Let's Encrypt and the SSL Certificate Installation instructions from Digicert.

    Also - this URL must be available on the internet, or Facebook will not be able to reach it.