Facebook (Instagram) Graph API 不返回 instagram_business_account

Eli*_*ior 5 facebook-graph-api instagram facebook-opengraph instagram-api instagram-graph-api

首先,我先解释一下今天的情况:

  • 我有一个具有以下权限的访问令牌:email, public_profile, pages_show_list, pages_read_engagement, instagram_basic,instagram_manage_insights
  • 我有一个有效的访问令牌
  • 我尝试访问的帐户是企业帐户或内容创建者帐户

考虑到这一点,这就是我的问题:连接到我的平台的一些用户instagram_business_account在我请求时根本不返回/me/accounts.

我的要求是https://graph.facebook.com/v10.0/me/accounts使用字段id,name,instagram_business_account{id,biography,ig_id,followers_count,follows_count,media_count,name,profile_picture_url,username,website}

这是一个示例结果,其中两者都应返回instagram_business_account,因为两者都作为企业帐户连接到 Facebook:

{
    "data": [
        {
            "id": "xxxx",
            "name": "xxxxx"
        },
        {
            "id": "xxxxx",
            "name": "xxxx",
            "instagram_business_account": {
                "id": "xxxx",
                "biography": "xxxx",
                "ig_id": 00000,
                "followers_count": 0000,
                "follows_count": 0000,
                "media_count": 0000,
                "name": "xxx",
                "profile_picture_url": "xxxx",
                "username": "xxxx"
            }
        }
    ],
    "paging": {
        "cursors": {
            "before": "xxxx",
            "after": "xxxx"
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

有人知道这里发生了什么问题吗?

Eli*_*ior 7

我解决了这个问题。这是 Facebook 的问题,我们无能为力。Instagram 通过 instagram_business_account 连接到 Facebook。如果该值不存在,则说明该账户未正确连接。用户应该重新连接该页面https://www.facebook.com/{id}/settings/?tab=instagram_management

id值是查询结果中的值。第二种选择是转到 Instagram,转到个人资料,单击“编辑个人资料”,然后在“页面”中再次连接到 Facebook。

这样您就能够得到正确的结果。