Menu

#297 Error when invocate -> sendDirectMessage

open
nobody
None
2018-10-04
2018-09-19
Anonymous
No

Originally created by: edufuentes

Greetings friend, I'm testing the library version 4.0.7 but I'm giving error when I send a direct message, this version is compatible with the changes made and published here:

"Direct Message migration guide
On September 17th, 2018 we retired the legacy Direct Message endpoints. If you had been using those endpoints, please make sure to migrate over to the new Direct Message endpoints or the Activity API. "

https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/guides/direct-message-migration.html

When I try the "sendDirectMessage" method it gives me this error: status: 404 Not Found
[2018-09-19 16:30:21,978][DEBUG][http-nio-8443-exec-866][][twitter4j.HttpResponseImpl:52] - {"errors":[{"code":50,"message":"User not found."}]}

[2018-09-19 16:30:21,980][ERROR][http-nio-8443-exec-866][][com.chattigo.channel.twitter.ws.OutBoundMessages:174] - Error recibiendo mensaje
404:The URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the requested format is not supported by the requested method.
message - User not found.
code - 50

Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=b7066a94 or
http://www.google.co.jp/search?q=5be986e5
TwitterException{exceptionCode=[b7066a94-5be986e5], statusCode=404, message=User not found., code=50, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=899, limit=900, resetTimeInSeconds=1537386321, secondsUntilReset=899}, version=4.0.7}
at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:170)
at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
at twitter4j.HttpClientBase.get(HttpClientBase.java:75)
at twitter4j.TwitterImpl.get(TwitterImpl.java:2084)
at twitter4j.TwitterImpl.showUser(TwitterImpl.java:1109)
at twitter4j.TwitterImpl.sendDirectMessage(TwitterImpl.java:616)
at com.chattigo.channel.twitter.ws.OutBoundMessages.doPost(OutBoundMessages.java:132)

Could you help me please, how do I invoke the sendDirectMessage method correctly :(

Discussion

  • Anonymous

    Anonymous - 2018-09-25

    Originally posted by: theclive

    Hi Guys,

    I am also having an issue with using 4.0.7 that is supposed to use the new DM Endpoints. I get a different error though:

    java.lang.NullPointerException
    at java.lang.String.compareTo(String.java:1139)
    at twitter4j.HttpParameter.compareTo(HttpParameter.java:244)
    at twitter4j.HttpParameter.compareTo(HttpParameter.java:32)
    at java.util.Arrays.mergeSort(Arrays.java:573)
    at java.util.Arrays.mergeSort(Arrays.java:586)
    at java.util.Arrays.legacyMergeSort(Arrays.java:478)
    at java.util.Arrays.sort(Arrays.java:470)
    at java.util.Collections.sort(Collections.java:155)
    at twitter4j.auth.OAuthAuthorization.normalizeRequestParameters(OAuthAuthorization.java:357)
    at twitter4j.auth.OAuthAuthorization.generateAuthorizationHeader(OAuthAuthorization.java:206)
    at twitter4j.auth.OAuthAuthorization.generateAuthorizationHeader(OAuthAuthorization.java:257)
    at twitter4j.auth.OAuthAuthorization.getAuthorizationHeader(OAuthAuthorization.java:66)
    at twitter4j.HttpClientImpl.setHeaders(HttpClientImpl.java:214)
    at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:91)
    at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
    at twitter4j.HttpClientBase.post(HttpClientBase.java:86)
    at twitter4j.TwitterImpl.post(TwitterImpl.java:2138)
    at twitter4j.TwitterImpl.sendDirectMessage(TwitterImpl.java:577)
    at twitter4j.TwitterImpl.sendDirectMessage(TwitterImpl.java:611)
    at twitter4j.TwitterImpl.sendDirectMessage(TwitterImpl.java:616)

    Please let me know what else you need to debug?

    Regards,
    Clive

     
  • Anonymous

    Anonymous - 2018-09-27

    Originally posted by: sms0070

    Hello,

    Is there any update on this?
    I am also getting the same error as reported by edufuentes.

    Please let me know if you need anything to debug the issue.

    Regards,
    Suyash

     
  • Anonymous

    Anonymous - 2018-10-04

    Originally posted by: cdupont

    I got the same issue.

     

Log in to post a comment.