Facebook

Learn how to set up your Meta Developer Facebook OAuth App and connection to Middle

Create or log into your Developer’s account at https://developers.facebook.com/

Facebook Account

To connect Facebook in Middle, you will need a Facebook OAuth developer app. This is what’s used to authenticate your Middle Facebook app. You will need a Meta Developer account to create an OAuth app. Subsequently, a Meta Developer account requires a Facebook login (a Facebook account).

Log into the Facebook account before moving to the next step.

We recommended that you consider creating a Facebook Account that will solely be responsible for maintaining this integration. By creating an integration-specific account, anyone on your team can access this Facebook account and the developer portal. You can also use a trusted business account or personal account. The trade-off is that access to this account might be limited if there is an authentication issue your team needs to address.

For lead retrieval, Facebook requires re-authentication every 90 days and for an account to have a Page Role on the Facebook Pages it’s connecting to.

Facebook will lose connection and require re-authentication if a Facebook account’s password is changed or if the user is locked out.

Meta Developer Account

Login or Create a Developer’s account at https://developers.facebook.com/.

This developer account will be an admin of the Facebook OAuth app you create for your integration.

Facebook OAuth App

Create Facebook OAuth App

On the App Dashboard:

  1. Click Create App

  2. Select an app type: Business

  3. Provide an App Name, contact email, and (optional) a Business Account to connect to

  4. Click Create App to finish

Add Privacy Url to App Settings

On your navigation bar within your new App:

  1. Click Settings, then click Basic

  2. Add https://info.perkville.com/privacy to your Privacy URL

  3. Click Save Changes to finish

Request Advanced Access For Public Profile

Facebook Login requires the public_profile permission to have advanced access. This will have you agree to the terms for using Facebook Login.

  1. Under App Review, click Permissions and Features

  2. Locate the public_profile permission and click Get Advanced Access

  3. Accept the terms and verify your password

Add Facebook Login

  1. Click Add Product next to Products on the left-hand navigation

  2. Click Set Up under Facebook Login

Add Valid OAuth Redirect URIs

You will need to add a valid OAuth Redirect URI for your Middle instance for Facebook Login to work for OAuth.

  1. Go to Settings under Facebook Login when it appears on the left-hand navigation

  2. Add your redirect URI to Valid OAuth Redirect URIs: https://YOURINSTANCE.middle.app/oauth-redirect-uri/

  3. Click Save Changes

Data Use Checkup is a requirement that must be completed once per year by an app admin to continue API access.

Failure to complete an annual data use checkup will deactivate your Facebook OAuth app

This checkup will have you re-verify your public_profile permissions acknowledgment and review Platform Terms and Developer Policies.

A popup should appear when you try to access your app’s dashboard again or under your Alerts section. Complete the prompts required by this checkup.

Facebook Pages

To use Facebook Login OAuth, you will use a Facebook account to connect your integration to Middle.

In order to access Facebook Page data, this Facebook account will need to have a Page Role on the Facebook Pages you are trying to access. They will either need Facebook Access (Admin, Editor) or Task Access (Moderator, Advertiser).

A Facebook Developer OAuth app also requires this Facebook account to have a developer account and role on the OAuth app in order to retrieve information regarding Page and Lead data, if this has not undergone Facebook App review to be made public.

Because the Facebook App review process is extensive and is only necessary when you want external organizations to use your app, we recommend leaving this OAuth app in developer/internal mode.

Add Page Roles for Facebook Account

  1. Navigate to your Facebook Page and use Settings to access your Page Roles.

    1. If you are using Meta Business Suite, Page Settings should be under All Tools on your sidebar

  2. If the Facebook Account doesn’t already have a Page Role assigned, assign one of the valid Page Roles (Admin, Editor, Moderator, Advertiser).

Ensure Facebook Account has role on Facebook Oauth app

If you are using a Facebook account to authenticate that also created the developer OAuth app:

  1. Because your Facebook account is already an admin of the developer OAuth app, no further action is needed.

If you are using a Facebook account to authenticate that did not create the developer OAuth app:

  1. You will need to have an OAuth app role in order to use Facebook Login successfully.

  2. The Facebook account will need to have or create a developer account in order to be added to the OAuth app roles.

  3. The Meta Developer Admin for your Facebook Developer OAuth app will need to add this Facebook Account as an Admin, Developer, or Tester within Roles.

  4. This Facebook Account will need to accept the invite in their Meta developer portal

Middle Facebook Credentials

Within your Middle instance, you will have a Facebook app that manages how Facebook integrates to Middle. In order to use Facebook Login OAuth, you will need to add the OAuth App Credentials to your Middle Facebook app.

Grab App Credentials

You can find your App Key and App Secret from your Facebook OAuth app under Settings, then Basic.

Create API Key With Credentials

The API Keys section of the Facebook app on Middle allows you to store client credentials for use when scripting. These credentials can be made available globally to your accounts on your instance that want to use the Facebook integration.

  1. Navigate to your Middle Facebook app

  2. Create a new API Key

  3. Provide a name (ex: My Business Facebook App)

  4. Toggle "is default" to on if you would like all accounts to use the same credential

  5. Replace your credentials below and copy and paste this dictionary into the payload: {

    "APP_ID": "******************",

    "APP_SECRET": "***************"

    }

  6. If you only want certain accounts to access these credentials, you can determine them on this page using Allowed Accounts

  7. Click Save

Connect Account(s) To Facebook

Now you are ready to connect your Middle Accounts to the Facebook integration.

Select an account you want to connect to Facebook on Middle by clicking Accounts and then the account name.

Add Facebook To Account

If Facebook is not already in the App Connections:

  1. Click + New App Connection, select Facebook, and click Add New Connection.

  2. Enter a name (Facebook) and hit Save to create the connection.

  3. Your App Connection Screen will then load. If you are using a default API Key, you can leave API Key as is. Otherwise, you can select the appropriate API Key from the dropdown and click Save.

Authorize Using OAuth

If it is your first time Authenticating:

  1. Click Launch OAuth Flow, then Launch OAuth Process

  2. You will be prompted to continue as the currently logged in Facebook Account, or can click Log Into Another Account to switch accounts. Be sure to log in as the Facebook Account who has both a Page Role and a Meta Developer Role.

  3. Select the Facebook Pages you would like to retrieve Lead Data from. Reminder: you must have a Role on these Pages. Then click Next.

  4. Click Done, then click OK

If Facebook connection already exists, click Edit Connection Details.

  1. Click Launch OAuth Flow, then Launch OAuth Process

  2. Click Edit Settings and ensure your Facebook Pages are selected, then click Next. Reminder: you must have a Role on these Pages

  3. Click Done, then click OK

You will then be redirected to Middle. It should say whether the connection was successful, or if there was an error. You can click View Invocation to view any error responses.

You should now be ready to start synching your Facebook Page Leads to Middle.

Last updated