Create a Facebook App
In order to generate a Graph API access token, you need to create a Facebook app.
To do this, navigate to https://developers.facebook.com.
Log in or create an account, then click the “My Apps” link in the top menu.
You will need to create a new app with specific permissions, so click the “Create App” button.
There is no need to add any business to it. Just click next.
Choose “Other” as the “Use case” and click “Next.”
Choose “Business” as the app type.
Finally, fill in some app details and click “Create App.” You can add any email and app name. This is just for you to easily find your app later.
After the app is created, look for the “Facebook Login for Business” block and click “Set up.”
No further actions are needed. Just click the “Save Changes” button at the bottom of the page.
That’s it, our app is created and configured.
Generate access token
Now we need to generate an access token.
We can do this using Graph API Explorer. Click “Tools” in top menu and choose “Graph API Explorer” from the drop-down.
On the Graph API Explorer page, we can generate an access token with any desired permissions for a specific app.
(1) First, look for the “Meta App” selector below the “Generate Access Token” button and choose the app that you created.
(2) To get the Instagram token for a business account, we need the following permissions:
- pages_show_list
- business_management
- instagram_basic
Add them one by one to the “Permissions” input.
(3) Finally, click “Generate Access Token”
Provide Permissions to your App
A new window will appear where you need to choose the business associated with your Facebook and Instagram business account.
Then, choose a Facebook page connected to the Instagram business account.
Finally, choose the Instagram business account.
Complete all the further steps until the window is closed, and you will see a generated token in the “Access Token” input on the Graph API Explorer page. Click the icon next to it to copy the code (4).
Extend token
Note that the token has an expiration time, so you either need to regenerate it or you can extend it.
To exted the access tokenm, paste it into the access token debugger and click debug: https://developers.facebook.com/tools/debug/accesstoken/
After that, click “Extend Access Token” button at the button of the page.
A new token will be generated, which you need to copy and use instead of the expired/temporary one.
That’s basically all.