SAP HCI – Facebook Integration – Part 1
Apache Camel Facebook Component has methods to perform Read, Add and Delete operation on most of the Facebook objects like posts, likes, comments, photos, albums etc... However the SAP HCI Facebook Adapter support option to read user, post and comment object with the below three endpoint. Also read SAP Help document.
- Get Posts
- Get Post Comment
- Get Users
In the blog(s) I will explain technical steps to configure a communication channel for Facebook Integration. Part-1 will explain the steps required to generate the connectivity artifacts required for channel configuration and SAP HCI – Facebook Integration – Part 2 will explain the configuration steps in Integration Flow. I do not intend to cover a business use case of Facebook Integration with this blog but just the technical configuration steps.
Register Facebook Application
Facebook Graph API uses Facebook Login and Access Tokens to control access permission. So the first step is to register a Facebook Application and obtain below artifacts to configure Facebook adapter.
- Application ID
- Application Secret
- Access Token
1. Login to https://developers.facebook.com/ with your Facebook account and select “Create New App” and then Website.
2. Select “Skip and Create App ID“, Type a Name for your App, and complete the other details and select Create App ID.
3. Navigate to Settings –> Basic and copy the App ID and App Secret.
4. Navigate to “Access Token Tool” using URL https://developers.facebook.com/tools/accesstoken/.
5. Copy the App Token (do not expire) of the application created. Also generate the User Token (valid for an hour and can be regenerated).
Note : App Token or User Token can be used as Access Token. But User token will expire and need to be assigned permission(Scope) like user_posts, public_profile etc in User Data Permission.
6. Click on the Debug button in User Token and copy the User ID from the next page .
Creating Secure Parameter
Next step is to add the connection artifacts to security parameter.
1. Open Integration Operation perspective.
2. Right Click on the Tenant Node and Select Deploy Artifact.
3. Select Secure Parameter.
4. Provide a Name (eg: FacebookAppID) and copy paste the App ID.
5. Repeat the same steps for App Secret and Access Token.
In next blog SAP HCI – Facebook Integration – Part 2 we will see adapter configuration steps to read data from Facebook.