How To Setup Facebook Agent

· Facebook Agent Setup

Connect your Facebook page within few minutes.

Follow these steps to connect Pagepilot Ai to your page.


Step 1: Create a Meta Developer App

  1. Visit Meta Developers Portal and log into you Facebook account.
  2. Go to My apps and create a New app.
  3. Give an app name eg: Fpagepilot then click on Next and select Others as the app type Other and click on Next.
  4. Select Business option and click on Next.
  5. Click on Create App and enter your password.
  6. Now go to App Settings and click on Basic.
  7. Enter a unique [a-z] namespace for your app eg: fpagepilot and set app domain to https://pagepilot.metaxsoul.store and hit enter.
  8. For privacy policy URL, go to your Pagepilot profile and copy your privacy policy URL then paste the url in Privacy policy URL and Terms of Service URL field. Finally select Category into Business and pages.
  9. Now, Kepp all filed as it is, then scroll down and click on Save Changes.
  10. Then toogle App Mode into Live from top nav menu.

Step 2: Setup the Webhook

  1. Go to Add product from left side menu then scroll down and click on Setup Webhooks.
  2. From Select Product dropdown menu slect Page.
  3. Now, you need to enter the callback URL and verify token. For callback URL, go to your Pagepilot's Facebook agent page and copy your webhook URL then paste the url in Callback URL. For verify token, you can enter: 3301. Finally, click on Verify and Save.
  4. After that, again select Page from droupdown. Then scroll down and Subscribe to feed.

Step 3: Get the Access Token

  1. Go to Graph API Explorer from top nav menu "Tools→Graph API Explorer".
  2. From top right corner, select your created app and then click on Get Token and select Get Page Access Token.
  3. A popup will appear, select your one Facebook page and click on Next and then click on Done.
  4. Then again select you page, and add those permissions one by one: page_events, pages_manage_engagement, pages_manage_metadata, pages_manage_posts, pages_messaging, pages_read_engagement,pages_utility_messaging, pages_read_user_content, pages_show_list
  5. Now, again click one Generate Access Token, A popup will appear. continue your account then seclet your page then click on save.
  6. Now, you will see the access token in the textbox. Copy the access token and go to Access Token Debugger and paste the access token in the textbox and click on Debug. Then scroll down click on Extend Access Token Enter your account password and then copy the extended access token.
  7. Copy the Extended Access Token then visit Pagepilot's Facebook agent page and paste the access token in the access token field and click on Save Configuration.
  8. Then again goto Graph API Explorer on text bar paste the access token. And selcet your page.
  9. On top text bar select GET then type me/ then click on Submit. it will retun you your page id, copy the id.
  10. On top text bar select POST then type your_page_id/subscribed_apps then on add perameter add subscribed_fields and value feed then click on Submit. If you get true response, then you have successfully connected your Facebook page with Pagepilot Ai.
  11. Now the final step, paste the page id in Pagepilot's Facebook agent page Page id field and click on Save Configuration. And click on Test your API. If API test pass then your integration is successful. PagePilot is succesfully connected to your selected page.