Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!