パッケージ twitter4j.v1

インタフェース UsersResources


public interface UsersResources
interface for user resources
  • メソッドの概要

    修飾子とタイプ
    メソッド
    説明
    createBlock(long userId)
    Blocks the user specified in the ID parameter as the authenticating user.
    createBlock(String screenName)
    Blocks the user specified in the ID parameter as the authenticating user.
    createMute(long userId)
    Mutes the user specified in the ID parameter as the authenticating user.
    createMute(String screenName)
    Mutes the user specified in the screen name parameter as the authenticating user.
    destroyBlock(long userId)
    Un-blocks the user specified in the ID parameter as the authenticating user.
    destroyBlock(String screen_name)
    Un-blocks the user specified in the ID parameter as the authenticating user.
    destroyMute(long userId)
    Un-mutes the user specified in the ID parameter as the authenticating user.
    destroyMute(String screenName)
    Un-mutes the user specified in the screen name parameter as the authenticating user.
    Returns the current trend, geo, language, timezone and sleep time information for the authenticating user.
    Returns an array of numeric user ids the authenticating user is blocking.
    getBlocksIDs(long cursor)
    Returns an array of numeric user ids the authenticating user is blocking.
    Returns a list of user objects that the authenticating user is blocking.
    getBlocksList(long cursor)
    Returns a list of user objects that the authenticating user is blocking.
    getContributees(long userId)
    Returns an array of users that the specified user can contribute to.
    getContributees(String screenName)
    Returns an array of users that the specified user can contribute to.
    getContributors(long userId)
    Returns an array of users who can contribute to the specified account.
    getContributors(String screenName)
    Returns an array of users who can contribute to the specified account.
    getMutesIDs(long cursor)
    Returns an array of numeric user ids the authenticating user is muting.
    getMutesList(long cursor)
    Returns a list of user objects that the authenticating user is muting.
    lookupUsers(long... ids)
    Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
    lookupUsers(String... screenNames)
    Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
    void
    Removes the uploaded profile banner for the authenticating user.
    searchUsers(String query, int page)
    Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
    Usage note: It is only possible to retrieve the first 1000 matches from this API.
    showUser(long userId)
    Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
    showUser(String screenName)
    Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
    updateAccountSettings(Integer trendLocationWoeid, Boolean sleepTimeEnabled, String startSleepTime, String endSleepTime, String timeZone, String lang)
    Updates the current trend, geo, language, timezone and sleep time information for the authenticating user.
    updateAllowDmsFrom(String allowDmsFrom)
    Updates the allowDmsFrom settings for the authenticating user.
    updateProfile(String name, String url, String location, String description)
    Sets values that users are able to set under the "Account" tab of their settings page.
    void
    Uploads a profile banner on behalf of the authenticating user.
    void
    Uploads a profile banner on behalf of the authenticating user.
    Updates the authenticating user's profile image.
    Updates the authenticating user's profile image.
    Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
  • メソッドの詳細

    • getAccountSettings

      AccountSettings getAccountSettings() throws TwitterException
      Returns the current trend, geo, language, timezone and sleep time information for the authenticating user.
      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/account/settings.json
      戻り値:
      the current trend, geo and sleep time information for the authenticating user.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.9
      関連項目:
    • verifyCredentials

      User verifyCredentials() throws TwitterException
      Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.
      This method calls https://api.twitter.com/1.1/account/verify_credentials.json
      戻り値:
      user
      例外:
      TwitterException - when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401)
      導入されたバージョン:
      Twitter4J 2.0.0
      関連項目:
    • updateAccountSettings

      AccountSettings updateAccountSettings(Integer trendLocationWoeid, Boolean sleepTimeEnabled, String startSleepTime, String endSleepTime, String timeZone, String lang) throws TwitterException
      Updates the current trend, geo, language, timezone and sleep time information for the authenticating user.
      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/account/settings.json
      パラメータ:
      trendLocationWoeid - Optional. The Yahoo! Where On Earth ID to use as the user's default trend location.
      sleepTimeEnabled - Optional. Whether sleep time is enabled for the user
      startSleepTime - Optional. The hour that sleep time should begin if it is enabled.
      endSleepTime - Optional. The hour that sleep time should end if it is enabled.
      timeZone - Optional. The timezone dates and times should be displayed in for the user.
      lang - Optional. The language which Twitter should render in for this user. (two letter ISO 639-1)
      戻り値:
      the current trend, geo and sleep time information for the authenticating user.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.2.4
      関連項目:
    • updateAllowDmsFrom

      AccountSettings updateAllowDmsFrom(String allowDmsFrom) throws TwitterException
      Updates the allowDmsFrom settings for the authenticating user.
      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/account/settings.json
      This method requires whitelisting from Twitter: https://twittercommunity.com/t/api-updates-for-direct-messages-rules/36061
      パラメータ:
      allowDmsFrom - Optional. "all" for anyone, "followers" for friends only
      戻り値:
      the current trend, geo and sleep time information for the authenticating user.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.7
    • updateProfile

      User updateProfile(String name, String url, String location, String description) throws TwitterException
      Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified(non-null) will be updated.
      This method calls https://api.twitter.com/1.1/account/update_profile.json
      パラメータ:
      name - Optional. Maximum of 20 characters.
      url - Optional. Maximum of 100 characters. Will be prepended with "http://" if not present.
      location - Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way.
      description - Optional. Maximum of 160 characters.
      戻り値:
      the updated user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.8
      関連項目:
    • updateProfileImage

      User updateProfileImage(File image) throws TwitterException
      Updates the authenticating user's profile image.
      This method calls https://api.twitter.com/1.1/account/update_profile_image.json
      パラメータ:
      image - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
      戻り値:
      the updated user
      例外:
      TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
      導入されたバージョン:
      Twitter4J 2.1.0
      関連項目:
    • updateProfileImage

      User updateProfileImage(InputStream image) throws TwitterException
      Updates the authenticating user's profile image.
      This method calls https://api.twitter.com/1.1/account/update_profile_image.json
      パラメータ:
      image - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
      戻り値:
      the updated user
      例外:
      TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
      導入されたバージョン:
      Twitter4J 2.1.11
      関連項目:
    • getBlocksList

      PagableResponseList<User> getBlocksList() throws TwitterException
      Returns a list of user objects that the authenticating user is blocking.
      This method calls https://api.twitter.com/1.1/blocks/blocking.json
      戻り値:
      a list of user objects that the authenticating user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.4
      関連項目:
    • getBlocksList

      PagableResponseList<User> getBlocksList(long cursor) throws TwitterException
      Returns a list of user objects that the authenticating user is blocking.
      This method calls https://api.twitter.com/1.1/blocks/blocking.json
      パラメータ:
      cursor - Causes the list of blocked users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."
      戻り値:
      a list of user objects that the authenticating user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.4
      関連項目:
    • getBlocksIDs

      IDs getBlocksIDs() throws TwitterException
      Returns an array of numeric user ids the authenticating user is blocking.
      This method calls https://api.twitter.com/1.1/blocks/ids
      戻り値:
      Returns an array of numeric user ids the authenticating user is blocking.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.4
      関連項目:
    • getBlocksIDs

      IDs getBlocksIDs(long cursor) throws TwitterException
      Returns an array of numeric user ids the authenticating user is blocking.
      This method calls https://api.twitter.com/1.1/blocks/ids
      パラメータ:
      cursor - cursor
      戻り値:
      Returns an array of numeric user ids the authenticating user is blocking.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.2
      関連項目:
    • createBlock

      User createBlock(long userId) throws TwitterException
      Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/blocks/create/[id].json
      パラメータ:
      userId - the ID of the user to block
      戻り値:
      the blocked user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.0
      関連項目:
    • createBlock

      User createBlock(String screenName) throws TwitterException
      Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/blocks/create/[id].json
      パラメータ:
      screenName - the screen_name of the user to block
      戻り値:
      the blocked user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.1
      関連項目:
    • destroyBlock

      User destroyBlock(long userId) throws TwitterException
      Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/blocks/destroy/[id].json
      パラメータ:
      userId - the ID of the user to block
      戻り値:
      the unblocked user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.1
      関連項目:
    • destroyBlock

      User destroyBlock(String screen_name) throws TwitterException
      Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/blocks/destroy/[id].json
      パラメータ:
      screen_name - the screen_name of the user to block
      戻り値:
      the unblocked user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.0.1
      関連項目:
    • getMutesList

      PagableResponseList<User> getMutesList(long cursor) throws TwitterException
      Returns a list of user objects that the authenticating user is muting.
      This method calls https://api.twitter.com/1.1/mutes/users/list
      パラメータ:
      cursor - Causes the list of muted users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."
      戻り値:
      a list of user objects that the authenticating user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • getMutesIDs

      IDs getMutesIDs(long cursor) throws TwitterException
      Returns an array of numeric user ids the authenticating user is muting.
      This method calls https://api.twitter.com/1.1/mutes/users/ids
      パラメータ:
      cursor - Causes the list of muted users to be broken into pages of no more than 5000 IDs at a time. The number of IDs returned is not guaranteed to be 5000 as suspended users are filtered out after connections are queried. If no cursor is provided, a value of -1 will be assumed, which is the first "page."
      戻り値:
      Returns an array of numeric user ids the authenticating user is muting.
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • createMute

      User createMute(long userId) throws TwitterException
      Mutes the user specified in the ID parameter as the authenticating user. Returns the muted user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/mutes/users/create
      パラメータ:
      userId - the user_id of the user to mute
      戻り値:
      the muted user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • createMute

      User createMute(String screenName) throws TwitterException
      Mutes the user specified in the screen name parameter as the authenticating user. Returns the muted user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/mutes/users/create
      パラメータ:
      screenName - the screen_name of the user to mute
      戻り値:
      the muted user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • destroyMute

      User destroyMute(long userId) throws TwitterException
      Un-mutes the user specified in the ID parameter as the authenticating user. Returns the un-muted user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/mutes/users/destroy
      パラメータ:
      userId - the ID of the user to mute
      戻り値:
      the unmuted user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • destroyMute

      User destroyMute(String screenName) throws TwitterException
      Un-mutes the user specified in the screen name parameter as the authenticating user. Returns the un-muted user in the requested format when successful.
      This method calls https://api.twitter.com/1.1/mutes/users/destroy
      パラメータ:
      screenName - the screen_name of the user to mute
      戻り値:
      the unmuted user
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 4.0.2
      関連項目:
    • lookupUsers

      ResponseList<User> lookupUsers(long... ids) throws TwitterException
      Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
      This method calls https://api.twitter.com/1.1/users/lookup.json
      パラメータ:
      ids - Specifies the IDs of the users to return.
      戻り値:
      users
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.1
      関連項目:
    • lookupUsers

      ResponseList<User> lookupUsers(String... screenNames) throws TwitterException
      Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
      This method calls https://api.twitter.com/1.1/users/lookup.json
      パラメータ:
      screenNames - Specifies the screen names of the users to return.
      戻り値:
      users
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.1
      関連項目:
    • showUser

      User showUser(long userId) throws TwitterException
      Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
      This method calls https://api.twitter.com/1.1/users/show.json
      パラメータ:
      userId - the ID of the user for whom to request the detail
      戻り値:
      users
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 2.1.0
      関連項目:
    • showUser

      User showUser(String screenName) throws TwitterException
      Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
      This method calls https://api.twitter.com/1.1/users/show.json
      パラメータ:
      screenName - the screen name of the user for whom to request the detail
      戻り値:
      User
      例外:
      TwitterException - when Twitter service or network is unavailable
      関連項目:
    • searchUsers

      ResponseList<User> searchUsers(String query, int page) throws TwitterException
      Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
      Usage note: It is only possible to retrieve the first 1000 matches from this API.
      This method calls https://api.twitter.com/1.1/users/search.json
      パラメータ:
      query - The query to run against people search.
      page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.
      戻り値:
      the list of Users matches the provided
      例外:
      TwitterException - when Twitter service or network is unavailable
      関連項目:
    • getContributees

      ResponseList<User> getContributees(long userId) throws TwitterException
      Returns an array of users that the specified user can contribute to.
      パラメータ:
      userId - The user id of the user for whom to return results for
      戻り値:
      list of contributors
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • getContributees

      ResponseList<User> getContributees(String screenName) throws TwitterException
      Returns an array of users that the specified user can contribute to.
      パラメータ:
      screenName - The screen name of the user for whom to return results for
      戻り値:
      list of contributors
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • getContributors

      ResponseList<User> getContributors(long userId) throws TwitterException
      Returns an array of users who can contribute to the specified account.
      パラメータ:
      userId - The user id of the user for whom to return results for
      戻り値:
      list of contributors
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • getContributors

      ResponseList<User> getContributors(String screenName) throws TwitterException
      Returns an array of users who can contribute to the specified account.
      パラメータ:
      screenName - The screen name of the user for whom to return results for
      戻り値:
      list of contributors
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • removeProfileBanner

      void removeProfileBanner() throws TwitterException
      Removes the uploaded profile banner for the authenticating user. Returns HTTP 200 upon success.
      This method calls https://api.twitter.com/1.1/account/remove_profile_banner.json
      例外:
      TwitterException - when Twitter service or network is unavailable
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • updateProfileBanner

      void updateProfileBanner(File image) throws TwitterException
      Uploads a profile banner on behalf of the authenticating user. For best results, upload an <5MB image that is exactly 1252px by 626px. Images will be resized for a number of display options. Users with an uploaded profile banner will have a profile_banner_url node in their Users objects. More information about sizing variations can be found in User Profile Images and Banners.
      Profile banner images are processed asynchronously. The profile_banner_url and its variant sizes will not necessary be available directly after upload.

      This method calls https://api.twitter.com/1.1/account/update_profile_banner.json
      パラメータ:
      image - For best results, upload an <5MB image that is exactly 1252px by 626px.
      例外:
      TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目:
    • updateProfileBanner

      void updateProfileBanner(InputStream image) throws TwitterException
      Uploads a profile banner on behalf of the authenticating user. For best results, upload an <5MB image that is exactly 1252px by 626px. Images will be resized for a number of display options. Users with an uploaded profile banner will have a profile_banner_url node in their Users objects. More information about sizing variations can be found in User Profile Images and Banners.
      Profile banner images are processed asynchronously. The profile_banner_url and its variant sizes will not necessary be available directly after upload.

      This method calls https://api.twitter.com/1.1/account/update_profile_banner.json
      パラメータ:
      image - For best results, upload an <5MB image that is exactly 1252px by 626px.
      例外:
      TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
      導入されたバージョン:
      Twitter4J 3.0.0
      関連項目: