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

185
Vistas
Twitter api statuses/update throws an error of authorization

I am building a bot on twitter with javascript to send a post from my own twitter account. But I am getting the following error:

{
  code: 220,
  message: 'Your credentials do not allow access to this resource.'
}

I am not using OAuth since I will be the only user of this bot, I just want to send a twitter post inside a certain listener that watches for some event. Here is the inside of my function to send a post on twitter:

const Twitter = require('twitter')

const client = new Twitter({
  consumer_key: process.env.TWITTER_CONSUMER_KEY,
  consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
  access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
  access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
  bearer_token: process.env.TWITTER_BEARER_TOKEN
})

async function sendTwitterPost() {
  try {
    const response = await client.post('statuses/update', { 
      status: 'Event occured!',
    })
    console.log(response)
    console.log("Success")
  }
  catch(err){
    console.log(err)
    console.log("ERROR WHILE SENDING TWITTER POST!")
  }
  
}
    
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