【问题标题】:What is the difference between various Facebook API Page "instagram" fields各种 Facebook API 页面“instagram”字段之间有什么区别
【发布时间】:2019-03-31 18:57:41
【问题描述】:

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

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

【问题讨论】:

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


    【解决方案1】:

    我想我对这个问题的大部分都有答案......

    如果我查询某个 Facebook 主页,它会返回所有四个 Instagram 字段的值:page_backed_instagram_accountsinstagram_business_accountinstagram_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_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 是(Marketing API)广告帐户,需要通过 [Marketing 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 页面返回的这些字段的一组更明确的定义,那将是一件好事。

    【讨论】:

      猜你喜欢
      • 2015-03-25
      • 2012-01-13
      • 1970-01-01
      • 1970-01-01
      • 2021-07-24
      • 2011-05-24
      • 1970-01-01
      • 1970-01-01
      • 2020-06-08
      相关资源
      最近更新 更多