Post to Instagram via Facebook Graph API - unable to get the correct ig-user-id permission

1.1k views Asked by At

I need to create a Meta application that posts scheduled content on the Instagram page of the company. The app is now in dev mode, and used through the Graph API and cURL.

After getting an Instagram user token on the Graph Explorer with all the required permissions (email, pages_show_list, ads_management, business_management, instagram_basic, instagram_content_publish, publish_to_groups, pages_read_engagement, pages_manage_posts, public_profile) and getting the ig-user-id through the GET /v13.0/me?fields=id,name API call, i make the container generation call, as described in the docs:

curl -i -X POST https://graph.facebook.com/{{ig-user-id}}/media?
image_url=https://{{image-url}}&caption={{text}}&access_token={{token}}

To which I get as a response:

Unsupported post request. Object with ID '{{ig-user-id}}' does not exist, cannot be 
loaded due to missing permissions, or does not support this operation.

I tried to generate a Page token in spite of an User token, to use the Page ID in spite of the Used scoped app ID provided by the Graph API but the result has always been the same. One thing I noticed is, trying to get the IG user ID as described on the getting started page, point 5, to my request:

curl -i -X GET "https://graph.facebook.com/v13.0/{{page-id}}?
fields=instagram_business_account&access_token={{token}}"

The response is just {"id":"{{page-id}}"} in spite of the expected

{
  "instagram_business_account": {
    "id": "17841405822304914"  // Connected IG User ID
  },
  "id": "134895793791914"  // Facebook Page ID
}

So it appears it might be a permissions issue. Now, on the Business Settings for the business the app is related:

  • I'm listed under Users -> People as Administrator and Developer
  • I'm listed under Account -> Instagram Account -> People with all the permissions (Content, Community Activity, etc.) granted but messages (Impossible to assign - Available only on Instagram)
  • I'm listed onder Account -> Apps -> {{App Name}} -> People twice with all permissions granted.

Could anyone help me solve the issue? Thanks in advance.

0

There are 0 answers