desmondmorris / node-twitter

Client library for the Twitter REST and Streaming API's.
https://www.npmjs.com/package/twitter
MIT License
1.27k stars 237 forks source link

[ { code: 32, message: 'Could not authenticate you.' } ] #311

Closed Vladinho10 closed 5 years ago

Vladinho10 commented 5 years ago

const client = new Twitter({ consumer_key: consumerKey, consumer_secret: secretKey, access_token_key: accessToken, access_token_secret }); // var params = { include_email: true, // default_profile_image: true };

    client
        .get('account/verify_credentials', params)
        .then(r => console.log(r))
        .catch(err => console.err(err));

Why it gives error?

JonathanLoscalzo commented 5 years ago

did you solve it? The same to me, I thought that was an space on a key, but I write it by hand and it is the same.

I activated twitter-envs and select my app, but I couldn't found another possible mistake.

dandv commented 5 years ago

Was there a ! character anywhere in the payload? We've fixed that problem recently in twitter-lite and now any DM can be sent.

MarcGodard commented 5 years ago

Same issue here

ibrokemycomputer commented 5 years ago

I switched to https://www.npmjs.com/package/twit and it worked like a charm. The switch took about 45 seconds lol. Probably a header issue but ¯_(ツ)_/¯

MarcGodard commented 5 years ago

I also switched... This repo is dead.

Vladinho10 commented 5 years ago

I solved this issue

const client = new Twitter({ consumer_key: consumerKey, (static value, from your Twitter app) consumer_secret: secretKey, (static value, from your Twitter app) access_token_key: accessToken, (dynamic value, from each user) access_token_secret: accessTokenSecret (dynamic value, from each user) }); const data = await client.get('https://api.twitter.com/1.1/account/verify_credentials.json', { include_email: true, skip_status: true });

thank you all !