twitter4j.api
Interface AccountMethods

All Known Subinterfaces:
Twitter

public interface AccountMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 AccountSettings getAccountSettings()
          Returns the current trend, geo, language, timezone and sleep time information for the authenticating user.
 AccountTotals getAccountTotals()
          Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user.
 RateLimitStatus getRateLimitStatus()
          Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
 AccountSettings 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.
 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.
 User updateProfileBackgroundImage(File image, boolean tile)
          Updates the authenticating user's profile background image.
 User updateProfileBackgroundImage(InputStream image, boolean tile)
          Updates the authenticating user's profile background image.
 User updateProfileColors(String profileBackgroundColor, String profileTextColor, String profileLinkColor, String profileSidebarFillColor, String profileSidebarBorderColor)
          Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.
 User updateProfileImage(File image)
          Updates the authenticating user's profile image.
 User updateProfileImage(InputStream image)
          Updates the authenticating user's profile image.
 User 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

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 http://api.twitter.com/1/account/verify_credentials.json

Returns:
user
Throws:
TwitterException - when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401)
Since:
Twitter4J 2.0.0
See Also:
GET account/verify_credentials | Twitter Developers

getRateLimitStatus

RateLimitStatus getRateLimitStatus()
                                   throws TwitterException
Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned.

This method calls http://api.twitter.com/1/account/rate_limit_status.json

Returns:
the rate limit status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.4
See Also:
GET account/rate_limit_status | Twitter Developers

updateProfileColors

User updateProfileColors(String profileBackgroundColor,
                         String profileTextColor,
                         String profileLinkColor,
                         String profileSidebarFillColor,
                         String profileSidebarBorderColor)
                         throws TwitterException
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 hexidecimal value, and may be either three or six characters (ex: #fff or #ffffff).
This method calls http://api.twitter.com/1/account/update_profile_colors.json

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
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
POST account/update_profile_colors | Twitter Developers

updateProfileImage

User updateProfileImage(File image)
                        throws TwitterException
Updates the authenticating user's profile image.
This method calls http://api.twitter.com/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.
Returns:
the updated user
Throws:
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)
Since:
Twitter4J 2.1.0
See Also:
POST account/update_profile_image | Twitter Developers

updateProfileImage

User updateProfileImage(InputStream image)
                        throws TwitterException
Updates the authenticating user's profile image.
This method calls http://api.twitter.com/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.
Returns:
the updated user
Throws:
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)
Since:
Twitter4J 2.1.11
See Also:
POST account/update_profile_image | Twitter Developers

updateProfileBackgroundImage

User updateProfileBackgroundImage(File image,
                                  boolean tile)
                                  throws TwitterException
Updates the authenticating user's profile background image.
This method calls http://api.twitter.com/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 forceably scaled down.
tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Returns:
the updated user
Throws:
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)
Since:
Twitter4J 2.1.0
See Also:
POST account/update_profile_background_image | Twitter Developers

updateProfileBackgroundImage

User updateProfileBackgroundImage(InputStream image,
                                  boolean tile)
                                  throws TwitterException
Updates the authenticating user's profile background image.
This method calls http://api.twitter.com/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 forceably scaled down.
tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Returns:
the updated user
Throws:
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)
Since:
Twitter4J 2.1.11
See Also:
POST account/update_profile_background_image | Twitter Developers

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 http://api.twitter.com/1/account/update_profile.json

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.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.8
See Also:
POST account/update_profile | Twitter Developers

getAccountTotals

AccountTotals getAccountTotals()
                               throws TwitterException
Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/account/totals.json

Returns:
the current count of friends, followers, updates (statuses) and favorites of the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.9
See Also:
GET account/totals | Twitter Developers

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 http://api.twitter.com/1/account/settings.json

Returns:
the current trend, geo and sleep time information for the authenticating user.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.9
See Also:
GET account/settings | Twitter Developers

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 http://api.twitter.com/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)
Returns:
the current trend, geo and sleep time information for the authenticating user.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.2.4
See Also:
POST account/settings | Twitter Developers


Copyright © 2012. All Rights Reserved.