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

271
Vistas
Slack API keeps telling me channel_not_found when attempting to upload an image

Like the title describes, i can't seem to figure out how to upload a local image and have it posted as a message in slack

Currently i am able to post text messages to slack without issue using the webhook url and axios post seen here:

const res = await axios.post(url, {
    text: 'Screenshot',
    channel: channelid

}, {
    headers: {
        authorization: `Bearer ${token}`
    }
});
    

Heres the part of the script that isnt working:

try {

    const result = await client.files.upload({

        channels: channelid,
        initial_comment: "this is the image",

        file: fs.createReadStream(fileName)
    });

    console.log(result);
} catch (error) {
    console.error(error);
}

I dont understand how the channelid works in one and not the other.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Calling a method with an xoxb or xoxp token is different than posting a message with a webhook. When you create the webhook on the Slack Developer settings site, you are asked to choose a channel. The webhook will be able to post into that channel without your app being a channel member. When using the xoxb token your bot needs to be a member of the channel that's being passed in the API call. If it's not a member you can expect a channel_not_found or not_in_channel error.

about 4 years ago · Juan Pablo Isaza Denunciar
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