twitter4j.api
Interface ListMembersMethods

All Known Subinterfaces:
Twitter
All Known Implementing Classes:
TwitterImpl

public interface ListMembersMethods

Author:
Joern Huxhorn - jhuxhorn at googlemail.com

Method Summary
 UserList addUserListMember(int listId, long userId)
          Adds a member to a list.
 UserList addUserListMembers(int listId, long[] userIds)
          Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
 UserList addUserListMembers(int listId, java.lang.String[] screenNames)
          Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
 User checkUserListMembership(java.lang.String listOwnerScreenName, int listId, long userId)
          Check if a user is a member of the specified list.

This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json
 UserList deleteUserListMember(int listId, long userId)
          Removes the specified member from the list.
 PagableResponseList<User> getUserListMembers(long listOwnerId, int listId, long cursor)
          Returns the members of the specified list.
 PagableResponseList<User> getUserListMembers(java.lang.String listOwnerScreenName, int listId, long cursor)
          Returns the members of the specified list.
 

Method Detail

getUserListMembers

PagableResponseList<User> getUserListMembers(java.lang.String listOwnerScreenName,
                                             int listId,
                                             long cursor)
                                             throws TwitterException
Returns the members of the specified list.
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json

Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the members of the specified list.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
GET :user/:list_id/members | dev.twitter.com

getUserListMembers

PagableResponseList<User> getUserListMembers(long listOwnerId,
                                             int listId,
                                             long cursor)
                                             throws TwitterException
Returns the members of the specified list.
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json

Parameters:
listOwnerId - The id of the list owner
listId - The id of the list
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the members of the specified list.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
GET :user/:list_id/members | dev.twitter.com

addUserListMember

UserList addUserListMember(int listId,
                           long userId)
                           throws TwitterException
Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json

Parameters:
listId - The id of the list.
userId - The id of the user to add as a member of the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
POST :user/:list_id/members | dev.twitter.com

addUserListMembers

UserList addUserListMembers(int listId,
                            long[] userIds)
                            throws TwitterException
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
This method calls http://api.twitter.com/1/[user]/[list_id]/memgers/create_all.json

Parameters:
listId - The id of the list.
userIds - The array of ids of the user to add as member of the list. up to 100 are allowed in a single request.
Throws:
TwitterException
Since:
Twitter4J 2.1.7
See Also:
POST :user/:list_id/create_all | dev.twitter.com

addUserListMembers

UserList addUserListMembers(int listId,
                            java.lang.String[] screenNames)
                            throws TwitterException
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
This method calls http://api.twitter.com/1/[user]/[list_id]/members/create_all.json

Parameters:
listId - The id of the list.
screenNames - The array of screen names of the user to add as member of the list. up to 100 are allowed in a single request.
Throws:
TwitterException
Since:
Twitter4J 2.1.7
See Also:
POST :user/:list_id/create_all | dev.twitter.com

deleteUserListMember

UserList deleteUserListMember(int listId,
                              long userId)
                              throws TwitterException
Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json

Parameters:
listId - The id of the list.
userId - The screen name of the member you wish to remove from the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.0
See Also:
DELETE :user/:id/members | dev.twitter.com

checkUserListMembership

User checkUserListMembership(java.lang.String listOwnerScreenName,
                             int listId,
                             long userId)
                             throws TwitterException
Check if a user is a member of the specified list.

This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json

Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list.
userId - The id of the user who you want to know is a member or not of the specified list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.)
Since:
Twitter4J 2.1.0
See Also:
GET :user/:list_id/members/:id | dev.twitter.com