How to register Facebook OAuth App for Graph API Access

Introduction

In this article, you will learn how to register Facebook OAuth App (Graph API) for data access using SSIS PowerPack REST API Connectors. Using SSIS PowerPack you can consume/manage Facebook data by calling Graph API. These connectors have drag and drop UI so you can do data integration without any coding (e.g. C#, Java, Python, Ruby).

JSON /REST Source Connector and REST API Task they both support a wide range of options for any type of REST API integration scenarios including Facebook REST API integration into your ETL Workflow. It also supports the use of OAuth 1.0 and 2.0 Protocols used by Twitter, Facebook, Google, LinkedIn, and many other popular Apis.

Facebook Graph API can be used to read or manage Facebook data via REST API Calls. To access Graph API you will have to create OAuth App inside Facebook Developer Portal. Let’s take a look step by step.

Step-By-Step: Create Facebook OAuth App (i.e Register OAuth App)

  1. Go to www.facebook.com and log in with an account which you want to use to access Facebook data. You can access your own data using API without issue but if you have to access someone else data via App then it will require additional steps listed in this article in “Create Public Facebook OAuth App” section
  2. Once you login to Facebook type https://developers.facebook.com/apps in the Address bar
  3. Click on Create New App. If you never access developer portal then you may be prompted to Register as a developer.
    create-facebook-oauth-app-developer-graph-api-1

    Create Facebook OAuth App for Graph API access (For SSIS PowerPack REST Connectors)

  4. It creates the app by given name and asked you to choose some options like ads and FB login. Click on skip to skip that step.
  5. Now go to basic settings and there you can change app name, contact email and select category (e.g. Business). There you can also found OAuth App ID and App Secret store it somewhere for the next phase.
    Register Facebook OAuth App for Custom Desktop Application (Basic Setup)

    Register Facebook OAuth App for Custom Desktop Application (Basic Setup)

  6. No Click on Add Products and add Facebook Login. Because our app is used for SSIS PowerPack which has custom login flow (using Embedded Browser). We have to Add Facebook Login support and check Embedded browser option (see below).
    Adding Embedded browser support for Facebook OAuth Application

    Adding Embedded browser support for Facebook OAuth Application

  7. Now you ready to use your App to use OAuth App ID and App Secret.

Test Facebook OAuth App (Consume graph api in SSIS)

If you using SSIS PowerPack to manage your Facebook data using Graph API then perform the following steps to test your connectivity.

  1. In the SSIS Designer in connection manager page .. right click and add ZS-OAUTH
  2. Select Facebook provider, Configure App ID and OAuth App Secret
  3. Select Permission (i.e. Scope) or type by hand (1 per each line)
  4. Click generate Token. You will be redirected to login page and then it will show Authorize App confirmation. Click Accept.
  5. Test Connection (If things go well it will show green success)
    Testing Facebook OAuth Connectivity in SSIS (Use Graph API)

    Testing Facebook OAuth Connectivity in SSIS (Use Graph API)

Fetch from Facebook Graph API (Load data into SQL Server)

Below is sample screenshot how you can use JSON Source to pull data from Facebook REST API and load into SQL Server. Refer this article for step-by-step information.

Extract data from Facebook using Graph API (SSIS JSON/REST API Connector) - Load into SQL Server Table

Extract data from Facebook using Graph API (SSIS JSON/REST API Connector) – Load into SQL Server Table

Posted in REST API and tagged , , , , , , .