The Facebook Display API can be used to get an Facebook User or any Facebook Page profile, images, videos, and albums. And using Social Feed widget, you can show your Facebook Feed easily on your website.
Step 1 : Setup Your Developer Account
You need a Facebook Developer Account in order to use display APIs to display your feed on the website. There’s no rocket science in that. Log in to your Facebook account first. Then go to https://developers.facebook.com/ in order to take further necessary steps. As soon as you land there, they’ll ask you to log in through Facebook only, and since you’ve already Logged-in into your Facebook, you just need to click on Continue As Your Name and you’re in.
You’ll see something like this when you finish logging yourself in.
Step 2 : App Creation
Click on the Note provided in the widget edit area or follow This Link. This will lead you to the App Creation platform provided by Facebook for Developers.
Then you must be reached at this step, App Creation. Click on My Apps on top right corner in menu. Which will lead you to your apps list where you can create or use an existing app.
There are chances that you already have created some apps for any other purposes, but we will suggest you to Create a New Separate App in order to maintain integrity of data & data permissions for different purposes.
Click on the Create App Button, which will lead you to the next steps of app creation.
Here in the task, We are going to use Facebook Feed API to display your posts in your webpage. Which falls into None category of App type. So select it & click on Continue.
Then it’ll ask for your app information like your App Name, Contact Email and Business Manager Account. Provide appropriate information there & click on Create App. You can skip Business Manager Account as it’s not required or does not relate in any cases.
As you complete this form filling process & click on Create App, your App Creation Process is Done here. Now you need to jump on next steps provided below.
Step 3 : Generating User Token
Click on the Step 2: How to create user token provided in the widget edit area or follow This Link. This will lead you to the User Token Generation for Facebook.
Clicking on that link will take you to the Facebook for Developers & ask for your permission to allow the usage to app your Facebook data. Click on Allow & you’ll have your User Token over there.
After Selecting an App, from your App dashboard in Facebook for Developers, find Tools > Graph API Explorer in upper toolbar.
Clicking on it will redirect you to Access Token Generation for your Facebook feed. And there you’ll see a button for Generating Access Token.
Here’s the catch. If you want any Individual / User feed, Select User Token in User or Page dropdown & for Page Content you’ll need Page Access Token for your page. You can select all those things in that dropdown only.
You need to set permissions of access for Facebook Individual profile posts & page posts. So make sure you allow user_posts, pages_show_list, pages_read_engagement, pages_read_user_content permissions in the list to get all the things to display on your web Page.
Then click on Generate Token, and your Access token is ready to use. But there’s a catch here. This Access Token is Temporary. Access Token expires in random short time after generation, so there’s an Access Token Extension Process, visit next steps to follow that.
Step 4 : Extension of User Access Token
Facebook Extended Access Token is valid to use for long term, so you don’t need to generate it very often.
To generate it click on 🛈 Icon before the Access Token Sequence.
This will open a Popup, and will display the information about your Access Token. Click on Open in Access Token Tool button which will lead you to make that Access Token Extended.
Clicking on that button will lead you to the Access Toke Debugger, where you’ll find the detailed information about your Access Token Generation. Click on Extend Access Token button by the end of the information table.
Finally you’re having your Long Live Access Token with expiration date in a message box under there. You can use that Access Token till the date mentioned there & then it’ll got expired. To extend the usage of Access Token, Repeat Step 4. You’ll have a Extended Token without generating a new one each time it expires.