How to fix error 32 "Could not authenticate you." for POST Direct Message?


Hello, since yesterday i have a problem with the direct message post. I’m using oAuth and based user with Node.Js. so i use :
consumer_key: '...', consumer_secret: '...', access_token_key: '...', access_token_secret: '...' })

and surely after checking all my keys access are, this is well written and filled

i have also activated

Read, write, and direct messages

but still, it’s not working. :confused:

EDIT : i forgot; this is my code for the direct messages'direct_messages/events/new', {
    type: 'message_create',
    message_create: {
        target: {
            recipient_id: "...",
            message_data: {
                text: "Hi"


What is the error message you’re getting, @DDeployer?



by adding in my code :

.catch(ex => console.log(`[ERROR] ${JSON.stringify(ex)}`))

i got this error message :

[ERROR] [{"code":32,"message":"Could not authenticate you."}]


Also, i have tried with Postman (with copywriting all keys) and still, it’s getting an error :

    "errors": [
            "code": 32,
            "message": "Could not authenticate you."

With this new code :"direct_messages/events/new", {"type": "message_create", "message_create": {"target": {"recipient_id": ("4484068887"), "message_create": {"message_data": ("plop")}


Error 32 has to do with your authentication. My guess here is that you are either not using the proper consumer keys and access tokens, or you are not generating oauth nonce, oauth_signature, and oauth_timestamp properly.

Have you tried with twurl or Insomnia?


Sorry for the long wait, i will try to use twurl and insomnia now.
for info, i didn’t use kind like oauth nonce , oauth_signature , and oauth_timestamp on my js script


That is probably what was triggering that error.

To learn more, please read our docs on generating a request.

I suggest that you use twurl, Insomnia, or a library like TwitterOAuth to generate your request.

closed #8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.