8

I'm quite new using instagram API/Graph API but I can't find answers to my questions.

Since Instagram API is deprecated, now we have to deal with instagram/facebook graph API.

I am aware of the new procedure (https://developers.facebook.com/docs/instagram-api/getting-started/ ) that consist of:

  • Connect a Facebook Page to an Instagram Business Account.
  • Register your app.
  • Add the Facebook Login product.
  • Add the Instagram API product.
  • Test your app's settings with the Graph API Explorer.
  • Submit your app for App Review.

The problem is that I only want to be able to get my own instagram feed only.

But by default, the minimum API permission is instagram_basic This permission must be reviewed by facebook before beeing granted.

And to be reviewed we must provide (as a screencast):

  • How a business will log in with Facebook to connect their Instagram profile
  • How a business will see this feature used in your app

As described here

But for my use case I don't have such things to show as I just want to do backend processing for my own feed.

My questions are:

  1. Does the graph API allow this?
  2. Do I miss something, like a kind of App token for instagram ? (Like : https://developers.facebook.com/docs/facebook-login/access-tokens?locale=en_US#apptokens)
  3. Is there a workaround ?

Thanks for your time and contribution.

Fabi1
  • 79
  • 1
  • 5
  • Did you manage to find a workaround? – Jalal Nov 26 '18 at 20:44
  • @Fabi1, I'm facing the same issue while I can not get the Facebook app to pass the app review for that permission. But I've succeeded to retrieve my feeds by using a user access token which I generated by the Graph API Explorer tools. Did you manage to sort this problem? – Truong Le Dec 21 '19 at 12:33

2 Answers2

2

Facebook reviews are pretty annoying and mostly impossible to go through. But I managed to make exactly what you want: get my own Instagram's feed. I made it with Facebook Javascript SDK.

The first thing you should keep in mind is that you must be logged in your Facebook's account with the browser you are using. Otherwise, you should add the login code (I can put in here if you need it).

After all the steps about connect your Facebook account with your Instagram (getting the appID):

Reference Facebook Javascript SDK

<script async src="https://connect.facebook.net/es_ES/sdk.js"></script>

Init Facebook

FB.init({
  appId: "your_app_id",
  autoLogAppEvents: true,
  xfbml: true,
  version: "v3.1"
});

If you are connected (very important):

FB.getLoginStatus(function (response) { // Check login status
  if (response.status === "connected") {
    FB.api(
      "/" + your_facebook_page_id + "/",
      "GET", { "fields": "instagram_business_account" }, // Get Instagram's account ID
      function (response) {
        FB.api(
          "/" + response.instagram_business_account.id + "/media", // Get Instagram's media
          "GET", { "fields": "shortcode" }, // In this case, only shortcode
          function (response) {
            // Do something with the data
          }
        );
      }
    );
  } else {
    console.log("Error recovering access token: Not connected.")
    console.log(response)
  }
});

Hope it helps!

Andrés Marotta
  • 345
  • 3
  • 21
1

If you are the page owner and the developer of the app, it should work without review.

Norbert
  • 1,391
  • 1
  • 8
  • 18
  • 1
    Are you able to confirm this? I tried it out by creating a new Facebook App and setting up Facebook Login and Instagram API. If I use the graph explorer to create a token for that app with instagram_basic and then try to request one of my pages that has an instagram_business_account (via ?fields=instagram_business_account) then the instagram_business_account doesn't show up. The Get Started docs seem to confirm this because it says you have to submit for review before you can use the graph explorer to test the endpoints. But if you know a way to view your own accounts please share! – Calvin Schemanski Jul 31 '18 at 19:47
  • 1
    Already tried "instagram_accounts" instead of "instagram_business_account" ? – Norbert Aug 01 '18 at 11:47
  • 1
    Yeah, doesn't seem to be it either. '''{ "error": { "message": "(#200) CREATE_ADS or above permission on the page is required", "type": "OAuthException", "code": 200, "fbtrace_id": "G0Q759gYvKB" } } – Calvin Schemanski Aug 01 '18 at 13:45