Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when invocate -> sendDirectMessage #297

Open
edufuentes opened this issue Sep 19, 2018 · 4 comments
Open

Error when invocate -> sendDirectMessage #297

edufuentes opened this issue Sep 19, 2018 · 4 comments

Comments

@edufuentes
Copy link

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 :(

@theclive
Copy link

theclive commented Sep 25, 2018

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

@sms0070
Copy link

sms0070 commented Sep 27, 2018

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

@cdupont
Copy link

cdupont commented Oct 4, 2018

I got the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@cdupont @edufuentes @sms0070 @theclive and others