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

172
Vistas
how do i get the discord role data from a guild using an API call

i have this code in JS however it always returns a 403 error when i run it in my website. I have tried to run the same request with python and in postman and it gave me the data i wanted so the API is definitly not the problem. it also gave me a CORS error which i resolved by getting a chrome extension but i am not sure if that is the problem

const url="https://discord.com/api/v9/guilds/792895591255769098/members/search"

function callAPI() {
  var xhttp = new XMLHttpRequest();
  xhttp.open('GET', url);
  xhttp.setRequestHeader('Authorization', 'Bot <my bots token>');
  xhttp.send();
  console.log("sent request")
  console.log(xhttp)
}
callAPI.call() 

I also tried this code too but it returns the same result

async function getGuildRoles(){
  const response = await fetch('https://discord.com/api/guilds/792895591255769098/members',{
    method:'GET',
    headers: {
      Authorization: 'Bot <my bots token>'

    }
  });
  console.log(response.text());
  return response;
}
getGuildRoles.call()
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