"Forbidden" error when trying to unfollow some user #196
Answered
by
alkihis
loicdescotte
asked this question in
Q&A
-
Hi, I am trying to write scripts to cleanup a twitter timeline, in my first tests I have issues to use the API to unfollow a user : const {TwitterApi} = require('twitter-api-v2');
const client = new TwitterApi({
appKey: 'xxx',
appSecret: 'xxx',
accessToken: 'xxx',
accessSecret: 'xxx'
});
const idToUnfollow = 'xxx'
client.v2.me().then((me) => {
//this is working :
console.log("me", me)
//but not this :
client.v2.unfollow(me.data.id, idToUnfollow)
.catch((error) => console.log(error)) // <- error here
}
) I'm using some real values instead of 'xxx' instead of course :)
Did I miss something? |
Beta Was this translation helpful? Give feedback.
Answered by
alkihis
Feb 21, 2022
Replies: 1 comment 2 replies
-
Check your token rights. It must has been generated with Read+Write permissions minimum. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
loicdescotte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check your token rights. It must has been generated with Read+Write permissions minimum.