Skip to Content

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

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Vishnu vardhan

    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

    (0) 

Leave a Reply