Facebook Connector User Manual
  • 18 May 2023
  • 12 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Facebook Connector User Manual

  • Dark
    Light
  • PDF

Article Summary

ACQUIRING THE FACEBOOK PAGE ID

Before creating a flow using the FYB Facebook connector, you will need to obtain the Facebook Page ID for the Facebook Page that will be used to archive posts from.

  1. Navigate to https://developers.facebook.com/tools/explorer/

  2. Hover over Tools and click on the Graph API Explorer option
    2020-08-13_9-26-29.png

  3. Select the Facebook App that was used in the Facebook Connector Installation Guide
    2020-09-14_10-56-11.png

  4. Within the User or Page drop down menu, select User Token
    2021-01-25_13-57-31.jpg

  5. Enter the string below into the search bar, and click Submit
    me/accounts
    2020-09-25_13-42-35.jpg

  6. Locate the name of the Facebook Page and copy the id value which will be used in the next section
    2020-09-14_17-31-43.png

ACQUIRING A FACEBOOK PAGE ACCESS TOKEN

Before creating a flow using the FYB Facebook connector, you will need to obtain the Facebook Page Access Token in use by the Power2CM API.

  1. Open Power2CM in your web browser and navigate to the Connector section
  2. Copy the value in the FACEBOOK PAGE ACCESS TOKEN field
    2022-03-02_14-43-34.png

SAMPLE FLOWS

We have provided two sample flows to archive posts from Facebook to Content Manager. These sample flows will help you get set up with the FYB Facebook connector and can be used as a basis to design other flows:

  • Facebook Page to CM Flow - This flow will archive posts/comments from a Facebook page to CM
  • Facebook Profile Posts to CM Flow - This flow will archive posts from a personal Facebook profile to CM
Note

Before using these sample flows ensure you have completed all steps from the Power2CM Installation Guide and Facebook Connector Installation Guide.

Before importing the samples, you need to create two connections in Power Automate:

  • Power2CM Connection
  • Facebook Connection

CREATING A POWER2CM CONNECTION

  1. Once you have logged into Power Automate, click on Connections in the left menu under Data
    2020-09-23_15-03-16.png

  2. Click on the New connection button
    2020-09-23_15-04-08.png

  3. Type Power2CM into the search bar and click on the Power2CM Connector (name may vary depending on the name given for the connector in the Power2CM Installation Guide)
    2020-09-30_15-44-03.png

  4. Enter your Content Manager username and password into the username and password fields respectively, and click Create. Include the domain before the username
    2020-09-30_15-45-26.png

  5. Your connection will now appear in the list of Power Automate connections. The status should state Connected
    2020-09-30_15-47-27.png

CREATING A FACEBOOK CONNECTION

  1. Once you have logged into Power Automate, click on Connections in the left menu
    2020-09-23_15-03-16.png

  2. Click on the New connection button
    2020-09-23_15-04-08.png

  3. Type Facebook Connector into the search bar and select the FYB Facebook Connector
    2020-09-30_15-55-37.png

  4. Click on the Create button
    2020-09-30_15-58-57.png

  5. Follow the prompts in the browser pop-up. Sign in using the Facebook Developer account used in the Facebook Connector Installation guide

  6. Once complete, your connection will now appear in the list of Power Automate connections. The status should say Connected
    2020-09-30_16-01-53.png

IMPORTING THE FACEBOOK PAGE TO CM FLOW

  1. Once you have logged into Power Automate, click on My Flows in the left menu
    2020-09-23_15-21-48.png

  2. Click on the Import button
    2020-09-23_15-24-46.png

  3. Click on the Upload button
    2020-09-23_15-25-45.png

  4. Select the Facebook Page to CM flow.zip file and click on the Open button
    2020-09-24_9-10-53.png

  5. Once your file has finished uploading, you will be taken to the page below
    2020-09-24_9-13-34.png

  6. The connectors/connections (resources) found in the Related Resources table will need to be mapped to your current connectors/connections.
    This can be achieved by clicking the Select during import button found in the IMPORT SETUP column

EXPORTED RESOURCERESOURCE TO MAP
FYB Facebook ConnectorSelect the Select during import button and then the Facebook Connector and click Save
Power2CMSelect the Select during import button and then Power2CM then click Save
Facebook ConnectionSelect the Select during import button and then your Facebook Connection and click Save. The name displayed will be the full name of the Facebook Developer account used in the CREATING A FACEBOOK CONNECTION
Power2CM ConnectionSelect the Select during import button and then Power2CM and click Save

Each time a resource is mapped, its icon will change from to

  1. Click on the Import button
    2020-09-23_15-51-22.png

  2. You will receive a success message at the top of the page once your flow has been imported successfully
    2020-09-24_9-31-46.png

UPDATING THE FIELD VALUES

  1. Edit the Facebook Page to CM flow that has been imported
    2020-09-25_13-45-41.jpg

  2. Click on the Get Page Posts action
    2020-09-30_16-03-46.png

  3. Enter the Facebook Page ID obtained from the ACQUIRING THE FACEBOOK PAGE ID section. Ensure only the number is entered with no " marks or spaces
    2021-08-20_13-24-49.png

  4. Enter the Facebook Page Access Token obtained from the ACQUIRING A FACEBOOK PAGE ACCESS TOKEN section.
    2021-08-20_13-24-49.png

  5. Click on the Archive Facebook Post action

  6. Enter the URI of the record type that you wish to use into the Record Type field. Enter the record number of the container you wish to capture the posts in the Container field
    2020-12-18_15-45-11.png

For full information on all the fields please refer to the FACEBOOK CONNECTOR ACTIONS > ARCHIVE FACEBOOK POSTS section of this guide.

  1. Click on the Save button
    2020-09-23_16-08-24.png

  2. Your flow will be disabled by default. To enable it, click the Left Arrow button
    image.png

  3. Click on the Turn on toggle
    image.png

IMPORTING THE FACEBOOK PAGE CONVERSATION TO CM FLOW

  1. Once you have logged into Power Automate, click on My Flows in the left menu
    2020-09-23_15-21-48.png

  2. Click on the Import button
    2020-09-23_15-24-46.png

  3. Click on the Upload button
    2020-09-23_15-25-45.png

  4. Select the Facebook Page Conversation to CM.zip file taken from your power2cm-files.zip package and click Open
    image.png

  5. Once your file has finished uploading, you will be taken to the page below
    image.png

  6. The connectors/connections (resources) found in the Related Resources table will need to be mapped to your current connectors/connections. This can be achieved by clicking the Select during import button found in the IMPORT SETUP column

NAMERESOURCE TO MAP
Power2CMSelect the Select during import button and then Power2CM then click Save
Power2CM ConnectionSelect the Select during import field and then Power2CM and click Save

Each time a resource is mapped, its icon will change from to

  1. Click on the Import button
    2020-09-23_15-51-22.png

  2. You will receive a success message at the top of the page once your flow has been imported successfully
    image.png

UPDATING THE FIELD VALUES

  1. Edit the Facebook Page Conversation to CM flow that has been imported
    image.png

  2. Click on the Archive Facebook Page Conversations action and enter the URI of the record type that you wish to use into the Record Type field. Enter the record number of the container you wish to capture the posts in the Container field
    image.png

  3. Enter the Facebook Page ID obtained from the ACQUIRING THE FACEBOOK PAGE ID section. Ensure only the number is entered with no " marks or spaces

For full information on all the fields please refer to the FACEBOOK CONNECTOR ACTIONS > ARCHIVE FACEBOOK PAGE CONVERSATIONS section of this guide.

  1. Click on the Save button
    2020-09-23_16-08-24.png

  2. Your flow will be disabled by default. To enable it, click the Left Arrow button
    image.png

  3. Clickon the Turn on toggle
    image.png

IMPORTING THE FACEBOOK PROFILE POSTS TO CM FLOW

To import the Facebook Profile Posts to CM flow the same steps from the IMPORTING THE FACEBOOK PAGE TO CM FLOWS section can be followed, in step 4 select the Facebook profile to CM flow.zip file.
2020-09-24_9-33-38.png

UPDATING THE FIELD VALUES

  1. Edit the Facebook Profile Posts to CM flow that has been imported
    image.png

  2. Click on the Archive Facebook Post action. Enter the URI of the record type that you wish to use into the Record Type field. Enter the record number of the container you wish to capture the posts in the Container field
    2020-12-18_15-45-11.png

For full information on all the fields please refer to the FACEBOOK CONNECTOR ACTIONS > ARCHIVE FACEBOOK POST section of this guide.

  1. Click on the Save button
    2020-09-23_16-08-24.png

  2. Your flow will be disabled by default. To enable it, click the Left Arrow button
    image.png

  3. Click on the\ Turn on toggle
    image.png

Your flow will now run once a day. Records already created from previous flows will be updated using the id supplied in the Id field of the Create Record in CM action.

FACEBOOK CONNECTOR ACTIONS

Below is a list of all actions available with the connector and what can be set up with them.

GET MY POSTS

Gets all the posts created by the currently logged in Facebook user.
2020-09-30_16-09-59.png

NameDescription
fieldsThe fields to be returned from the API call. We recommend using the following value: message,from,full_picture,created_time,updated_time,reactions.limit(0).summary(true),shares,comments{attachment,from,message,created_time,comments{attachment,from,message,created_time,comments}}
sinceUse this field to query for posts created after the date specified in this field. Note, Facebook Graph API dates are in UTC-08:00 timezone. The Date time value needs to be in the following format: YYYY-MM-DDTHH:MM:SS+0000, for example: The value entered in the Since field for querying for posts that were made after 21/08/2020 at 9:30 PM will be 2020-08-21T21:30:00-0000
untilUse this field query for posts created until the date specified in this field. Note, Facebook Graph API dates are in UTC-08:00 timezone. The Date time value needs to be in the following format: YYYY-MM-DDTHH:MM:SS+0000, for example: The value entered in the Until field for querying for posts that were made before 21/08/2020 at 9:30 PM will be 2020-08-21T21:30:00-0000
limitSpecify the number of posts returned, for example, entering 100 will return 100 posts.

GET COMMENTS

This action will retrieve all comments and attachments within the comments from a Facebook post.

2020-09-30_16-10-48.png

NameDescription
post-idThe post id of a Facebook post, for example: 654866888476824_652121628751350
fieldsThe fields to be returned from the API call. We recommend using the following value: attachment,from,message,created_time
orderThe order in which the comments are displayed. The values for this field can either be chronological or reverse_chronological

GET PAGE POSTS

This action will retrieve all posts from a Facebook Page.

2021-08-20_13-54-30.png

NameDescription
Page IDThe ID of the Facebook page that the action will retrieve posts from
fieldsThe fields to be returned from the API call. We recommend using the following value: message,from,full_picture,created_time,updated_time,likes.summary(true),shares,comments{attachment,from,message,created_time,comments{attachment,from,message,created_time,comments}}
sinceFor retrieving posts after the supplied Date Time. The Date Time value must be in the following format: YYYY-MM-DD, for example: 2021-06-06
untilFor retrieving posts before the supplied Date Time. The Date Time value must be in the following format: YYYY-MM-DD, for example: 2021-06-06
access_tokenUsed for the Facebook Page Access Token

ARCHIVE FACEBOOK POSTS

Note

Requires Power2CM Connector

This action is to be used in conjunction with the Get My Posts and Get Page Posts FYB Facebook Connector actions to save the data from Facebook into CM.

2023-04-18_17-00-24.png

NameDescription
Record TypeThe record Type URI
TitleTitle of the record
ContainerContainer number of the container that the record will be created in
NotesThe notes of the Record
AuthorSpecify the email or full name of the location to be used as the Author location for the record. This value will be used if Power2CM cannot find a matching location for the author of the Facebook post.
Generate PDFIf Yes is selected, a pdf will be generated using the Title, Date Created, Author, Attachment Url and Notes fields. This pdf will be set as the electronic document of the record.
PDF Template URIThe URI of a record to be used as the template for generating pdf files. See the PDF TEMPLATES section in the Power2CM User Manual for more information
Force UpdateIf Yes is selected, existing records are always updated (new revisions created) every time the flow is run. This is for scenarios where the preceding connector (e.g. The FYB Instagram Pro Connector) does not have a date last updated field
Facebook Posts DataThe JSON data returned from the Get My Posts or Get Page Posts FYB Facebook Connector actions

PLACEHOLDERS

The Notes field can contain the following placeholders:

PlaceholderDescription
{AUTHOR}The author of the Facebook Post
{COMMENTS}The comments on the facebook posts. Comments include:
  • the comment
  • the author (if available)
  • created date of the comment
Attachments in comments will appear in the attached PDF on the record.
{CREATED TIME}The created date of the Post
{LIKES}Total likes for a post
{MESSAGE}The message/caption on a post
{PEOPLE REACHED}The number of people reached on a Facebook Page Post. This requires both a Facebook Page Access Token and the pages_read_engagement and read_insights Facebook Permissions.
{SHARES}The total number of shares on a post
{UPDATED TIME}That last modified date of a post

The Titles field can contain the following placeholders:

PlaceholderDescription
{AUTHOR}The author of the Facebook Post
{CREATED TIME}The created date of the Post
{LIKES}Total likes for a post
{MESSAGE}The message/caption on a post
{SHARES}The total number of shares on a post
{UPDATED TIME}That last modified date of a post

Example use of the Archive Facebook Posts action:
2020-12-18_14-56-48.png

ARCHIVE FACEBOOK PAGE CONVERSATIONS

Note

Requires Power2CM Connector

This action is to be used to archive all the conversations of a given Facebook Page to Content Manager. The Facebook account you use must be the admin of the page you wish to archive conversations from.

2023-04-18_16-16-38.png

NameDescription
Record TypeThe record Type URI
TitleTitle of the record
ContainerContainer number of the container that the record will be created in
NotesThe notes of the Record
Generate PDFIf Yes is selected, a pdf will be generated using the Title, Date Created, Author, Attachment Url and Notes fields. This pdf will be set as the electronic document of the record.
PDF Template URIThe URI of a record to be used as the template for generating pdf files. See the PDF TEMPLATES section in the Power2CM User Manual for more information
AuthorSpecify the email or full name of the location to be used as the Author location for the record
Facebook Page IdThe Page Id of the Facebook Page to archive conversations from. Please refer to the ACQUIRING THE FACEBOOK PAGE ID section to obtain the Page Id.

PLACEHOLDERS

The Notes field can contain the following placeholders:

PlaceholderDescription
{CONVERSATION}The conversation between the Facebook Page and a Facebook User
{UPDATED TIME}The created/last updated date of the conversation
{PAGE ID}The Id of the Facebook Page

The Titles field can contain the following placeholders:

PlaceholderDescription
{UPDATED TIME}The created/last updated date of the conversation
{PAGE ID}The Id of the Facebook Page

Example use of the Archive Facebook Page Conversations action:
2023-04-18_16-16-38.png

ERROR HANDLING NOTIFICATIONS (OPTIONAL)

Power2CM contains the ability to provide email notifications of any errors that occur during the transfer process. This email will be sent once per day. If this error notification is required to be sent after a failed processed request, an additional step can be included in a flow to allow for an instantaneous message to be sent to the nominated person.

Below is an example of error handling for a Facebook flow, this can be completed for all types of flows.

To add an error handling step to the end of the connector, complete the following:

  1. Select the flow to change and click on the Edit button
    2022-01-25_11-13-47.jpg

  2. Click on the New Step Button, this will add the step to the end of the flow
    2022-01-25_11-12-43.jpg

  3. Click on the the Notifications button
    2022-01-25_11-16-15.jpg

  4. Select the preferred notification type, Email or Mobile Notification, and fill out the required details required.
    2022-01-25_11-19-20.jpg

  5. Click the '...' menu in the top right of the action, and click Configure Run After item.
    2022-01-25_11-20-10.jpg

  6. Check the Has Failed and Has Timed Out check boxes only and proceed by clicking the Done button
    2022-01-25_11-21-56.jpg

  7. Click on the Save button
    2022-01-25_11-23-38.jpg

  8. Repeat the process above for any other flows desired.


Was this article helpful?