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

"Could not authenticate you." Direct Message Twitter

Open DDeploy opened this issue 6 years ago • 5 comments

Hi, i'm trying to send direct message and i have this error : {"code":32,"message":"Could not authenticate you."}

here it is my code :

 client.post('direct_messages/events/new', {
    type: 'message_create',
    message_create: {
        target: {
	    recipient_id: "4...",
            message_data: {
                text: "hi"
            }
        }
    }
}) 

I have surely activated the access level for enabling Direct Messages but still ....

DDeploy avatar Nov 28 '18 23:11 DDeploy

Was there a ! character anywhere in the payload? We fixed that problem in twitter-lite and now DMs can send any characters.

dandv avatar Dec 18 '18 20:12 dandv

Same problem. but your message_data should be moved up a level, same level as target.

MarcGodard avatar Feb 08 '19 00:02 MarcGodard

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 ¯_(ツ)_/¯

ibrokemycomputer avatar Mar 07 '19 19:03 ibrokemycomputer

I also switched. I think this repo is dead.

MarcGodard avatar Mar 12 '19 20:03 MarcGodard

Repo is dead, thanks.

icodeforlove avatar Feb 24 '20 17:02 icodeforlove