node-twitter-api-v2 icon indicating copy to clipboard operation
node-twitter-api-v2 copied to clipboard

[bug]

Open Magendran123 opened this issue 2 years ago • 2 comments
trafficstars

Describe the bug A clear and concise description of what the bug is.

using your package i can able to post a tweet successfully. thank you for that. but i cannot able to reply a tweet using your package.

To Reproduce Please indicate all steps that lead to this bug:

  1. Request client setup (login method, OAuth2 scopes if applicable...)

const client = new TwitterApi({ appKey: config.twitter_config.api_key, appSecret: config.twitter_config.api_secret, accessToken: config.twitter_config.access_token, accessSecret: config.twitter_config.access_secret, }); using these authentication. works for create a tweet.

** Endpoint used**

  1. Endpoint used or code example of what's happening wrong async function replyToTweet() { try {

     	let tweet =  await twitterClient.v1.reply('Look at my video!', 1657981147555717120);
     	  console.log('Reply sent successfully:', tweet.text);
     	} catch (error) {
     	  console.error('Error replying to tweet:', error.data);
     	}
       }
    

Error stack trace

  1. Error stack trace, and if possible, error content (err.toJSON() when err is the caught error; take care of removing authentication HTTP headers)

data: { title: 'Unsupported Authentication', detail: 'Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint. Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].', type: 'https://api.twitter.com/2/problems/unsupported-authentication', status: 403 }

Expected behavior A clear and concise description of what you expected to happen.

*i want to post reply in tweet

Version

  • Node.js version - 14
  • Lib version - "twitter-api-v2": "^1.14.2",
  • OS (especially if you use Windows) - windows

Additional context Add any other context about the problem here.

Screenshot (507)

Magendran123 avatar May 16 '23 08:05 Magendran123

hi @Magendran123
I am getting same error while creating tweet. found any fix ? can you share your code used for creating tweet?

sarathkmrdev avatar May 17 '23 12:05 sarathkmrdev

Applications can't create tweets, only users can.

muhitrhn avatar May 23 '23 22:05 muhitrhn