Can't unfollow users! [bug]
See original GitHub issueDescribe the bug Hi, so I only want to unfollow users on my own twitter account but I keep getting a 403 forbidden.
ApiResponseError: Request failed with code 403
at RequestHandlerHelper.createResponseError (C:\Hannes\twitter-api\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:99:16)
at RequestHandlerHelper.onResponseEndHandler (C:\Hannes\twitter-api\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:227:25)
at IncomingMessage.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
error: true,
type: 'response',
code: 403,
headers: {
'content-type': 'application/problem+json',
'cache-control': 'no-cache, no-store, max-age=0',
'content-length': '316',
'x-response-time': '101',
'x-connection-hash': 'a3eedc4c11b8f6d5c8661336dfa45293f672ce7472794733705fce4c8e3dd1af',
date: 'Wed, 02 Mar 2022 19:20:24 GMT',
server: 'tsa_f',
via: '1.1 google',
'alt-svc': 'clear',
connection: 'close'
},
rateLimit: undefined,
data: '{\n' +
' "title": "Unsupported Authentication",\n' +
' "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].",\n' +
' "type": "https://api.twitter.com/2/problems/unsupported-authentication",\n' +
' "status": 403\n' +
'}'
}
To Reproduce
const twitterClient = new TwitterApi({
appKey: process.env.TWITTER_API_KEY,
appSecret: process.env.TWITTER_API_SECRET,
accessToken: process.env.TWITTER_ACCESS_TOKEN,
accessSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
});
const user = await (await twitterClient.currentUserV2()).data;
console.log(user); //I'm logged in and everything
let result = await twitterClient.v2
.unfollow(user.id, "737251813")
.catch((err) => {
console.log(err);
}); //Getting 403
Expected behavior Unfollow the user on my account
Version
- Node.js version 14
- Lib version 1.11.0
- OS windows
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
How To Fix “Mass Unfollow” Limitation On Follower+ Track for IG
What happens when you unfollow too fast? ... Instagram is rigid in many cases, especially when it believes an account is spamming/using bots....
Read more >Can't Unfollow People on Instagram? Here's The Fix - Vergizmo
You can not unfollow someone for several reasons: you hit your limit or you have unfollowed and followed too many accounts too quickly....
Read more >Why can't I unfollow some accounts on Instagram? - Quora
If it isn't the case that you're unfollowing too many people at once, then it is likely a bug or a connection issue....
Read more >Twitter Bug: Users can't follow, unfollow, block anyone
Multiple Twitter users reported a problem on Thursday that they can't block, follow, unfollow, block or mute anyone.
Read more >InstaPy error, can't follow or unfollow users - Stack Overflow
A fix can be found in the following link.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, Probably because I forgot to enable auth 2 in the developer portal lol
@Hannes1 what was the issue?