各种Facebook API页面“ instagram”字段之间有什么区别

时间:2018-10-27 03:30:33

标签: facebook facebook-graph-api instagram instagram-graph-api

如果查询Facebook Graph API的页面,则可以(至少)有四个字段可以与Instagram相关:

  1. connected_instagram_account -通过页面设置连接到页面的Instagram帐户
  2. instagram_business_account -Instagram帐户在Instagram业务转换期间链接到页面的
  3. instagram_accounts -此页面的链接Instagram帐户
  4. page_backed_instagram_accounts -此页面的链接页面支持的Instagram帐户

这些值可能会有很大的不同,我可以破译其中一些,但是在这些项目上,Facebook Graph API文档尚不清楚。因此,我想知道是否有人能够或可以清楚地定义每个人,并彼此区分。

以下是一个页面的示例,该页面在四个字段中具有3个不同的值(connected_instagram_account和instagram_business_account相同):

-- 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">]>

我假设这是connected_instagram_account的定义,这也是page_backed_instagram_accounts的定义。谁能确认这是正确的?

那instagram_accounts呢?

如果任何人都可以增加一些清晰度或更好的定义,请指出良好的定义,

1 个答案:

答案 0 :(得分:0)

我想我对大多数问题都有答案...

如果我查询某个Facebook页面,它将返回所有四个Instagram字段的值: page_backed_instagram_accounts instagram_business_account instagram_accounts connected_instagram_account 。以下部分显示了返回的内容的编辑版本,以及当我尝试使用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.../">

如您所见,Instagram API可以访问 instagram_business_account connected_instagram_account (在这种情况下为同一帐户),但不能访问 page_backed_instagram_accounts instagram_accounts

但是,如果我尝试根据Marketing API定义访问相同的帐户ID,则会得到补充结果:

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)"

在第二个示例中可以看到,Marketing API可以访问 page_backed_instagram_accounts instagram_accounts ,但不能访问 instagram_business_account connected_instagram_account < / strong>。

据我所知, page_backed_instagram_accounts instagram_accounts 是(营销API)广告帐户,需要通过[Marketing API]访问[3] ]

还有两点需要注意:

  1. 中的帐户的 page_backed_instagram_accounts 似乎具有自动生成的用户名,未发布(is_published=false)。
  2. instagram_accounts 中的帐户与 instagram_business_account connected_instagram_account 中的帐户具有相同的用户名,但实际上{{1} },followers_count和其他ID。
  3. Instagram API针对节点类型follows_count报告,而Marketing API针对节点类型InstagramUser报告。

我相信 page_backed_instagram_accounts 包含一个自动生成的广告客户的所有账户,以防万一有与Instagram的帐户相关联的其他广告客户。尽管如此,还是很高兴看到通过Graph API为Facebook页面返回的这些字段的更明确的定义集。