3

如果查询 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 呢?

如果有人可以增加一些清晰度或更好,请指出好的定义,那将不胜感激。

4

1 回答 1

4

我想我已经回答了这个问题的大部分...

如果我查询某个 Facebook 页面,它会返回所有四个 Instagram 字段的值:page_backed_instagram_accountsinstagram_business_accountinstagram_accountsconnected_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_accountconnected_instagram_account(在这种情况下是同一个帐户),但不能访问 page_backed_instagram_accountsinstagram_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)"

正如您在第二个示例中看到的,营销 API 可以访问page_backed_instagram_accountsinstagram_accounts但不能访问instagram_business_accountconnected_instagram_account

因此,据我所知,page_backed_instagram_accountsinstagram_accounts是(营销 API)广告帐户,需要通过 [营销 API][3] 访问。

还有几点需要注意:

  1. page_backed_instagram_accounts中的帐户似乎具有自动生成的用户名,未发布 ( is_published=false)。
  2. 虽然instagram_accounts中的帐户与instagram_business_accountconnected_instagram_account中的帐户具有相同的用户名,但实际上它的followers_count,follows_count和 ID略有不同。
  3. Instagram API 针对节点类型进行报告,InstagramUser而营销 API 针对节点类型进行报告ShadowIGUser

我相信page_backed_instagram_accounts包含为所有帐户自动生成的广告帐户,以防万一没有其他广告帐户与 Instagram 帐户关联。不过,如果看到通过 Graph API 为 Facebook 页面返回的这些字段的更明确的定义集,那将是一件好事。

于 2019-01-31T16:04:00.987 回答