twitter4j.api
Interface DirectMessageMethods

All Known Implementing Classes:
Twitter

public interface DirectMessageMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 DirectMessage destroyDirectMessage(int id)
          Destroys the direct message specified in the required ID parameter.
 ResponseList<DirectMessage> getDirectMessages()
          Returns a list of the direct messages sent to the authenticating user.
 ResponseList<DirectMessage> getDirectMessages(Paging paging)
          Returns a list of the direct messages sent to the authenticating user.
 ResponseList<DirectMessage> getSentDirectMessages()
          Returns a list of the direct messages sent by the authenticating user.
 ResponseList<DirectMessage> getSentDirectMessages(Paging paging)
          Returns a list of the direct messages sent by the authenticating user.
 DirectMessage sendDirectMessage(int userId, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 DirectMessage sendDirectMessage(java.lang.String screenName, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 

Method Detail

getDirectMessages

ResponseList<DirectMessage> getDirectMessages()
                                              throws TwitterException
Returns a list of the direct messages sent to the authenticating user.
This method calls http://api.twitter.com/1/direct_messages

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

ResponseList<DirectMessage> getDirectMessages(Paging paging)
                                              throws TwitterException
Returns a list of the direct messages sent to the authenticating user.
This method calls http://api.twitter.com/1/direct_messages

Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getSentDirectMessages

ResponseList<DirectMessage> getSentDirectMessages()
                                                  throws TwitterException
Returns a list of the direct messages sent by the authenticating user.
This method calls http://api.twitter.com/1/direct_messages/sent

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

getSentDirectMessages

ResponseList<DirectMessage> getSentDirectMessages(Paging paging)
                                                  throws TwitterException
Returns a list of the direct messages sent by the authenticating user.
This method calls http://api.twitter.com/1/direct_messages/sent

Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

sendDirectMessage

DirectMessage sendDirectMessage(java.lang.String screenName,
                                java.lang.String text)
                                throws TwitterException
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. The text will be trimmed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Parameters:
screenName - the screen name of the user to whom send the direct message
text - The text of your direct message.
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages new

sendDirectMessage

DirectMessage sendDirectMessage(int userId,
                                java.lang.String text)
                                throws TwitterException
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. The text will be trimmed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Parameters:
userId - the screen name of the user to whom send the direct message
text - The text of your direct message.
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4j 2.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages new

destroyDirectMessage

DirectMessage destroyDirectMessage(int id)
                                   throws TwitterException
Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.
This method calls http://api.twitter.com/1/direct_messages/destroy

Parameters:
id - the ID of the direct message to destroy
Returns:
the deleted direct message
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages destroy