public class Twitter extends Object implements Account, AccountActivity, DirectMessages, Favorites, Followers, Friends, SevenDaySearch, Statuses, SuggestedUsers, ThirtyDaySearch, ThirtyDaySearchCounts, Users, WelcomeMessages, WelcomeMessageRules
Statuses.RetweetsRequestAnnotations, Statuses.StatusesShowRequestAnnotationspath| Modifier and Type | Method and Description |
|---|---|
List<SuggestedUserCategory> |
categories(String lang)
Access to Twitter’s suggested user list.
|
Boolean |
deleteWebhook(Long webhookId)
Removes the webhook from the provided application’s configuration.
|
Boolean |
deleteWebhookSubscriptions(Long webhookId)
Deactivates subscription for the provided user context and app.
|
DirectMessage |
destroy(Long id)
Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user.
|
void |
destroyWelcomeMessage(Long id)
Deletes a Welcome Message by the given id.
|
void |
destroyWelcomeMessageRule(Long id)
Deletes a Welcome Message Rule by the given id.
|
static Twitter |
getInstance() |
static Twitter |
getInstance(TwitterConfiguration configuration) |
List<Webhook> |
getWebhooks()
Returns all URLs and their statuses for the given app.
|
Boolean |
getWebhookSubscription(Long webhookId)
Provides a way to determine if a webhook configuration is subscribed to the provided user’s Direct Messages.
|
List<Tweet> |
homeTimeline(StatusesHomeTimelineRequest parameters)
Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.
|
FollowersIdsResponse |
ids(FollowersIdsRequest parameters)
Returns a cursored collection of user IDs for every user following the specified user.
|
FriendsIdsResponse |
ids(FriendsIdsRequest parameters)
Returns a cursored collection of user IDs for every user the specified user is following.
|
List<DirectMessage> |
list(DirectMessagesListRequest parameters)
Returns the 20 most recent direct messages sent to the authenticating user.
|
List<Tweet> |
list(FavoritesListRequest parameters)
Returns the 20 most recent Tweets favorited by the authenticating or specified user.
|
FollowersListResponse |
list(FollowersListRequest parameters)
Returns a cursored collection of user objects for users following the specified user.
|
FriendsListResponse |
list(FriendsListRequest parameters)
Returns a cursored collection of user objects for every user the specified user is following.
|
EventsListResponse |
listEvents(EventsListRequest parameters)
Returns all Direct Message events (both sent and received) within the last 30 days.
|
WelcomeMessageRulesListResponse |
listWelcomeMessageRules(WelcomeMessageRulesListRequest parameters)
Returns a list of Welcome Message Rules.
|
WelcomeMessagesListResponse |
listWelcomeMessages(WelcomeMessagesListRequest parameters)
Returns a list of Welcome Messages.
|
List<Tweet> |
lookup(StatusesLookupRequest parameters)
Returns fully-hydrated Tweet objects for up to 100 Tweets per request, as specified by comma-separated values passed to the id parameter.
|
List<User> |
lookup(UsersLookupRequest parameters)
Returns fully-hydrated user objects for up to 100 users per request, as specified by comma-separated values passed to the user_id and/or screen_name parameters.
|
List<User> |
members(String slug)
Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
|
List<Tweet> |
mentionsTimeline(StatusesMentionsTimelineRequest parameters)
Returns the 20 most recent mentions (Tweets containing a users’s @screen_name) for the authenticating user.
|
DirectMessage |
newDM(DirectMessageNewRequest parameters)
Destroys the direct message specified in the required ID parameter.
|
DirectMessageEvent |
newEvent(MessageCreateRequest event)
Destroys the direct message specified in the required ID parameter.
|
WelcomeMessageNewResponse |
newWelcomeMessage(WelcomeMessageNewRequest parameters)
Creates a new Welcome Message that will be stored and sent in the future from the authenticating user in defined circumstances.
|
WelcomeMessageRule |
newWelcomeMessageRule(WelcomeMessageNewRuleRequest body)
Creates a new Welcome Message Rule that determines which Welcome Message will be shown in a given conversation.
|
Boolean |
putWebhook(Long webhookId)
Triggers the challenge response check (CRC) for the given webhook’s URL.
|
Webhook |
registerWebhook(String url)
Registers a new webhook URL for the given application context.
|
Boolean |
registerWebhookSubscriptions(Long webhookId)
Subscribes the provided app to events for the provided user context.
|
RetweeterIdsResponse |
retweeterIds(RetweeterIdsRequest parameters)
Returns a collection of up to 100 user IDs belonging to users who have retweeted the Tweet specified by the id parameter.
|
List<Tweet> |
retweets(RetweetsRequest parameters)
Returns a collection of the 100 most recent retweets of the Tweet specified by the id parameter.
|
List<User> |
search(UsersSearchRequest parameters)
Provides a simple, relevance-based search interface to public user accounts on Twitter.
|
List<DirectMessage> |
sent(DirectMessagesSentRequest parameters)
Returns the 20 most recent direct messages sent to the authenticating user.
|
AccountSettings |
settings()
Returns settings (including current trend, geo and sleep time information) for the authenticating user.
|
SevenDaySearchResponse |
sevenDaySearch(SevenDaySearchRequest event)
Returns a collection of relevant Tweets matching a specified query.
|
DirectMessage |
show(Long id)
The ID of the direct message.
|
Tweet |
show(StatusesShowRequest parameters)
Returns a single Tweet, specified by the id parameter.
|
User |
show(UsersShowRequest parameters)
Returns a variety of information about the user specified by the required user_id or screen_name parameter.
|
EventShowResponse |
showEvent(Long id)
Returns a single Direct Message event by the given id.
|
WelcomeMessage |
showWelcomeMessage(Long id)
Returns a Welcome Message by the given id.
|
WelcomeMessageRule |
showWelcomeMessageRule(Long id)
Returns a Welcome Message Rule by the given id.
|
SuggestedUserCategory |
suggestions(String slug,
String lang)
Access the users in a given category of the Twitter suggested user list.
|
ThirtyDaySearchResponse |
thirtyDaySearch(String environment,
ThirtyDaySearchRequest searchRequest)
Returns a collection of relevant Tweets matching a specified query.
|
ThirtyDaySearchCountsResponse |
thirtyDaySearchCounts(String environment,
ThirtyDaySearchCountsRequest searchCountsRequest)
Returns counts of relevant Tweets matching a specified query.
|
User |
updateProfile(UpdateProfileRequest parameters)
Sets some values that users are able to set under the “Account” tab of their settings page.
|
AccountSettings |
updateSettings(UpdateProfileRequest parameters)
Updates the authenticating user’s settings.
|
List<Tweet> |
userTimeline(StatusesUserTimelineRequest parameters)
Returns a collection of the most recent Tweets posted by the user indicated by the screen_name or user_id parameters.
|
User |
verifyCredentials()
Returns user credentials for the authenticating user.
|
public static Twitter getInstance() throws InstantiationException
InstantiationExceptionpublic static Twitter getInstance(TwitterConfiguration configuration) throws InstantiationException
InstantiationExceptionpublic List<Tweet> userTimeline(StatusesUserTimelineRequest parameters)
StatusesuserTimeline in interface Statusesparameters - StatusesUserTimelineRequestList[Tweet]public List<Tweet> retweets(RetweetsRequest parameters)
Statusesretweets in interface Statusesparameters - RetweetsRequestList[Tweet]public RetweeterIdsResponse retweeterIds(RetweeterIdsRequest parameters)
StatusesretweeterIds in interface Statusesparameters - RetweeterIdsRequestRetweeterIdsResponsepublic List<Tweet> homeTimeline(StatusesHomeTimelineRequest parameters)
StatuseshomeTimeline in interface Statusesparameters - StatusesHomeTimelineRequestList[Tweet]public List<Tweet> lookup(StatusesLookupRequest parameters)
Statuseslookup in interface Statusesparameters - StatusesLookupRequestList[Tweet]public List<Tweet> mentionsTimeline(StatusesMentionsTimelineRequest parameters)
StatusesmentionsTimeline in interface Statusesparameters - StatusesMentionsTimelineRequestList[Tweet]public Tweet show(StatusesShowRequest parameters)
Statusesshow in interface Statusesparameters - StatusesShowRequestTweetpublic FriendsIdsResponse ids(FriendsIdsRequest parameters)
Friendsids in interface Friendsparameters - FriendsIdsRequestpublic FriendsListResponse list(FriendsListRequest parameters)
Friendslist in interface Friendsparameters - FriendsListRequestpublic FollowersIdsResponse ids(FollowersIdsRequest parameters)
Followersids in interface Followersparameters - FollowersIdsRequestpublic FollowersListResponse list(FollowersListRequest parameters)
Followerslist in interface Followersparameters - FollowersListRequestpublic List<User> lookup(UsersLookupRequest parameters)
Userslookup in interface Usersparameters - UsersLookupRequestList[User]public List<User> search(UsersSearchRequest parameters)
Userssearch in interface Usersparameters - UsersSearchRequestList[User]public User show(UsersShowRequest parameters)
Usersshow in interface UsersList[User]public List<Tweet> list(FavoritesListRequest parameters)
Favoriteslist in interface Favoritesparameters - FavoritesListRequestpublic AccountSettings settings()
Accountsettings in interface AccountAccountSettingspublic User verifyCredentials()
AccountverifyCredentials in interface AccountUserpublic User updateProfile(UpdateProfileRequest parameters)
AccountupdateProfile in interface AccountUserpublic AccountSettings updateSettings(UpdateProfileRequest parameters)
AccountupdateSettings in interface AccountAccountSettingspublic WelcomeMessagesListResponse listWelcomeMessages(WelcomeMessagesListRequest parameters)
WelcomeMessageslistWelcomeMessages in interface WelcomeMessagesWelcomeMessagesListResponsepublic WelcomeMessage showWelcomeMessage(Long id)
WelcomeMessagesshowWelcomeMessage in interface WelcomeMessagesWelcomeMessagepublic WelcomeMessageNewResponse newWelcomeMessage(WelcomeMessageNewRequest parameters)
WelcomeMessagesnewWelcomeMessage in interface WelcomeMessagesWelcomeMessagepublic void destroyWelcomeMessage(Long id)
WelcomeMessagesdestroyWelcomeMessage in interface WelcomeMessagespublic WelcomeMessageRulesListResponse listWelcomeMessageRules(WelcomeMessageRulesListRequest parameters)
WelcomeMessageRuleslistWelcomeMessageRules in interface WelcomeMessageRulesWelcomeMessageRulesListResponsepublic WelcomeMessageRule showWelcomeMessageRule(Long id)
WelcomeMessageRulesshowWelcomeMessageRule in interface WelcomeMessageRulesWelcomeMessageRulepublic WelcomeMessageRule newWelcomeMessageRule(WelcomeMessageNewRuleRequest body)
WelcomeMessageRulesnewWelcomeMessageRule in interface WelcomeMessageRulesWelcomeMessageRulepublic void destroyWelcomeMessageRule(Long id)
WelcomeMessageRulesdestroyWelcomeMessageRule in interface WelcomeMessageRulespublic List<Webhook> getWebhooks()
AccountActivitygetWebhooks in interface AccountActivitypublic Webhook registerWebhook(String url)
AccountActivityregisterWebhook in interface AccountActivitypublic Boolean deleteWebhook(Long webhookId)
AccountActivitydeleteWebhook in interface AccountActivitypublic Boolean putWebhook(Long webhookId)
AccountActivityputWebhook in interface AccountActivitywebhookId - Webhook ID. Defined in resource path.public Boolean getWebhookSubscription(Long webhookId)
AccountActivitygetWebhookSubscription in interface AccountActivitywebhookId - Webhook ID. Defined in resource path.public Boolean registerWebhookSubscriptions(Long webhookId)
AccountActivityregisterWebhookSubscriptions in interface AccountActivitywebhookId - Webhook ID. Defined in resource path.public Boolean deleteWebhookSubscriptions(Long webhookId)
AccountActivitydeleteWebhookSubscriptions in interface AccountActivitywebhookId - Webhook ID. Defined in resource path.public EventsListResponse listEvents(EventsListRequest parameters)
DirectMessageslistEvents in interface DirectMessagesparameters - EventsListRequestEventsListResponsepublic EventShowResponse showEvent(Long id)
DirectMessagesshowEvent in interface DirectMessagesEventShowResponsepublic DirectMessageEvent newEvent(MessageCreateRequest event)
DirectMessagesnewEvent in interface DirectMessagesevent - MessageCreateRequestDirectMessageEventpublic SevenDaySearchResponse sevenDaySearch(SevenDaySearchRequest event)
SevenDaySearchsevenDaySearch in interface SevenDaySearchSevenDaySearchResponsepublic ThirtyDaySearchResponse thirtyDaySearch(String environment, ThirtyDaySearchRequest searchRequest)
ThirtyDaySearchthirtyDaySearch in interface ThirtyDaySearchenvironment - "environment to use"searchRequest - ThirtyDaySearchRequestThirtyDaySearchResponsepublic ThirtyDaySearchCountsResponse thirtyDaySearchCounts(String environment, ThirtyDaySearchCountsRequest searchCountsRequest)
ThirtyDaySearchCountsthirtyDaySearchCounts in interface ThirtyDaySearchCountsenvironment - "environment to use"searchCountsRequest - ThirtyDaySearchCountsRequestThirtyDaySearchCountsResponsepublic DirectMessage destroy(Long id)
DirectMessagesdestroy in interface DirectMessagesid - The ID of the direct message to delete.DirectMessagepublic DirectMessage show(Long id)
DirectMessagesshow in interface DirectMessagesid - The ID of the direct message to delete.DirectMessagepublic List<DirectMessage> list(DirectMessagesListRequest parameters)
DirectMessageslist in interface DirectMessagesparameters - DirectMessagesListRequestList[DirectMessage]public List<DirectMessage> sent(DirectMessagesSentRequest parameters)
DirectMessagessent in interface DirectMessagesparameters - DirectMessagesSentRequestList[DirectMessage]public DirectMessage newDM(DirectMessageNewRequest parameters)
DirectMessagesnewDM in interface DirectMessagesparameters - DirectMessageNewRequestDirectMessagepublic List<SuggestedUserCategory> categories(String lang)
SuggestedUserscategories in interface SuggestedUserslang - Restricts the suggested categories to the requested language. The language must be specified by the appropriate two letter ISO 639-1 representation.List[SuggestedUserCategory]public SuggestedUserCategory suggestions(String slug, String lang)
SuggestedUserssuggestions in interface SuggestedUsersSuggestedUserCategorypublic List<User> members(String slug)
SuggestedUsersmembers in interface SuggestedUsersList[User]Copyright © 2018 The Apache Software Foundation. All rights reserved.