パッケージ twitter4j.v1

インタフェース DirectMessagesResources


public interface DirectMessagesResources
  • メソッドの詳細

    • getDirectMessages

      DirectMessageList getDirectMessages(int count) throws TwitterException
      Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.
      This method calls https://api.twitter.com/1.1/direct_messages/events/list.json
      Requests / 15-min window (user auth) 15/user
      パラメータ:
      count - Max number of events to be returned. 20 default. 50 max.
      戻り値:
      List
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.7
      関連項目:
    • getDirectMessages

      DirectMessageList getDirectMessages(int count, String cursor) throws TwitterException
      Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.
      This method calls https://api.twitter.com/1.1/direct_messages/events/list.json
      パラメータ:
      count - Max number of events to be returned. 20 default. 50 max.
      cursor - For paging through result sets greater than 1 page, use the “next_cursor” property from the previous request.
      戻り値:
      List
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.7
      関連項目:
    • showDirectMessage

      DirectMessage showDirectMessage(long id) throws TwitterException
      Returns a single Direct Message event by the given id.
      This method has not been finalized and the interface is subject to change in incompatible ways.
      This method calls https://api.twitter.com/1.1/direct_messages/events/show.json
      パラメータ:
      id - message id
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.9
      関連項目:
    • destroyDirectMessage

      void destroyDirectMessage(long id) throws TwitterException
      Deletes the direct message specified in the required ID parameter.
      This method calls https://api.twitter.com/1.1/direct_messages/events/destroy.json
      パラメータ:
      id - The id of the Direct Message event that should be deleted.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.1
      関連項目:
    • sendDirectMessage

      DirectMessage sendDirectMessage(long userId, String text, QuickReply... quickReplies) 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 https://dev.twitter.com/rest/reference/post/direct_messages/events/new
      パラメータ:
      userId - the user id of the user to whom send the direct message
      text - The text of your direct message.
      quickReplies - Quick Replies
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4j 2.1.0
      関連項目:
    • sendDirectMessage

      DirectMessage sendDirectMessage(long userId, String text, String quickReplyResponse) 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 https://dev.twitter.com/rest/reference/post/direct_messages/events/new
      パラメータ:
      userId - the user id of the user to whom send the direct message
      text - The text of your direct message.
      quickReplyResponse - Quick Reply response
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4j 2.1.0
      関連項目:
    • sendDirectMessage

      DirectMessage sendDirectMessage(long userId, String text, long mediaId) 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 https://dev.twitter.com/rest/reference/post/direct_messages/events/new
      パラメータ:
      userId - the user id of the user to whom send the direct message
      text - The text of your direct message.
      mediaId - id of media attachment
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.7
      関連項目:
    • sendDirectMessage

      DirectMessage sendDirectMessage(long userId, 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 https://dev.twitter.com/rest/reference/post/direct_messages/events/new
      パラメータ:
      userId - the user id of the user to whom send the direct message
      text - The text of your direct message.
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.7
      関連項目:
    • sendDirectMessage

      DirectMessage sendDirectMessage(String screenName, 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 https://api.twitter.com/1.1/direct_messages/new
      パラメータ:
      screenName - the screen name of the user to whom send the direct message
      text - The text of your direct message.
      戻り値:
      DirectMessage
      例外:
      TwitterException - when Twitter service or network is unavailable
      関連項目:
    • getDMImageAsStream

      InputStream getDMImageAsStream(String url) throws TwitterException
      Returns a stream of the image included in direct messages.
      パラメータ:
      url - image url
      戻り値:
      InputStream
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.6
      関連項目: