Sign upSign InSign upSign InAdnan SiddiqiFollowITNEXT--ListenShareNote: Keep in mind that the information shared, including the use of the Facebook API, was accurate at the time of writing. However, it’s recommended to double-check for any updates or changes before applying these methods.The other day I was working on something that required the automation of Facebook posts. The APIs are not difficult but the process of issuing access tokens and all that is something that could be called “straightforward”. Hence, I thought, why not come up with a blog post to record something not for my own but for others as well. As my old readers know that I always prefer to come up with some interesting or at least realistic use case while discussing a concept so I came up with an idea of automation recipe posting on Facebook using Python and Tweepy library. Since chatGPT is available now so unlike past, I did not have to make much efforts coming up with an idea.This blog post consist of five parts:So, let’s start!The creation of the facebook page is not so difficult. The page is created, I named it YummyDishes ( https://facebook.com/yummyyummydishes)In order to generate access token you need to create a Facebook App. Head over to https://developers.facebook.com/apps/ and create a new app, below are the screens of app creations and permissions:Select the Business Option and click NextNow assign the App name and Email:Once the app is created, you will get an App ID like I got mine: 666475567111216 and the screen like the below:So far so good, now head on to https://developers.facebook.com/tools/explorer/, select the newly created app and under User or Page combo, select Get Page Access Token option:Now select the Fb Page you want to be connected with the app:If connected successfully, you will see something like the below:Do make sure that you will be selecting the Page for page access token rather than user tokenNow, we have to select the permission that will be responsible to create a post, search pages_manage_posts and select it:Once it is selected, click on Generate Access Token button, once logged in, it will show the newly assigned permissions:While you opted for this, the access token is also refreshed, copy it somewhere and head on to Access Token Debugger and paste in the field and hit the Debug button. It will all the details about it:You could see the scopes assigned and Expiry Date that is infront of Expires section. Now click on Extend Access Token button, it generates a long-lived token that expires on December:But this will be expired in 2 months, our goal is to get the token that never expires. Access the below url:https://graph.facebook.com/v2.10/me?fields=access_token&access_token=