3
votes

If one queries the Facebook Graph API for a page, there are (at least) four fields one can request relating to Instagram:

  1. connected_instagram_account - Instagram account connected to page via page settings
  2. instagram_business_account - Instagram account linked to page during Instagram business conversion flow
  3. instagram_accounts - Linked Instagram accounts for this Page
  4. page_backed_instagram_accounts - Linked Page Backed Instagram accounts for this Page

The values can vary quite a bit and I can decipher a few of these but the Facebook Graph API documentation is not that clear on these items. So, I was wondering if anyone has or can clearly define each and differentiate one from the other.

Here is an example of one page that has 3 different values across the four fields (connected_instagram_account and instagram_business_account are the same):

-- instagram_accounts: #<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="...995">]>>
-- connected_instagram_account: #<Hashie::Mash id="...004">
-- instagram_business_account: #<Hashie::Mash id="...004">
-- page_backed_instagram_accounts: #<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="...234">]>

I am assuming this is the definition of a connected_instagram_account and this is the definition of page_backed_instagram_accounts. Can anyone confirm that this is correct?

So, what about instagram_accounts?

If anyone can add some clarity or better yet, point to good definitions, that would be appreciated.

1

1 Answers

4
votes

I think I have answers to most of this question...

If I query a certain Facebook Page, it returns values for all four Instagram fields: page_backed_instagram_accounts, instagram_business_account, instagram_accounts, connected_instagram_account. The section below shows an edited version of what is returned and what happens when I try to access each using the Instagram API:

page_backed_instagram_accounts=#<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="964...289">]>
ERROR: "OAuthException: (#100) Tried accessing nonexisting field (biography) on node type (InstagramUser)"

instagram_business_account=#<Hashie::Mash id="178...143">
#<Hashie::Mash followers_count=X follows_count=Y ... username="<public handle>" website="https://www.../"> 

instagram_accounts=#<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="423...525">]>>
ERROR: "OAuthException: (#100) Tried accessing nonexisting field (biography) on node type (InstagramUser)"

connected_instagram_account=#<Hashie::Mash id="178...143">
#<Hashie::Mash followers_count=X follows_count=Y ... username="<public handle>" website="https://www.../">

As you can see, the Instagram API can access instagram_business_account and connected_instagram_account (which are the same account in this case) but not page_backed_instagram_accounts and instagram_accounts.

However, if I try to access the same account IDs based on the Marketing API definition, I get complementary results:

page_backed_instagram_accounts=#<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="964...289">]>
#<Hashie::Mash follow_count=0 followed_by_count=0 has_profile_picture=true id="964...289" is_private=false is_published=false media_count=0 profile_pic="https://scontent.cdninstagram.com/..._a.jpg?_nc_ht=scontent.cdninstagram.com" username="...758"> 

instagram_business_account=#<Hashie::Mash id="178...143">
ERROR: "OAuthException: (#100) Tried accessing nonexisting field (follow_count) on node type (ShadowIGUser)"

instagram_accounts=#<Hashie::Mash data=#<Hashie::Array [#<Hashie::Mash id="423...525">]>>
#<Hashie::Mash follow_count=J followed_by_count=K has_profile_picture=true id="423...525" is_private=false is_published=true media_count=1 profile_pic="https://scontent.xx.fbcdn.net/...a.jpg?_nc_cat=104&_nc_ht=scontent.xx&oh=d7ef...2dc&oe=5D0006BC" username="<public handle>"> 

connected_instagram_account=#<Hashie::Mash id="178...143">
ERROR: "OAuthException: (#100) Tried accessing nonexisting field (follow_count) on node type (ShadowIGUser)"

As you can see in the second example, the Marketing API can access page_backed_instagram_accounts and instagram_accounts but not instagram_business_account and connected_instagram_account.

So, from what I can tell, page_backed_instagram_accounts and instagram_accounts are (Marketing API) Ad accounts, which would need to be accessed via the [Marketing API][3].

A couple of other things to note:

  1. The account in page_backed_instagram_accounts appears to have an automatically generated username, is not published (is_published=false).
  2. While account in instagram_accounts has the same username as the account in instagram_business_account and connected_instagram_account, it actually has a slightly different followers_count, follows_count, and a different ID.
  3. The Instagram API reports against node type InstagramUser while the Marketing API reports against node type ShadowIGUser.

I believe that page_backed_instagram_accounts contains an automatically generated Ad Account for all accounts just in case there is no other Ad Account associated with an Instagram account. Still, it would be good to see a more definitive set of definitions for these fields returned for a Facebook page via the Graph API.