twitter4j.api

## Interface TweetsResources

All Known Subinterfaces:
  Twitter

    public interface TweetsResources

Author:
  Joern Huxhorn - jhuxhorn at googlemail.com

### Method Summary

All Methods Instance Methods Abstract Methods
`Status` `destroyStatus(long statusId)` Destroys the status specified by the required ID parameter. Usage note: The authenticating user must be the author of the specified status.
`OEmbed` `getOEmbed(OEmbedRequest req)` Returns information allowing the creation of an embedded representation of a Tweet on third party sites.
`IDs` `getRetweeterIds(long statusId, int count, long cursor)` Returns a collection of up to `count` user IDs belonging to users who have retweeted the tweet specified by the id parameter.
`IDs` `getRetweeterIds(long statusId, long cursor)` Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.
`ResponseList<Status>` `getRetweets(long statusId)` Returns up to 100 of the first retweets of a given tweet.
`ResponseList<Status>` `lookup(long... ids)` Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by comma-separated values passed to the id parameter.
`Status` `retweetStatus(long statusId)` Retweets a tweet.
`Status` `showStatus(long id)` Returns a single status, specified by the id parameter below.
`Status` `unRetweetStatus(long statusId)` Untweets a retweeted status.
`Status` `updateStatus(StatusUpdate latestStatus)` Updates the authenticating user's status.
`Status` `updateStatus(String status)` Updates the authenticating user's status.
`UploadedMedia` `uploadMedia(File mediaFile)` Uploads media image to be attached via `updateStatus(twitter4j.StatusUpdate)` This method calls https://api.twitter.com/1.1/media/upload.json
`UploadedMedia` `uploadMedia(String fileName, InputStream media)` Uploads media image to be attached via `updateStatus(twitter4j.StatusUpdate)` This method calls https://api.twitter.com/1.1/media/upload.json
`UploadedMedia` `uploadMediaChunked(String fileName, InputStream media)` Uploads media using chunked approach to be attached via `updateStatus(twitter4j.StatusUpdate)`.

### Method Detail

#### getRetweets

    ResponseList<Status> getRetweets(long statusId)
                              throws TwitterException

Returns up to 100 of the first retweets of a given tweet.
This method calls https://api.twitter.com/1.1/statuses/retweets

Parameters:
  `statusId` - The numerical ID of the tweet you want the retweets of.
Returns:
  the retweets of a given tweet
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 2.0.10
See Also:
  Tweets Resources › statuses/retweets/:id

#### getRetweeterIds

    IDs getRetweeterIds(long statusId,
                        long cursor)
                 throws TwitterException

Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.
This method calls https://api.twitter.com/1.1/get/statuses/retweeters/ids

Parameters:
  `statusId` - The numerical ID of the tweet you want the retweeters of.
  `cursor` - The cursor of the page to fetch. Use -1 to start.
Returns:
  the retweets of a given tweet
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 3.0.5
See Also:
  Tweets Resources › statuses/retweeters/ids

#### getRetweeterIds

    IDs getRetweeterIds(long statusId,
                        int count,
                        long cursor)
                 throws TwitterException

Returns a collection of up to `count` user IDs belonging to users who have retweeted the tweet specified by the id parameter.
This method calls https://api.twitter.com/1.1/get/statuses/retweeters/ids

Parameters:
  `statusId` - The numerical ID of the tweet you want the retweeters of.
  `count` - The maximum number of retweeter IDs to retrieve. Must be between 1 and 200, inclusive.
  `cursor` - The cursor of the page to fetch. Use -1 to start.
Returns:
  the retweets of a given tweet
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 3.0.5
See Also:
  Tweets Resources › statuses/retweeters/ids

#### showStatus

    Status showStatus(long id)
               throws TwitterException

Returns a single status, specified by the id parameter below. The status's author will be returned inline.
This method calls https://api.twitter.com/1.1/statuses/show

Parameters:
  `id` - the numerical ID of the status you're trying to retrieve
Returns:
  a single status
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 2.0.1
See Also:
  GET statuses/show/:id | Twitter Developers

#### destroyStatus

    Status destroyStatus(long statusId)
                  throws TwitterException

Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status.
This method calls https://api.twitter.com/1.1/statuses/destroy

Parameters:
  `statusId` - The ID of the status to destroy.
Returns:
  the deleted status
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  1.0.5
See Also:
  POST statuses/destroy/:id | Twitter Developers

#### updateStatus

    Status updateStatus(String status)
                 throws TwitterException

Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls https://api.twitter.com/1.1/statuses/update

Parameters:
  `status` - the text of your status update
Returns:
  the latest status
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 2.0.1
See Also:
  POST statuses/update | Twitter Developers

#### updateStatus

    Status updateStatus(StatusUpdate latestStatus)
                 throws TwitterException

Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls https://api.twitter.com/1.1/statuses/update or
This method calls https://upload.twitter.com/1/statuses/update_with_media

Parameters:
  `latestStatus` - the latest status to be updated.
Returns:
  the latest status
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 2.1.1
See Also:
  POST statuses/update | Twitter Developers

#### retweetStatus

    Status retweetStatus(long statusId)
                  throws TwitterException

Retweets a tweet. Returns the original tweet with retweet details embedded.
This method calls https://api.twitter.com/1.1/statuses/retweet

Parameters:
  `statusId` - The ID of the status to retweet.
Returns:
  the retweeted status
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 2.0.10
See Also:
  POST statuses/retweet/:id | Twitter Developers

#### unRetweetStatus

    Status unRetweetStatus(long statusId)
                    throws TwitterException

Untweets a retweeted status. Returns the original Tweet with retweet details embedded.
This method calls https://api.twitter.com/1.1/statuses/unretweet

Parameters:
  `statusId` - The ID of the status to un-retweet.
Returns:
  the original Tweet with retweet details embedded
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 4.0.7
See Also:
  POST statuses/unretweet/:id | Twitter Developers

#### getOEmbed

    OEmbed getOEmbed(OEmbedRequest req)
              throws TwitterException

Returns information allowing the creation of an embedded representation of a Tweet on third party sites. See the oEmbed specification for information about the response format. While this endpoint allows a bit of customization for the final appearance of the embedded Tweet, be aware that the appearance of the rendered Tweet may change over time to be consistent with Twitter's Display Requirements. Do not rely on any class or id parameters to stay constant in the returned markup.
This method calls https://api.twitter.com/1.1/statuses/oembed.json

Parameters:
  `req` - request
Returns:
  information allowing the creation of an embedded representation of a Tweet on third party sites
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 3.0.2
See Also:
  GET statuses/oembed | Twitter Developers

#### lookup

    ResponseList<Status> lookup(long... ids)
                         throws TwitterException

Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by comma-separated values passed to the id parameter. This method is especially useful to get the details (hydrate) a collection of Tweet IDs.
This method calls https://api.twitter.com/1.1/statuses/lookup.json

Parameters:
  `ids` - array of the ids to lookup
Returns:
  list of the tweets
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 4.0.2
See Also:
  GET statuses/lookup

#### uploadMedia

    UploadedMedia uploadMedia(File mediaFile)
                       throws TwitterException

Uploads media image to be attached via `updateStatus(twitter4j.StatusUpdate)`
This method calls https://api.twitter.com/1.1/media/upload.json

Parameters:
  `mediaFile` - the latest status to be updated.
Returns:
  upload result
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 4.0.2
See Also:
  POST statuses/update | Twitter Developers, Multiple Media Entities in Statuses

#### uploadMedia

    UploadedMedia uploadMedia(String fileName,
                              InputStream media)
                       throws TwitterException

Uploads media image to be attached via `updateStatus(twitter4j.StatusUpdate)`
This method calls https://api.twitter.com/1.1/media/upload.json

Parameters:
  `fileName` - media file name
  `media` - media body as stream
Returns:
  upload result
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 4.0.3
See Also:
  POST statuses/update | Twitter Developers, Multiple Media Entities in Statuses

#### uploadMediaChunked

    UploadedMedia uploadMediaChunked(String fileName,
                                     InputStream media)
                              throws TwitterException

Uploads media using chunked approach to be attached via `updateStatus(twitter4j.StatusUpdate)`. This should be used for videos.
This method calls https://api.twitter.com/1.1/media/upload.json

Parameters:
  `fileName` - media file name
  `media` - media body as stream
Returns:
  upload result
Throws:
  `TwitterException` - when Twitter service or network is unavailable
Since:
  Twitter4J 4.0.7
See Also:
  Uploading Media | Twitter Developers, POST statuses/update | Twitter Developers, Multiple Media Entities in Statuses