Posts tagged with instagram-graph-api

I've encountered a problem with my application in Live mode. I've conducted several tests with various Facebook pages and Instagram accounts, always following the same process, but I'm getting inconsistent permissions.

I use facebook api v20.

Problem Details

  • In most cases, I successfully obtain all the required permissions.
  • In some instances, I can't get the pages_show_list permission.
  • The error occurs only with certain accounts, but I can't identify what distinguishes these accounts from the others.

Current Implementation

I'm requesting the following permissions:

  • instagram_basic
  • instagram_manage_insights
  • business_management
  • pages_show_list
  • pages_read_engagement

All permissions are successfully approved by facebook.

I use the following URL for authentication:

const url = `https://www.facebook.com/dialog/oauth?client_id=${CONFIG.FACEBOOK_APP_ID}&extras={"setup":{"channel":"IG_API_ONBOARDING"}}&redirect_uri=${CONFIG.BACKOFFICE_URL}/instagram&response_type=token&scope=instagram_basic,instagram_manage_insights,business_management,pages_show_list,pages_read_engagement` 

Encountered Error

When testing the user-generated accessToken in the Facebook API Graph Tester, I receive the following error, but only for some accounts:

"The "accounts" field is only accessible on the User object after the user has granted one of the following permissions: 'pages_show_list'." 

Questions

  1. How is it possible that this inconsistency in permissions occurs?
  2. Could it depend on some specific configuration of the Facebook page in question?
  3. What might be distinguishing the accounts that encounter this error from those that don't?
  4. Are there alternative solutions or approaches to ensure consistent obtaining of all required permissions?

Any help or suggestions to understand and resolve this issue would be greatly appreciated. Thank you in advance for your support.

When creating a Consumer app with the Facebook Login product added (not Facebook Login for Business) you get a simple, single-step dialog to login. You just press "Continue as..." and it's done.

However, you are limited to only two scopes: public_profile and email. The only way I can get additional scopes is to create a Business app and add the Facebook Login for Business product. After doing this the login dialog is completely different. It's a much more complex, multi-step dialog that requires you to choose which businesses to opt-in and other things that need to be configured/confirmed.

It would seem that requesting permissions other than public_profile,email requires a Business app with Facebook Login for Business and the more complex login dialog, but there's a service we use called Flockler that lets you connect your Facebook/Instagram account and this is their Facebook dialog:

Their app uses the Consumer login dialog, but requires all these permissions: pages_read_user_content,pages_read_engagement,pages_manage_metadata,read_insights,business_management,instagram_basic,instagram_manage_comments,instagram_manage_insights

My question is, how can they have the simple Consumer login dialog while requiring all these additional permissions, when the only two permissions available in a Consumer app are public_profile and email?

I am creating a web app which uses Facebook graph apis to allow users connect their Facebook and Instagram account to my app so we could automate content posting on their behalf. I have successfully implementend for Facebook but the problem is now with Instagram. After I initiate the auth url I am taken to a page where I'm asked to enter my IG email and password, a popup opens and I enter those details but it doesn't get past there, it just goes back to telling me to "Get started" which is where I started from.

I have been strugling with this problem for days now and would greatly appreciate any help I could get with this.

Another guess I have: Though I doubt that is the case but could this be happening because I am yet to submit my app for review? If so, why did it work for Facebook?

What I have tried:

  1. I have added and double checked my redirect_uri both on my website and my Facebook developers App
  2. Checked if this issue persists across multiple browsers

What I expect: After entering my instagram username and password, I should be redirected to my redirect_uri with the access_token and other requested information so I can process them

API set up with Instagram Login.

Seeing the error in the attached screenshot.

  • The callback URL is a Railway.app domain

  • The verify token is a unique code that is self generated.

  • After entering these details, we should see a GET request on our server logs - I do not see anything.

And I receive an error code: The callback URL or verify token couldn't be validated. Please verify the provided information or try again later.

More information: https://developers.facebook.com/community/threads/1460022321208053/?post_id=1460022324541386

we tried this multiple times over different days, and tried different length codes with varying characters.

A few weeks ago, our app was approved with the following permissions:

instagram_business_manage_messages, instagram_manage_comments, instagram_manage_messages, instagram_business_manage_comments

and this is our login url with scopes, example -

https://www.instagram.com/oauth/authorize?third_party=re&client_id=867763&redirect_uri=oauth%2Fcallback&response_type=code&scope=business_basic%2Cbusiness_manage_messages%2Cbusiness_manage_comments%2Cbusiness_content_publish 

Our use case is as follows: when someone comments on our post with a matching keyword specified in our backend, we send a reply to that comment and simultaneously send a direct message (DM) to the user.

However, we're facing an issue where only 1 out of 100 comments successfully sends both the comment reply and DM. In other cases, the comment replies are sent consistently, but the DM fails with the error: "This message is sent outside of allowed window." This occurs 99% of the time.

Given that we have access to the Business API, we are unsure why we are facing this issue. Could you please advise?

this is the

error: {   error: {     message: 'This message is sent outside of allowed window.',     type: 'IGApiException',     code: 10,     error_subcode: 2534022,     fbtrace_id: 'ASeWzBS_LCXn'   } } 

same error code mentioned on fb docs https://developers.facebook.com/docs/messenger-platform/error-codes

We tried with different multiple accounts but same error, but when a user first sends a message to owner of insta post then again comments on post then it sending comment and dm successfully.