Search code examples
facebookfacebook-graph-api

Facebook API: Instagram Account Is Missing


whenever creating or updating an Ad's creative, I'm getting this error:

{
    "error": {
        "message": "Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 1772103,
        "is_transient": false,
        "error_user_title": "Instagram Account Is Missing",
        "error_user_msg": "You're using Instagram as a placement. Please select an Instagram account to represent your business in your Instagram ads, or select a Facebook Page to use instead.",
        "fbtrace_id": "..."
    }
}

However, what I simply try to do is to create an Ad for a specifc Page Post and add this to an existing AdSet. To create a new creative for a given Post, I use the /adcreatives endpoint and pass the following:

POST:  https://graph.facebook.com/v3.1/act_<ActId>/adcreatives 
{
    "name": "Test",
    "object_story_id":"<PostIdWithPage>",
}

This works fine so far. But the following update of the Ad results in the error above:

POST:  https://graph.facebook.com/v3.1/<AdId>
{
    "creative": {
        "creative_id": "<CreativeId>",
    } 
}

I guess, the above error happens when I try to add a creative to the Ad that can not be used on Instagram.

But why isn't it working like in the Business Manager? There, I can simply select a Post for a newly created Ad. If this Post is not valid for Instagram, it shows a warning but it still works.

So, when I want to create a tool that can create Ads based on given Posts, how can I achieve that? How can we come around the error above?


Solution

  • The important missing part here is, that we have to specify instagram_actor_id when creating the AdCreative. The ID can be retrieved by GETting <PageId>/page_backed_instagram_accounts.