Posts tagged with access-token

i got the access token but while exhangeing it for long live token api getting following error

error: { message: 'Unsupported request - method type: get', type: 'IGApiException', code: 100, fbtrace_id: 'AnMYrIXYSTKYCA_Sh2qKxkU' }

const accessTokenApi = {             url: 'https://api.instagram.com/oauth/access_token',             method: 'post',             headers: {                 'Content-Type': 'application/x-www-form-urlencoded'             },             body: new URLSearchParams({                 code: code,                 redirect_uri: instagramConfig.callbackUrl,                 client_id: instagramConfig.clientId,                 client_secret: instagramConfig.clientSecret,                 grant_type: 'authorization_code',             }).toString(),         };         const tokenResponse = await this.apiCall(accessTokenApi); const userPlatform = await this.userPlatformService.getUserPlatfromsByCode(userId, "INSTAGRAM");         const userLongLiveTokenApi = {             url:`https://graph.instagram.com/access_token?grant_type=ig_exchange_token&client_secret=${instagramConfig.clientSecret}&access_token=${userPlatform.authToken}`,             method: 'get',             headers:{}         }         console.log(userLongLiveTokenApi)         const userLongLiveTokenResponse = await this.apiCall(userLongLiveTokenApi); 

I have a Facebook app running in production, and I've created a system user within Facebook Business Manager. After generating a system user access token, I have also generated a user access token for the system user. However, the API response only returns the page ID and not the page access token. What steps should I take to ensure that the system user has the necessary permissions, and how can I retrieve the page access token successfully?

I generated a system user access token and used it to call the Facebook Graph API to retrieve the page access token. I expected the API to return the page access token, but instead, it only returned the page ID. I was expecting the access_token field in the response but did not receive it.

Here is the CURL used to fetch the page access token :

curl -X GET "https://graph.facebook.com/v19.0/{page_id}?fields=access_token&access_token={user_access_token_or_system_user_access_token}"

I'm trying to use the Graph API to fetch data from other people and pages, but it only fetches my data and the pages I'm an admin of. Is it possible to do this, or has Facebook implemented restrictions ?

I’ve tested different API requests with various permissions and tokens, but the result is the same—I can only access my data and data from pages I manage. I've watched several YouTube videos that demonstrate using the Graph API to fetch data from different sources, but many of these tutorials are a bit outdated. They suggest methods that no longer seem to work.

  1. I have created the app.
  2. I used the short-lived user access token to get a long-lived user access token.
  3. Then I tried to exchange the long-lived user access token for a long-lived page access token.
  4. This is the response I am getting:
    {      "error": {         "message": "(#15) This method must be called with an app access_token.",         "type": "OAuthException",         "code": 15,         "fbtrace_id": "AaKKgfwJzZsNDXADht1N7wy"      }     } 
  1. This is the endpoint for the API call to receive a long-lived page access token:
https://graph.facebook.com/v19.0/{app-id}/accounts?access_token={long-lived-user-access-token} 
  1. The endpoint for long-lived user access token:
https://graph.facebook.com/v19.0/oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-user-access-token} 
  1. According to this documentation, I need to exchange a long-lived user access token in order to get a long-lived pages access token: Facebook Developer Documentation

My project is to post on Facebook using open ai generated content and I created a developers account along with a new Facebook account I need page access token and permissions but the only permissions allowed to me are email, public and payment permissions and I can't get access to page access token and I don't know how to set api endpoint here for redirect url.

I tried making the model that generates the caption but I can't put it here it shows error of not having the valid token