Posts tagged with instagram-graph-api

am working with the Instagram Graph API to retrieve Instagram followers count for accounts linked to Facebook Pages. I am using the following scopes: instagram_basic and pages_show_list.

While the API works for some Facebook accounts and returns the Instagram followers count correctly, it does not work for other accounts, even though those accounts have Instagram Business or Creator accounts linked to their Facebook Pages.

Here’s an outline of my setup:

I use the endpoint GET /{page_id}?fields=instagram_business_account to fetch the Instagram Business Account ID. Once I have the Instagram Business Account ID, I query GET /{instagram_account_id}?fields=followers_count to get the followers count. For some Facebook Pages, the instagram_business_account field is returned as null, even though the Instagram accounts are properly linked to the Facebook Pages.

I have ensured:

The access token has the required permissions (instagram_basic, pages_show_list). The user token is generated correctly, and the app is authorized for all required permissions. The Instagram accounts in question are Business or Creator accounts and linked correctly to the Facebook Pages.

Has anyone faced a similar issue? Are there additional permissions or configurations needed to consistently fetch the Instagram Business Account ID and followers count?

Any guidance or insights would be appreciated!

Thank you.

I'm facing an issue with the Instagram Graph API where the ID in the webhook data doesn't match the ID returned from the /me endpoint.

I use the /me endpoint to get the Instagram Business ID:

https://graph.instagram.com/me?fields=id,username

This returns 12345 and my username.

When an Instagram user sends a message, the webhook data contains a different recipient ID (67890), which doesn't match the stored ID (12345).

Example Webhook:

{   "object": "instagram",   "entry": [     {       "time": 67890,       "id": "12345400796128930",       "messaging": [         {           "sender": { "id": "981149143905198" },           "recipient": { "id": "67890" },           "timestamp": 1735516966810,           "message": {             "mid": "1bfkwjeb1jk43b1jk43bkj",             "text": "hello hello"           }         }       ]     }   ] } 

The recipient ID (67890) corresponds to the user who authorized my app but is not the same as the ID from the /me endpoint.

Is Instagram sending an ID that can't be looked up via the access token? This ID (67890) is persistent across multiple webhook requests.

I have a Facebook app with business verification completed. My app is a consumer app and has standard access to oEmbed read. My goal is to use the oEmbed Read feature. However, when I test its endpoints using the Graph API Explorer or Postman, I receive the following error:

(#10) To use 'oEmbed Read', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'oEmbed Read' feature for review, please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.

I used app id | client id as access token. Exp: 12346|879565654

I can't request advanced access of oEmbed Read because the button is disabled. For enable it I need to use the api and get 200, but it gets the error I provided above. I'm stuck because of this. Is someone know what should I do and give me steps? Or is this just a Facebook bug?

I tried sending request with Postman, with SDK and with Graph API explorer while app is in live mode and dev mode, but I still get the error provided above.

I am sending a GET request to retrieve an overview of my user conversations, following this documentation.

curl -i -X GET "https://graph.instagram.com/v21.0/$APP_SCOPED_USER_ID/conversations?platform=instagram&access_token=$LONG_ACCESS_TOKEN"                                                                     

Using the Acces Token debugger I have verified that my long-acccess token has the appropriate permissions:

instagram_business_basic, instagram_business_manage_messages, instagram_business_content_publish, instagram_business_manage_comments 

It returns an empty list, even though I have conversations on the Instagram account:

 {"data":[]} 

It return reponse status 200, so I think the request is OK but I don't understand why the list of converstations is empty.

Complete output:

HTTP/2 200  etag: "1050253aec7b29caff644806927dabfa81406eee" content-type: application/json; charset=UTF-8 vary: Origin vary: Accept-Encoding cross-origin-resource-policy: cross-origin x-app-usage: {"call_volume":0,"cpu_time":0} instagram-api-version: v21.0 access-control-allow-origin: * strict-transport-security: max-age=31536000; preload; includeSubDomains pragma: no-cache cache-control: private, no-cache, no-store, must-revalidate expires: Sat, 01 Jan 2000 00:00:00 GMT x-fb-request-id: AJDy8jjnwzoXsbaD81SmtVR x-fb-trace-id: HY/Hc9Ie7Gw x-fb-rev: 1018763301 x-stack: www x-fb-debug: mX0wWU1Pk1etujdU1lsm1/gKHjgAlzKPS2B3sLbBjFtu8xUO0z6NOVizj5u+27ULdvNP5NvardPAZMvOULGr5g== content-length: 11 date: Tue, 10 Dec 2024 19:35:31 GMT x-fb-connection-quality: EXCELLENT; q=0.9, rtt=28, rtx=0, c=16, mss=1380, tbw=3420, tp=-1, tpl=-1, uplat=1367, ullat=0 alt-svc: h3=":443"; ma=86400 {"data":[]}g 

During development, the private reply API (https://graph.facebook.com/PAGE-ID/messages) was working correctly. However, after my app's review was rejected, the API started failing.

The error I encounter is:

"An unknown error has occurred."

Is it possible for an API to stop functioning after an app review rejection?

Investigated Details:
The token's validity has been confirmed as fine via the developer tools. The COMMENT-ID was obtained from the Webhook, so it should be correct. The PAGE-ID works with other APIs, so it also appears to be correct.