8

I'm trying to display a gallery of images on a website for a client. Those images should be fetched from their Instagram account automatically. Simple, right? Well, it used to be...

I can't use the Instagram API, because it's being deprecated: https://www.instagram.com/developer/

So instead, I'm trying to use the Instagram Graph API to get the latest images for the account: https://developers.facebook.com/docs/instagram-api/reference/user/media#get-media

Skip to the bottom for the short version, or keep reading for the long version.

Long Story

Trouble is, I'm having a very hard time understanding how to even get the credentials to interact with this API. As best I can tell, I need to create four separate things first:

  • An Instagram Business Account (done)
  • A Facebook User (done)
  • A Facebook Page (done)
  • A Facebook App (done...ish)

I'm not even sure if I need to create all of those things (especially the app), but that's where I'm at now. And I'm trying to figure out what permissions I need based on this page: https://developers.facebook.com/docs/facebook-login/access-tokens#apptokens

I'd think I need an "app access token", and from what I understand I can instead use the app ID and app secret combined in place of the app access token, and that actually seemed to sort of work.

I then tried to get the Instagram ID I need based on the linked Facebook page, which I did with this call (with the real Facebook account ID and the proper token): https://graph.facebook.com/some-facebook-account-id-here?fields=instagram_business_account&access_token=something-here|and-here

The response to that call was:

{
   "error": {
      "message": "(#10) To use 'Page Public Content Access', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'Page Public Content Access' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.",
      "type": "OAuthException",
      "code": 10,
      "fbtrace_id": "[redacted]"
   }
}

And then I went down a rabbit hole of trying to submit the "feature" for review, but that ended with me running into a catch 22 where it was asking me to have a live working demo of the thing I'm asking for access to. I don't understand how I can have a live working demo when I don't even have access to it yet.

Long Story Short

Long story short, this seems obscenely complicated for something that should be very simple. Maybe I'm just doing this wrong?

What would you do if you were in my shoes in order to gain access to the Instagram Graph API so that you can fetch a few images from a specific Instagram account to display on a website?

Nicholas Westby
  • 1,109
  • 13
  • 32
  • No, an app access token won’t give you access. It clearly says that you need a user access token with at least `instagram_basic` permission, right there in the documentation you linked to. – CBroe Jun 29 '18 at 06:52
  • @CBroe My understanding is imperfect, but I think both will "work". However, it seems like a user access token is short lived (an hour) and must be granted by an actual website visitor. Again, I may be misunderstanding something, but that doesn't seem like it would work for my scenario. – Nicholas Westby Jun 29 '18 at 14:53
  • Tokens can be extended, see docs … – CBroe Jun 29 '18 at 14:56
  • @CBroe Yeah, I was just reading about that too. But even then I require an app access token to extend a user access token, correct? In any event, that's not the issue I'm having. My real issue is the complexity of steps to even get there. I need to call other API's (e.g., to find the ID for the Instagram account) before I ever call the actual API's to fetch media. And they in turn require extra hoops to jump through (e.g., creating a screencast of my not yet implemented "app", which is really just a widget on a webpage). – Nicholas Westby Jun 29 '18 at 14:59

1 Answers1

1

Now if you want to access Instagram post you have two options

  1. To use Instagram Graph API For Business Account
  2. To use Instagram Platform API For non-business account

Assuming you have business account

Here is link to get started

Note:-

None business account Instagram supports only basic permission

Starting 10/1/2017, all permissions other than the basic permission will be unavailable to submit for or obtain.

This is what they have to say about Instagram api for non-business accounts

Even on Facebook developers plateform they say

The Instagram Graph API allows you to programmatically access Instagram Business Accounts

Here is SO thread that discusses about it,

So, in short, it's very hard to use APIs for Non-Business accounts

Mihir Dave
  • 3,954
  • 1
  • 12
  • 28
  • That was not my question. I've read the getting started page and many other pages for the Instagram Graph API. And yes, it's a business account. Further, I mentioned in my question that the Instagram API (what you are referring to as the Instagram Platform API) is being deprecated and so I can't use it. – Nicholas Westby Jul 18 '18 at 15:16
  • 2
    For anybody reading this answer, please ignore it. It apparently got selected to receive the bounty I created, but it's not a good answer. In fact, I hope the author deletes this answer. – Nicholas Westby Jul 20 '18 at 20:47
  • @NicholasWestby Did you ever come up with a solution? I'm going to be running into this pretty soon as well and would buy you a beer if you had any new insights that can help me :) – Greg Aug 25 '18 at 09:10
  • @Greg, nope, we reread the the deprecation warning for the old API and it says, "Basic - to read a user’s own profile info and media in early 2020". That seems to mean that it'll keep doing what we want it to for a couple more years. Good enough for our use case for now. – Nicholas Westby Aug 25 '18 at 17:10
  • 1
    @NicholasWestby can confirm. I got this working in my app using the legacy api just fine. Until the graph api supports non business accounts this seems to be the way to go. – Greg Sep 15 '18 at 16:28
  • @Greg Do you think it will ever support non-business accounts? – Wild Goat Apr 17 '19 at 10:30