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)
- 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
- Once you login to Facebook type https://developers.facebook.com/apps in the Address bar
- Click on Create New App. If you never access developer portal then you may be prompted to Register as a developer.
- 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.
- 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.
- 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).
- 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.
- In the SSIS Designer in connection manager page .. right click and add ZS-OAUTH
- Select Facebook provider, Configure App ID and OAuth App Secret
- Select Permission (i.e. Scope) or type by hand (1 per each line)
- Click generate Token. You will be redirected to login page and then it will show Authorize App confirmation. Click Accept.
- Test Connection (If things go well it will show green success)
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.