Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

281
Vistas
Error: "You must provide an app access token, or a user access token that is an owner or developer of the app" using Facebook Login SDK

I have the problem that users can use our system to request reports of their ads on facebook.

These are the functions I use in the frontend (React):

export function initFacebookSdk() {
  return new Promise(resolve => {
    // wait for facebook sdk to initialize before starting the react app
    window.fbAsyncInit = function () {
      window.FB.init({
        appId: 'app-id',
        cookie: true,
        xfbml: true,
        version: 'v14.0'
      });
      resolve()
    };   
  });
}

export const FbLogin = () => {
  loadFacebookSDK(document, "script", "facebook-jssdk")
  initFacebookSdk()
  return new Promise( resolve => {
    window.FB.login(response => {
      if (response.authResponse) {
        resolve(response);
      } else {
        resolve(response);
      }
    }, {scope: 'ads_management,ads_read'});
  })
}

And so I call the function

const response = await FbLogin();

I send the token to the backend and this is how it uses the route:

try {
  const { data: accountsInfo } = await axios({
    url: `https://graph.facebook.com/v${FB_GRAPH_API_VERSION}/me/adaccounts?access_token=${accessToken}&pretty=1&limit=100`,
    method: 'GET',
  });
  

  res.status(200).json({success: true, accountsInfo})
  
} catch (err) {
  console.log(err);

  res.status(500).json({success: false})
}

And this is the error that I get when trying to use the user token:

'OAuth "Facebook Platform" "invalid_request" "(#100) You must provide an app access token, or a user access token that is an owner or developer of the app"'

Does anyone know why this is happening to me? help :(

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda