This sample shows how you can connect a Facebook Page to Content Moderator workflows.
Following is what we will do at a high level:
Once the setup is done, all visitor posts on the Facebook Page would be sent to Content Moderator for executing the content workflow. Based on the thresholds specified in your Content Moderator workflow the posts would either be automatically un-hidden or go a through a human-review.
For this step you will need to login to the Azure Management Portal
Add a Function App (refer this link)
Open the newly created function app
Navigate to Platform features -> Application Settings
Create the following application settings entries (refer this link):
App setting | Description |
---|---|
cm:TeamId | Your Content Moderator TeamId |
cm:SubscriptionKey | Your Content Moderator subscription key. Get it on Settings-> Credentials |
cm:Region | Your Content Moderator region |
cm:ImageWorkflow | Name of the workflow to run on Images |
cm:TextWorkflow | Name of the workflow to run on Texts |
cm:CallbackEndpoint | Url for the CMListener Function App that you create later in this guide |
fb:VerificationToken | This is secret that you put in and the same is used to subscribe to the facebook feed events |
fb:PageAccessToken | This is a facebook graph api access token that does not expire and allows the function Hide/Delete posts on your behalf. |
Create a new HttpTrigger-CShrap function named FBListener - This function receives events from Facebook
Create a new HttpTrigger-CShrap function named CMListener - This function receives events from Content Moderator
Use the Graph API Explorer to create a short lived user access token for the app
We will use Postman for the next few steps:
Key | Value |
---|---|
appId | Insert your Facebook App Identifier here |
appSecret | Insert your Facebook App's secret here |
short_lived_token | Insert the short lived user access token you generated in the previous step |
Well that was the last step!!
Images and Text posted on your facebook page will now be sent to Content Moderator. Images that don't adhere to your policies would be taken down.