twitter4j.api

## Interface UsersResourcesAsync

All Known Subinterfaces:
  AsyncTwitter

    public interface UsersResourcesAsync

Author:
  Joern Huxhorn - jhuxhorn at googlemail.com

### Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods
`void` `createBlock(long userId)` Blocks the user specified in the ID parameter as the authenticating user.
`void` `createBlock(String screenName)` Blocks the user specified in the ID parameter as the authenticating user.
`void` `createMute(long userId)` Mutes the user specified in the ID parameter as the authenticating user.
`void` `createMute(String screenName)` Mutes the user specified in the screen name parameter as the authenticating user.
`void` `destroyBlock(long userId)` Un-blocks the user specified in the ID parameter as the authenticating user.
`void` `destroyBlock(String screenName)` Un-blocks the user specified in the ID parameter as the authenticating user.
`void` `destroyMute(long userId)` Un-mutes the user specified in the ID parameter as the authenticating user.
`void` `destroyMute(String screenName)` Un-mutes the user specified in the screen name parameter as the authenticating user.
`void` `getAccountSettings()` Returns the current trend, geo and sleep time information for the authenticating user.
`void` `getBlocksIDs()` Returns an array of numeric user ids the authenticating user is blocking.
`void` `getBlocksIDs(long cursor)` Returns an array of numeric user ids the authenticating user is blocking.
`void` `getBlocksList()` Returns a list of user objects that the authenticating user is blocking.
`void` `getBlocksList(long cursor)` Returns a list of user objects that the authenticating user is blocking.
`void` `getContributees(long userId)` Returns an array of users that the specified user can contribute to.
`void` `getContributees(String screenName)` Returns an array of users that the specified user can contribute to.
`void` `getContributors(long userId)` Returns an array of users who can contribute to the specified account.
`void` `getContributors(String screenName)` Returns an array of users who can contribute to the specified account.
`void` `getMutesIDs(long cursor)` Returns an array of numeric user ids the authenticating user is muting.
`void` `getMutesList(long cursor)` Returns a list of user objects that the authenticating user is muting.
`void` `lookupUsers(long... ids)` Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
`void` `lookupUsers(String... screenNames)` Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
`void` `removeProfileBanner()` Removes the uploaded profile banner for the authenticating user.
`void` `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.
`void` `showUser(long userId)` Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
`void` `showUser(String screenName)` Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
`void` `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.
`void` `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` `updateProfileBackgroundImage(File image, boolean tile)` Updates the authenticating user's profile background image.
`void` `updateProfileBackgroundImage(InputStream image, boolean tile)` Updates the authenticating user's profile background image.
`void` `updateProfileBanner(File image)` Uploads a profile banner on behalf of the authenticating user.
`void` `updateProfileBanner(InputStream image)` Uploads a profile banner on behalf of the authenticating user.
`void` `updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor)` Deprecated. Since Twitter4J 4.0.5
`void` `updateProfileImage(File image)` Updates the authenticating user's profile image.
`void` `updateProfileImage(InputStream image)` Updates the authenticating user's profile image.
`void` `verifyCredentials()` 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.

### Method Detail

#### getAccountSettings

    void getAccountSettings()

Returns the current trend, geo 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

Since:
  Twitter4J 2.1.9
See Also:
  GET account/settings | Twitter Developers

#### verifyCredentials

    void verifyCredentials()

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

Since:
  Twitter4J 2.1.3
See Also:
  GET account/verify_credentials | Twitter Developers

#### updateAccountSettings

    void 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.
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

Parameters:
  `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)
Since:
  Twitter4J 2.2.4
See Also:
  POST account/settings | Twitter Developers

#### updateProfile

    void 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. Only the parameters specified(non-null) will be updated.

Parameters:
  `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.
Since:
  Twitter4J 2.1.8
See Also:
  POST account/update_profile | Twitter Developers

#### updateProfileBackgroundImage

    void updateProfileBackgroundImage(File image,
                                      boolean tile)

Updates the authenticating user's profile background image.
This method calls https://api.twitter.com/1.1/account/update_profile_background_image.json

Parameters:
  `image` - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down.
  `tile` - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Since:
  Twitter4J 2.1.0
See Also:
  POST account/update_profile_background_image | Twitter Developers

#### updateProfileBackgroundImage

    void updateProfileBackgroundImage(InputStream image,
                                      boolean tile)

Updates the authenticating user's profile background image.
This method calls https://api.twitter.com/1.1/account/update_profile_background_image.json

Parameters:
  `image` - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down.
  `tile` - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Since:
  Twitter4J 2.1.11
See Also:
  POST account/update_profile_background_image | Twitter Developers

#### updateProfileColors

    void updateProfileColors(String profileBackgroundColor,
                             String profileTextColor,
                             String profileLinkColor,
                             String profileSidebarFillColor,
                             String profileSidebarBorderColor)

Deprecated. Since Twitter4J 4.0.5
Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. Each parameter's value must be a valid hexadecimal value, and may be either three or six characters (ex: #fff or #ffffff).
This method calls https://api.twitter.com/1.1/account/update_profile_colors

Parameters:
  `profileBackgroundColor` - optional, can be null
  `profileTextColor` - optional, can be null
  `profileLinkColor` - optional, can be null
  `profileSidebarFillColor` - optional, can be null
  `profileSidebarBorderColor` - optional, can be null
Since:
  Twitter4J 2.0.0
See Also:
  POST account/update_profile_colors | Twitter Developers

#### updateProfileImage

    void updateProfileImage(File image)

Updates the authenticating user's profile image.
This method calls https://api.twitter.com/1.1/account/update_profile_image.json

Parameters:
  `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.
Since:
  Twitter4J 2.1.0
See Also:
  POST account/update_profile_image | Twitter Developers

#### updateProfileImage

    void updateProfileImage(InputStream image)

Updates the authenticating user's profile image.
This method calls https://api.twitter.com/1.1/account/update_profile_image.json

Parameters:
  `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.
Since:
  Twitter4J 2.1.11
See Also:
  POST account/update_profile_image | Twitter Developers

#### getBlocksList

    void getBlocksList()

Returns a list of user objects that the authenticating user is blocking.
This method calls https://api.twitter.com/1.1/blocks/blocking.xml

Since:
  Twitter4J 2.0.4
See Also:
  GET blocks/blocking | Twitter Developers

#### getBlocksList

    void getBlocksList(long cursor)

Returns a list of user objects that the authenticating user is blocking.
This method calls https://api.twitter.com/1.1/blocks/blocking.xml

Parameters:
  `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."
Since:
  Twitter4J 2.0.4
See Also:
  GET blocks/blocking | Twitter Developers

#### getBlocksIDs

    void getBlocksIDs()

Returns an array of numeric user ids the authenticating user is blocking.
This method calls https://api.twitter.com/1.1/blocks/blocking/ids

Since:
  Twitter4J 2.0.4
See Also:
  GET blocks/ids | Twitter Developers

#### getBlocksIDs

    void getBlocksIDs(long cursor)

Returns an array of numeric user ids the authenticating user is blocking.
This method calls https://api.twitter.com/1.1/blocks/blocking/ids

Parameters:
  `cursor` - cursor
Since:
  Twitter4J 3.0.2
See Also:
  GET blocks/ids | Twitter Developers

#### createBlock

    void createBlock(long userId)

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%C2%A0

Parameters:
  `userId` - the screen_name of the user to block
Since:
  Twitter4J 2.1.0
See Also:
  POST blocks/create | Twitter Developers

#### createBlock

    void createBlock(String screenName)

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%C2%A0

Parameters:
  `screenName` - the screen_name of the user to block
Since:
  Twitter4J 2.0.1
See Also:
  POST blocks/create | Twitter Developers

#### destroyBlock

    void destroyBlock(long userId)

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/create%C2%A0

Parameters:
  `userId` - the ID of the user to block
Since:
  Twitter4J 2.1.0
See Also:
  POST blocks/destroy | Twitter Developers

#### destroyBlock

    void destroyBlock(String screenName)

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/create%C2%A0

Parameters:
  `screenName` - the screen_name of the user to block
Since:
  Twitter4J 2.0.1
See Also:
  POST blocks/destroy | Twitter Developers

#### getMutesList

    void getMutesList(long cursor)

Returns a list of user objects that the authenticating user is muting.
This method calls https://api.twitter.com/1.1/mutes/users/list

Parameters:
  `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."
Since:
  Twitter4J 4.0.2
See Also:
  GET mutes/users/list | Twitter Developers

#### getMutesIDs

    void getMutesIDs(long cursor)

Returns an array of numeric user ids the authenticating user is muting.
This method calls https://api.twitter.com/1.1/mutes/users/ids

Parameters:
  `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."
Since:
  Twitter4J 4.0.2
See Also:
  GET mutes/users/ids | Twitter Developers

#### createMute

    void createMute(long userId)

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

Parameters:
  `userId` - the ID of the user to mute
Since:
  Twitter4J 4.0.2
See Also:
  POST mutes/users/create | Twitter Developers

#### createMute

    void createMute(String screenName)

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

Parameters:
  `screenName` - the screen_name of the user to mute
Since:
  Twitter4J 4.0.2
See Also:
  POST mutes/users/create | Twitter Developers

#### destroyMute

    void destroyMute(long userId)

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

Parameters:
  `userId` - the ID of the user to mute
Since:
  Twitter4J 4.0.2
See Also:
  POST mutes/users/destroy | Twitter Developers

#### destroyMute

    void destroyMute(String screenName)

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

Parameters:
  `screenName` - the screen_name of the user to mute
Since:
  Twitter4J 4.0.2
See Also:
  POST mutes/users/destroy | Twitter Developers

#### lookupUsers

    void lookupUsers(long... ids)

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

Parameters:
  `ids` - Specifies the screen names of the users to retrieve.
Since:
  Twitter4J 2.1.1
See Also:
  GET users/lookup | Twitter Developers

#### lookupUsers

    void lookupUsers(String... screenNames)

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

Parameters:
  `screenNames` - Specifies the screen names of the users to retrieve.
Since:
  Twitter4J 2.1.1
See Also:
  GET users/lookup | Twitter Developers

#### showUser

    void showUser(long userId)

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

Parameters:
  `userId` - the ID of the user for whom to request the retrieve
See Also:
  GET users/show | Twitter Developers

#### showUser

    void showUser(String screenName)

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

Parameters:
  `screenName` - the screen name of the user for whom to request the detail
See Also:
  GET users/show | Twitter Developers

#### searchUsers

    void 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.
This method calls https://api.twitter.com/1.1/users/search.json

Parameters:
  `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.
See Also:
  GET users/search | Twitter Developers

#### getContributees

    void getContributees(long userId)

Returns an array of users that the specified user can contribute to.

Parameters:
  `userId` - The user id of the user for whom to return results for
Since:
  Twitter4J 3.0.0
See Also:
  GET users/contributors | Twitter Developers

#### getContributees

    void getContributees(String screenName)

Returns an array of users that the specified user can contribute to.

Parameters:
  `screenName` - The screen name of the user for whom to return results for
Since:
  Twitter4J 3.0.0
See Also:
  GET users/contributors | Twitter Developers

#### getContributors

    void getContributors(long userId)

Returns an array of users who can contribute to the specified account.

Parameters:
  `userId` - The user id of the user for whom to return results for
Since:
  Twitter4J 3.0.0
See Also:
  GET users/contributors | Twitter Developers

#### getContributors

    void getContributors(String screenName)

Returns an array of users who can contribute to the specified account.

Parameters:
  `screenName` - The screen name of the user for whom to return results for
Since:
  Twitter4J 3.0.0
See Also:
  GET users/contributors | Twitter Developers

#### removeProfileBanner

    void removeProfileBanner()

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

Since:
  Twitter4J 3.0.0
See Also:
  POST account/remove_profile_banner | Twitter Developers

#### updateProfileBanner

    void updateProfileBanner(File image)

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

Parameters:
  `image` - For best results, upload an <5MB image that is exactly 1252px by 626px.
Since:
  Twitter4J 3.0.0
See Also:
  POST account/update_profile_banner | Twitter Developers

#### updateProfileBanner

    void updateProfileBanner(InputStream image)

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

Parameters:
  `image` - For best results, upload an <5MB image that is exactly 1252px by 626px.
Since:
  Twitter4J 3.0.0
See Also:
  POST account/update_profile_banner | Twitter Developers