Elias Júnior
Elias Júnior

Reputation: 151

Facebook (Instagram) Graph API not returning instagram_business_account

First of all, let me explain what I have today:

With that in mind, here's my problem: some users that are connected to my platform simply don't return the instagram_business_account when I'm requesting /me/accounts.

My request is to https://graph.facebook.com/v10.0/me/accounts with the fields id,name,instagram_business_account{id,biography,ig_id,followers_count,follows_count,media_count,name,profile_picture_url,username,website}.

Here's a sample result where both should return the instagram_business_account, because both are connected to Facebook as a Business Account:

{
    "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"
        }
    }
}

Does anybody have any idea what is the problem happening here?

Upvotes: 6

Views: 4415

Answers (2)

Jared Alessandroni
Jared Alessandroni

Reputation: 177

Okay - for anyone stumbling on this page who is as stuck as I was:

The answer for SOME lies here:

https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/page

If you're like me and you created a business account just to test this and you used that page to add your newly created insta account - it will fail every time. BECAUSE

"If the token is from a User whose Page role was granted via the Business Manager, one of the following permissions is also required:"

But that's not all - turns out if you created a business Portfolio it's actually necessary to have this ONE permission: "business_management" then add that particular portfolio as a business not a page. But long short, it's very likely a permissions issue.

Upvotes: 1

Elias Júnior
Elias Júnior

Reputation: 151

I figured out the problem. This is a Facebook problem, there's nothing we can do. Instagram is connected on Facebook through instagram_business_account. If this value doesn't exist, that means the account is not connected correctly. The user should reconnect the page https://www.facebook.com/{id}/settings/?tab=instagram_management.

The id value is the one from query result. The second alternative is go to Instagram, go to the profile, click on "Edit Profile" and in "Page", just connect to Facebook again.

With that you will be able to get the correct result.

Upvotes: 8

Related Questions