Interact with Facebook

Use these recipes to retrieve the details of a Facebook page.

Note:

These recipes are available in the REST — Facebook | Get Page Details package in the Integration Store. Oracle provides these recipes as samples only. These recipes are meant only for guidance, and are not warranted to be error-free. No support is provided for these recipes.

Overview

Using the recipes in the REST — Facebook | Get Page Details package, you can:
  • Get all the posts published by a Facebook page.
  • Get the entire feed of a Facebook page, including posts and links published by the page or by the visitors to the page.

To run a Facebook recipe, you must configure the Oracle Facebook Connection with the details necessary to access Facebook. You can then trigger the recipe through a REST request and supply the page-id of the Facebook page for which you want to retrieve details. The Facebook Adapter in the recipe is subsequently invoked, and it fetches the details of the specified page from Facebook. The response containing the page data is returned to you.

Integration Name Description REST Commands and Example Payloads

Get Page Posts

Retrieves all the posts published by a Facebook page.

REST API Command:
GET: https://<host:port>/ic/api/integration/v1/flows/rest/ORCL-R-FACEBO_GET_PAGE_POSTS/1.0/getPosts?key=page-id&value={facebook_page_id}
Example Response Payload:
{
    "postResource.definitions.postType": {
        "data": [
            {
                "created_time": "2019-10-17T09:41:54+0000",
                "story": "",
                "id": "114257499511181_1240634186121094"
            }          
        ]
    }
}

Get Page Feed

Retrieves the entire feed of a Facebook page, including posts and links published by the page or by the visitors to the page.

REST API Command:
GET: https://<host:port>/ic/api/integration/v1/flows/rest/ORCL-R-FACEB_GET_PAGE_FEED/1.0/getPageDetails?key=page-id&value={facebook_page_id}
Example Response Payload:
{ "postResource.definitions.postType": { "data": [ {
"created_time": "2021-03-12T04:13:57+0000",
"story": "James London wrote on ExamplePage's timeline — with David Ryan.",
"id": "101637441997647_108967031264688" },
{ "created_time": "2021-03-12T04:13:38+0000", "message":
"Example message1","id": "101637441997647_108966757931382" },
{ "created_time": "2021-03-12T04:11:30+0000", "message": 
"Example message2","id": "101637441997647_108965954598129" },
{ "created_time": "2021-03-12T03:55:31+0000", "message":
"Example message3", "id": "101637441997647_108955377932520" },
{ "created_time": "2021-03-11T17:59:11+0000", "message":
"Example message4", "id": "101637441997647_108577494636975" },
{ "created_time": "2021-03-11T17:58:26+0000", "message": 
"Example message5", "id": "101637441997647_108577171303674" },
{ "created_time": "2021-03-10T15:05:16+0000", "message": 
"Example message6", "id": "101637441997647_107388018089256" } ],
"paging": { "cursors": { "before": "QVFIUmdRR3VaSXJZAM2F1aEt
PeXFNdy1NNk1weENIbG5IVkNaeldCRFo5aWd1Mng2
R0JSZAElWVFBINzBnSmJBYzhTRjNfQl85VHZAvc3E5RkNYems2ZAzR0R01tN2pYZ
AWdGalZAQblpoeWNaOXN0Skd2WGlOMkZABMVNQZAl9GemtibU1FcXdE",
"after": "QVFIUkwycGp3MG11YnVZAbFNBMzkwd09PanUtbzVKVHVPVT
VuREwxcDdLNjkzNHRHR013ekl4RVhqbW9iNlJfOW5QREp
TQVVNVjFqZAGdheGNlMTdtOVowa2xSMHdNSkJQME53RzM
4T2ZADQnhyUWpNMEY1Rk1XMDZAxbHd1ZAXpWLXdiUDNS" } } } }

System and Access Requirements

  • Oracle Integration
  • Facebook

Install, Configure, and Run the Recipes

For more information and steps to install, configure, and run recipes, see Get Started with Integration Accelerators and Recipes.

Configure the Oracle REST Trigger Connection and the Oracle Facebook Connection present in the recipe package. You only need to configure these connections once. Both the recipes in the package use the same connections.

You must supply the following information when you configure these connections.

Connection Name Parameters

Oracle REST Trigger Connection

The connection parameters are already configured for you. Test and save the connection.

Oracle Facebook Connection

Security

  • Security Policy: FaceBook OAuth Authorization Code Credentials.
  • Client Id: The App ID of your Facebook application.
  • Client Secret: The App Secret of your Facebook application.
  • Scope: The necessary scope parameters for the recipe.

For more details, see Create a Facebook Adapter Connection in Using the Facebook Adapter with Oracle Integration.