Skip to Content
Technical Articles
Author's profile photo Santhosh Kumar Vellingiri

SAP HCI – Facebook Integration – Part 2

In SAP HCI – Facebook Integration – Part 1 we saw how to obtain Facebook Connectivity artifacts and add it to SAP HCI Secure Parameters. In this blog I will show how to configure Facebook adapter to read post and comments.

Integration Flow

I have developed a simple Integration flow to be triggered every one hour. The Request-Reply service call branch will invoke Facebook endpoint and send the Message body as email.

5.PNG

Get Posts Endpoint Configuration:

This producer endpoint will return posts(/feeds) from a User or Page. In the example I will show how to read feed from a User page. Configure the receiver channel as below.

1. Choose Endpoint as Get Posts.

2. User / Page ID: This parameter is filled with the User ID copied from the App created in previous blog Step-6.

3. OAuth Settings parameters in the channels will refer the Secure Parameters artifact names created in the previous steps.

1.PNG

2.PNG

This service call returns result as facebook4j.ResponseList<facebook4j.Post> object as message body.Below is an example payload from demo scenario.

/wp-content/uploads/2016/06/7_983335.png

This above message response can be read using a Groovy Script which I will cover in next blog.

Get Post Comments Endpoint Configuration:

 

This provider endpoint will retrieve all the comments of requested post. It requires a Post ID as Channel Parameter which is retrieved in Get Posts producer endpoint. Below is receiver channel configuration.

1. Select Endpoint as Get Posts Comment.

2. Set the Post ID. (Note: In next blog we will see how to read from facebook4j.Post using Groovy Script and set in the channel)

3. OAuth Settings parameters in the channels will refer to the respective Secure Parameters artifact.

3.PNG

(Note : For Demo purpose Post ID is hard coded to read the comment using the same Integration Flow)

This service call returns result as facebook4j.ResponseList<facebook4j.Comment> object as message body. Below is an example payload from demo scenario.

/wp-content/uploads/2016/06/8_983336.png

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Santosh,

      Looks like FB took away user_posts from out of box permissions.

      Can you please check if your integration is working as is ?

      Thanks
      Vishnu

      Author's profile photo Former Member
      Former Member

      Hi. I am not getting any response as read request from Facebook API.

      Author's profile photo Ajay Vaddemani
      Ajay Vaddemani

      Hi,

      I am getting below as an output, can you suggest me what i am missing.

      PagableListImpl{count=null, paging=null, summary=null, []}

      Author's profile photo Vimal Pillai
      Vimal Pillai

      Hi Ajay,

      Same issue for me too.. Any solutions?

       

      Author's profile photo Former Member
      Former Member

      Hi Santhosh,

      You mentioned in the next blog, you will show how to read from facebook4j.Post using Groovy Script and set the PostID in the channel, but I could not find this blog yet.

      Currently we are facing problem to dynamic assign PostID to Facebook Adapter, could you kindly provide relevant document or share an example? Thanks so much.

      Best Regards

      Hank