How to get Instagram direct API authentication

Viewed 554

Facebook recently released a step-by-step documentation for using a GrapAPI to manage Instagram messages. To obtain the access token to use it, it's necessary to create an application in the developer center, enable login via Facebook and include the permissions "instagram_basic", "instagram_manage_messages" and "pages_manage_metadata" but to activate these options it's necessary to submit various information for approval as statement of how the integration works and descriptions of the usage flow. I don't have access to this information because I can't develop an integration without it being approved. It's not possible to use the provided test user as the pages raised by him cannot be linked to Instagram accounts.

Tutorial followed: https://developers.facebook.com/docs/messenger-platform/instagram/get-started

Someone with some experience with the Facebook API could give me a light on how to obtain the token with access required and proceed the tests?

1 Answers

I have done the tutorial as well, I faced the same problem. To enable instagram_basic, instagram_manage_messages and pages_manage_metadata without app review you need to create a test-app. For test apps all permissions are granted without review.

Instructions on how to create a test-app

enter image description here

Another usefull tipp: If you are wondering why you need to implement facebook login to access the instagram messaging api, the logic is the following: You need to implement login to then use your own implementation to logg in your own account and obtain the page access key that will let you do api calls to the instagram messaging api. This process is obviously overkill and instagram is working on a way of getting that access token through the developer dashboard.

For now to obtain that access token you need:

  1. implement facebook login as a simple html website and console log the response. Be sure to add the required permissions to the data-scope attribute of the facebook login button:
<div 
  class="fb-login-button"
  data-scope="public_profile,email,instagram_basic,instagram_manage_messages,pages_manage_metadata,pages_messaging"
></div>
  1. deploy to a website that has https enabled (logging in from localhost will only work if you use a tunelling service like ngrok).

  2. Open your website that has facebook login implemented and logg in with your facebook account that is also linked to the target instagram account and also is admin of your test-app.

  3. get the access token from the response to call the other API endpoints.

Related