Configuring Facebook in Jitterbit App Builder
App Builder does not natively support Facebook's Graph API, either as an authentication or data provider. However, since the Facebook Graph API can be consumed as a REST API, secured using the OAuth Client Credential flow, it's possible use App Builder's generic HTTP security provider to retrieve data from Facebook.
Facebook's documentation for using the OAuth Client Credentials flow can be found here:
https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens
The main tasks involved include:
- Register App Builder as a Facebook application.
- Create a Facebook HTTP security provider
- Create a Facebook data source.
It's assumed that your organization already has an existing Facebook account. Furthermore, it's assumed that the organization has registered as a Facebook application developer.
Register App Builder as a Facebook application
Start by signing into the Facebook App Dashboard.
https://developers.facebook.com/apps/
- Click the Add a New App button.
-
Provide the following information:
-
Display Name: A logical name for the App Builder environment or application.
Example: App Builder
-
Contact Email: Your email address.
- Category: Business
-
-
Click the Create App ID button.
- Select Dashboard from the menu.
- Click the Show button beneath App Secret.
-
Make a note of the following properties:
- App ID: This will be the value of the ClientId when configuring the HTTP security provider within App Builder.
- App Secret: This will be the value of the ClientSecret when configuring the HTTP security provider within App Builder.
Create a Facebook HTTP security provider
To create an HTTP security provider, start by signing into App Builder as an administrator.
- Navigate to the IDE
- Select the Security Providers button
- In the Data Source Authentication panel, click the + Data Source Authentication button
-
Provide the following:
- Name: Facebook
- Type: HTTP
- Enabled: Check
- Authentication Type: Client Credentials
- Click the Save button
-
Set the following properties. In the Properties panel, click the + Property button → Select the Parameter → Provide the Value → Click the Save icon.
- AuthenticationType: ClientCredentials
- TokenEndpoint: https://graph.facebook.com/v2.8/oauth/access_token
- The token endpoint must contain the version number. The version must be 2.0 or greater. At the time of writing, 2.8 is the current version of the Facebook Graph API.
- ClientId: The {App ID} provided by Facebook
- ClientSecret: The {App Secret} provided by Facebook
Create a Facebook data source
To create a Facebook data source, start by signing into App Builder as an administrator.
- Navigate to the IDE
- Click the Data Servers button
- Click + Server
-
Provide the following:
- Server Name: Facebook
- Type: REST API
- Sub Type: REST
- URL: https://graph.facebook.com/
- Request Content Type: JSON
- Response Content Type: JSON
-
Expand Security Settings, set Security Provider to the Facebook value configured in prior step
- Click Save
- Click the Tables icon from Server Settings to configure the Endpoints information
- In the Endpoints panel, click the + Endpoint button
-
Provide the following:
- Name: Page
- Endpoint:
{{Page}}?fields=fan_count
-
Click the checkmark icon
- In the Endpoint Parameters panel, click the + Parameter button
-
Provide the following:
- Name: Page
- Data type: String
- Test value: zudysoftware
-
Click the Save button
-
In the Endpoints panel, click the Discover button and click Discover again
This import process will populate the SQL Results panel.
-
In the SQL Results panel, locate the Page table and click the Results icon.
Assuming everything has been configured correctly, you should see follower count for the zudysoftware Facebook account.
Troubleshooting
Error: "Unexpected character encountered while parsing value: a. Path '', line 0, position 0."
This indicates that the response body was not serialized as JSON. Ensure that the token endpoint contains a version number at that the version is greater than 2.0.