Reputation: 1
I'm trying to make a Twitter bot and using this article as my guide. I have:
First screen of user authentication settings
Second screen of user authentication settings
const Twit = require( 'twit' ),
fs = require( 'fs' ),
path = require( 'path' ),
config = require( path.join( __dirname, 'config.js' ) );
const T = new Twit( config );
T.post( 'statuses/update', { status: 'Look, I am tweeting!' }, function( err, data, response ) {
console.log( data )
} );
const config = {
consumer_key: 'XXX',
consumer_secret: 'XXX',
access_token: 'XXX',
access_token_secret: 'XXX'
}
module.exports = config;
Finally, I ran my code with node server.js
What I got in response was the following error (and nothing was posted to my Twitter account):
{
errors: [
{
message: 'You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve',
code: 453
}
]
}
My understanding was that I do not need Elevated access to create a Bot like this. Am I wrong about that? Could it be something with my User authentication settings? Do I somehow need to include a Client ID?
Any advice is much appreciated!
Upvotes: 0
Views: 3024
Reputation: 25
Twit uses api v1.1. Currently you have Essential Access which only gives you access to api v2. You can either apply for Elevated Access to use v1.1 or use another npm package for v2 like this one- https://www.npmjs.com/package/twitter-api-v2
Upvotes: 0