Please note that once you've completed these steps, anyone with a role on your Facebook Page can potentially use your app to access the data in the connected Instagram Business Account.
In order for your app to use the Instagram API, you must:
Before you begin, you must have:
- a Facebook Page
- a role on that Page
- an Instagram account
You will be connecting the Facebook Page to the Instagram Account, then converting the account to an Instagram Business Account if it isn't one already. You don't have to be the admin of the page, but since you'll be connecting it to an Instagram Business Account, the Page and account should be related in some way.
If you already have a role on a Page that's connected to an Instagram Business Account, go to step 2.
1. Connect the Facebook Page to the Instagram Business Account
Go to your Page's Settings and click Instagram, then log in to your Instagram account:
If the account is not an Instagram Business Account, you will be prompted to set up your Business Profile:
Continue through the steps to convert the account to an Instagram Business Account. When you are done, you will have successfully connected the Page to the Instagram Business Account.
2. Register Your App
Register your app and configure its settings by following this guide, but do not submit your app for review yet. Once you've registered and configured your app settings, go to step 3.
3. Add Facebook Login
In order to get an access token from Facebook, you'll eventually have to implement Facebook Login. You can easily do this by using one of our SDKs (recommended), or you can implement it manually.
For now, however, add the Facebook Login product to your app's configuration.
- Go to developers.facebook.com and in the top right corner, select your app from the My Apps dropdown menu. This will load it in the App Dashboard.
- In the navigation menu, click + Add Product, locate the Facebook Login product, and click Set Up.
- Skip the Quickstart for now and go to the product's Settings and enable the Use Strict Mode for Redirect URI setting. If you will be implementing Facebook Login manually, enter your redirect_uri in the Valid OAuth redirect URIs. If you will be using one of our SDKs, you can leave the field blank.
4. Add Instagram API
Now you will add the Instagram API product and submit it for review. This submission is separate from your App Review, which you will do later.
- In the App Dashboard, click +Add Product again and this time add the Instagram API product.
- In the App Review for Instagram section, click Add to Submission for each permission you will need from our App's Users.
- Scroll to the bottom of the page, and in the Current Submission sub-section, for each submission, click its View Notes link.
In the View Notes dialogue for each permission submission, provide a description for how you will use the data returned by any endpoints that require the permission, and a screencast showing how your app will use the data.
Once you've completed your notes for all of your permission submissions, click the Submit For Review button at the bottom of the page. Note that this is separate from your App Review, which you will do after testing.
After you've added both Facebook Login and Instagram API products to your app configuration, add Facebook Login to your app and record a screencast showing how you will use data returned by the Instagram API. This is similar to the Facebook Login screencast but with Instagram data, so the same guidelines apply.
Here's an example:
If your screencast covers all the permissions you are requesting, you only have to upload it for one of them.
5. Test Your App
Once you've been notified that your Instagram API product submission has been approved, you can use the Graph API Explorer to test your app.
Go to the Graph API Explorer and select your app from the Application dropdown menu:
In the Get Token dropdown menu, select Get User Access Token.
Here you'll see a list of all the permissions you can grant your app as a User. Normally, a User will only see the permissions you submitted in step 4. However, the Graph API Explorer is a testing tool, so it shows all of the possible permissions available. Check the Instagram permissions that a normal User would grant your app, as well as the
manage_pages permission. You'll need
manage_pages to get your Page's ID, which you can then use to get your Instagram Business Account ID. Click Get Access Token, and complete the flow.
The Access Token field should now display your User access token, which your app will use to make calls to the Instagram API.
The first call you will make is to the Graph API's
/user/accounts edge. This will return all of the Pages and their IDs that you have a role on. In the path field, replace
me/accounts and click Submit.
The API should return a list of Pages that you have a Role on, and their IDs, like this:
Locate the Page that you connected to the Instagram Business Account and click its ID. This will populate the ID in the path field, automatically perform a GET request, and return the Page's
Next, click in Search for a field and type
instagram_business_account until it appears in the typeahead dropdown menu.
When you see
instagram_business_account, click it. This will append the field in the path using the
fields parameter. Submit this new request, and you should get back the Instagram Business Account connected to this page.
Now that you have the Business Account's ID, we can use the Instagram API. Click the Business Account's ID and once again, the Graph API Explorer will populate the ID in the path field and automatically execute the query, returning the Instagram Business Account's ID from the Instagram API.
Of course, you already know the ID so this isn't helpful, so instead query the
/user/media/ edge by appending
/media after the account's ID and submit the query.
The Instagram API should return a list of all the media objects in the Instagram Business Account. If it did, your app is set up correctly and you can now submit it for final review. You can also go to your Page's Settings, click Instagram, and see your app listed in the Connected Apps table.
6. Submit Your App for Review
If you are able to use your app in the Graph API Explorer and successfully pull data from your Instagram Business Account, you can submit your app for review.