Package twitter4j.v1

Interface FavoritesResources


public interface FavoritesResources
  • Method Summary

    Modifier and Type
    Method
    Description
    createFavorite(long id)
    Favorites the status specified in the ID parameter as the authenticating user.
    destroyFavorite(long id)
    Un-favorites the status specified in the ID parameter as the authenticating user.
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
    getFavorites(long userId)
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
    getFavorites(long userId, Paging paging)
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
    getFavorites(String screenName)
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
    getFavorites(String screenName, Paging paging)
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
    Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
  • Method Details

    • getFavorites

      ResponseList<Status> getFavorites() throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      This method calls https://api.twitter.com/1.1/favorites.json
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 2.0.1
      See Also:
    • getFavorites

      ResponseList<Status> getFavorites(long userId) throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      Parameters:
      userId - the id of the user for whom to request a list of favorite statuses
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 3.0.0
      See Also:
    • getFavorites

      ResponseList<Status> getFavorites(String screenName) throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      Parameters:
      screenName - the screen name of the user for whom to request a list of favorite statuses
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 2.0.1
      See Also:
    • getFavorites

      ResponseList<Status> getFavorites(Paging paging) throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      This method calls https://api.twitter.com/1.1/favorites.json
      Parameters:
      paging - controls pagination. Supports sinceId and page parameters.
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 2.2.5
      See Also:
    • getFavorites

      ResponseList<Status> getFavorites(long userId, Paging paging) throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      This method calls https://api.twitter.com/1.1/favorites/[id].json
      Parameters:
      userId - the id of the user for whom to request a list of favorite statuses
      paging - controls pagination. Supports sinceId and page parameters.
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 3.0.0
      See Also:
    • getFavorites

      ResponseList<Status> getFavorites(String screenName, Paging paging) throws TwitterException
      Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
      This method calls https://api.twitter.com/1.1/favorites/[id].json
      Parameters:
      screenName - the screen name of the user for whom to request a list of favorite statuses
      paging - controls pagination. Supports sinceId and page parameters.
      Returns:
      favorite statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 2.2.5
      See Also:
    • createFavorite

      Status createFavorite(long id) throws TwitterException
      Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.
      This method calls https://api.twitter.com/1.1/favorites/create/[id].json
      Parameters:
      id - the ID of the status to favorite
      Returns:
      created favorite status
      Throws:
      TwitterException - when Twitter service or network is unavailable
      See Also:
    • destroyFavorite

      Status destroyFavorite(long id) throws TwitterException
      Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.
      This method calls https://api.twitter.com/1.1/favorites/destroy/[id].json
      Parameters:
      id - the ID of the status to un-favorite
      Returns:
      destroyed statuses
      Throws:
      TwitterException - when Twitter service or network is unavailable
      See Also: