twitter4j.api
Interface DirectMessageMethods

All Known Subinterfaces:
Twitter
All Known Implementing Classes:
TwitterImpl

public interface DirectMessageMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 DirectMessage destroyDirectMessage(long 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(long 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.
 DirectMessage showDirectMessage(long id)
          Returns a single direct message, specified by an id parameter.
 

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:
GET direct_messages | dev.twitter.com

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:
GET direct_messages | dev.twitter.com

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:
GET direct_messages/sent | dev.twitter.com

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:
GET direct_messages/sent | dev.twitter.com

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:
POST direct_messages/new | dev.twitter.com

sendDirectMessage

DirectMessage sendDirectMessage(long 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:
POST direct_messages/new | dev.twitter.com

destroyDirectMessage

DirectMessage destroyDirectMessage(long 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:
POST direct_messages/destroy/:id | dev.twitter.com

showDirectMessage

DirectMessage showDirectMessage(long id)
                                throws TwitterException
Returns a single direct message, specified by an id parameter.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/direct_messages/show/:id.json

Parameters:
id - message id
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.9
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group