You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "SUYASH MANI SHARMA (JIRA)" <ji...@apache.org> on 2018/09/27 06:48:00 UTC
[jira] [Created] (CAMEL-12838) Camel Twitter Send Direct Message
Endpoint not working
SUYASH MANI SHARMA created CAMEL-12838:
------------------------------------------
Summary: Camel Twitter Send Direct Message Endpoint not working
Key: CAMEL-12838
URL: https://issues.apache.org/jira/browse/CAMEL-12838
Project: Camel
Issue Type: Bug
Components: camel-twitter
Affects Versions: 2.22.1
Reporter: SUYASH MANI SHARMA
Fix For: 2.21.3
There has been a change in twitter APIs. On September 17^th^, twitter discontinued the legacy direct message endpoints.
[https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/guides/direct-message-migration.html]
There are three sendDirectMessage methods provided by twitter4j API.
[http://twitter4j.org/oldjavadocs/4.0.7/twitter4j/api/DirectMessagesResources.html#sendDirectMessage(long,%20java.lang.String,%20long)]
|[*DirectMessage*|http://twitter4j.org/javadoc/twitter4j/DirectMessage.html]|*[sendDirectMessage|http://twitter4j.org/javadoc/twitter4j/api/DirectMessagesResources.html#sendDirectMessage-long-java.lang.String-]*(long userId, java.lang.String text)
Sends a new direct message to the specified user from the authenticating user.|
|[*DirectMessage*|http://twitter4j.org/javadoc/twitter4j/DirectMessage.html]|*[sendDirectMessage|http://twitter4j.org/javadoc/twitter4j/api/DirectMessagesResources.html#sendDirectMessage-long-java.lang.String-long-]*(long userId, java.lang.String text, long mediaId)
Sends a new direct message to the specified user from the authenticating user.|
|[*DirectMessage*|http://twitter4j.org/javadoc/twitter4j/DirectMessage.html]|*[sendDirectMessage|http://twitter4j.org/javadoc/twitter4j/api/DirectMessagesResources.html#sendDirectMessage-java.lang.String-java.lang.String-]*(java.lang.String screenName, java.lang.String text)
Sends a new direct message to the specified user from the authenticating user.|
The first two methods use the new endpoints([direct_messages/events/new|https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event]), while the third one uses the old APIs([direct_messages/new|https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-message])
Camel twitter component uses the third method to send direct message (using screen name).
[https://github.com/apache/camel/blob/master/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/directmessage/DirectMessageProducer.java]
This needs to be changed in order to support direct message sending to twitter
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)