Attempt to send a DM, get 151 Error Code but DM is still sent


#1

Occasionally when calling the POST direct_messages/new endpoint I get the following error:

Twitter Error: 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
message - There was an error sending your message: Whoops! You already said that.
code - 151

The problem is it seems the DM actually seems to goes through. The published date of the DM is the exact same as when the application made the call. Then the user retries a couple of minutes later because the application reported an error the 1st time and the DM gets sent a 2nd time.


#2

Has no one else seen this behavior? I have combed through our logs, I am pretty sure we are not publishing the DM twice.


#3

We are getting the same error for sending DM.
Even though the message is getting sent the error message come with the 151 error code as same as mentioned above.

We have checked our side.
Here is the code snippet that we are using to send DM.

    try {
       DirectMessage message = twitter.sendDirectMessage(ScreenName Of User, Message Text);
        return "success";
    } catch (Exception e) {
        e.printStackTrace();
        return "Failed";
    }

Any Solution for this?


#5

Any Update regarding this Issue?
Still facing the same error :disappointed_relieved:


#6

We’re still working on this behind the scenes - nothing to report at the moment I’m afraid.


#7

Hello Is there any outcome for this issue… so that we can think of implement it future… :fearful:


#8

We know how to resolve, but there are some additional things in progress around DMs at the moment. Sorry that it has taken so long, sometimes these things get caught up in other work! There’s no change at the moment, though.


#9

Quick update - still looking into this intermittent issue but no change as yet. This is actively been worked on, but got shuffled around in our priority list.


#10

This issue has been resolved.


#11