我想我对这个问题的大部分都有答案......
如果我查询某个 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)"
正如您在第二个示例中看到的,营销 API 可以访问 page_backed_instagram_accounts 和 instagram_accounts,但不能访问 instagram_business_account 和 connected_instagram_account。
所以,据我所知,page_backed_instagram_accounts 和 instagram_accounts 是(Marketing API)广告帐户,需要通过 [Marketing API][3 ].
还有几点需要注意:
-
page_backed_instagram_accounts 中的帐户似乎有一个自动生成的用户名,未发布 (
is_published=false)。
- 虽然 instagram_accounts 中的帐户与 instagram_business_account 和 connected_instagram_account 中的帐户具有相同的用户名,但实际上
followers_count 略有不同, follows_count,以及不同的 ID。
- Instagram API 报告节点类型
InstagramUser,而营销 API 报告节点类型 ShadowIGUser。
我相信 page_backed_instagram_accounts 包含为所有帐户自动生成的广告帐户,以防万一没有其他广告帐户与 Instagram 帐户相关联。不过,如果看到通过 Graph API 为 Facebook 页面返回的这些字段的一组更明确的定义,那将是一件好事。