The following are methods for ChatterUsers. All methods are static.
28.0–34.0
public static Void deletePhoto(String communityId, String userId)
Type: Void
28.0
Yes
public static ConnectApi.Subscription follow(String communityId, String userId, String subjectId)
Type: ConnectApi.Subscription
28.0
Yes
public static ConnectApi.UserChatterSettings getChatterSettings(String communityId, String userId)
28.0
32.0
Yes
public static ConnectApi.FollowerPage getFollowers(String communityId, String userId)
Type: ConnectApi.FollowerPage
28.0
32.0
Yes
public static ConnectApi.FollowerPage getFollowers(String communityId, String userId, Integer pageParam, Integer pageSize)
Type: ConnectApi.FollowerPage
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId)
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, Integer pageParam)
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, Integer pageParam, Integer pageSize)
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType)
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType, Integer pageParam)
28.0
32.0
Yes
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType, Integer pageParam, Integer pageSize)
28.0
32.0
Yes
public static ConnectApi.UserGroupPage getGroups(String communityId, String userId)
28.0
32.0
Yes
public static ConnectApi.UserGroupPage getGroups(String communityId, String userId, Integer pageParam, Integer pageSize)
28.0–34.0
32.0
Yes
public static ConnectApi.Photo getPhoto(String communityId, String userId)
Type: ConnectApi.Photo
32.0
32.0
Yes
public static ConnectApi.Reputation getReputation(String communityId, String userId)
Type: ConnectApi.Reputation
28.0
32.0
Yes
public static ConnectApi.UserSummary getUser(String communityId, String userId)
Type: ConnectApi.UserDetail
31.0
32.0
Yes
public static ConnectApi.BatchResult[] getUserBatch(String communityId, List<String> userIds)
Type: BatchResult[]
The BatchResult getResults() method returns a ConnectApi.User object.
// Get users in an organization. ConnectApi.UserPage userPage = ConnectApi.ChatterUsers.getUsers(null); // Create a list of user IDs. List<String> userList = new List<String>(); for (ConnectApi.User user : userPage.users){ userList.add(user.id); } // Get info about all users in the list. ConnectApi.BatchResult[] batchResults = ConnectApi.ChatterUsers.getUserBatch(null, userList); for (ConnectApi.BatchResult batchResult : batchResults) { if (batchResult.isSuccess()) { // Operation was successful. // Print each user's username. ConnectApi.UserDetail user; if(batchResult.getResult() instanceof ConnectApi.UserDetail) { user = (ConnectApi.UserDetail) batchResult.getResult(); } System.debug('SUCCESS'); System.debug(user.username); } else { // Operation failed. Print errors. System.debug('FAILURE'); System.debug(batchResult.getErrorMessage()); } }
28.0
32.0
Yes
public static ConnectApi.UserPage getUsers(String communityId)
Type: ConnectApi.UserPage
28.0
32.0
Yes
public static ConnectApi.UserPage getUsers(String communityId, Integer pageParam, Integer pageSize)
Type: ConnectApi.UserPage
30.0
32.0
Yes
public static ConnectApi.UserGroupPage searchUserGroups(String communityId, String userId, String q)
Type: ConnectApi.UserGroupPage
A paginated list of groups the context user is a member of.
30.0
32.0
Yes
public static ConnectApi.UserGroupPage searchUserGroups(String communityId, String userId, String q, Integer pageParam, Integer pageSize)
Type: ConnectApi.UserGroupPage
A paginated list of groups the context user is a member of.
28.0
32.0
Yes
public static ConnectApi.UserPage searchUsers(String communityId, String q)
Type: ConnectApi.UserPage
28.0
32.0
Yes
public static ConnectApi.UserPage searchUsers(String communityId, String q, Integer pageParam, Integer pageSize)
Type: ConnectApi.UserPage
28.0
32.0
Yes
public static ConnectApi.UserPage searchUsers(String communityId, String q, String searchContextId, Integer pageParam, Integer pageSize)
Type: ConnectApi.UserPage
28.0–34.0
Yes
public static ConnectApi.Photo setPhoto(String communityId, String userId, String fileId, Integer versionNumber)
Type: ConnectApi.Photo
Photos are processed asynchronously and may not be visible right away.
28.0–34.0
Yes
public static ConnectApi.Photo setPhoto(String communityId, String userId, ConnectApi.BinaryInput fileUpload)
Type: ConnectApi.Photo
Photos are processed asynchronously and may not be visible right away.
29.0–34.0
Yes
public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo)
Type: ConnectApi.Photo
Photos are processed asynchronously and may not be visible right away.
29.0–34.0
Yes
public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo, ConnectApi.BinaryInput fileUpload)
Type: ConnectApi.Photo
Photos are processed asynchronously and may not be visible right away.
28.0
Yes
public static ConnectApi.UserChatterSettings updateChatterSettings(String communityId, String userId, ConnectApi.GroupEmailFrequency defaultGroupEmailFrequency)
Don’t pass the value UseDefault for the defaultGroupEmailFrequency parameter because calling updateChatterSettings sets the default value.
29.0
Yes
public static ConnectApi.UserDetail updateUser(String communityId, String userId, ConnectApi.UserInput userInput)
Type: ConnectApi.UserDetail
The following are the test methods for ChatterUsers. All methods are static.
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
28.0
public static Void setTestSearchUsers(String communityId, String q, ConnectApi.UserPage result)
Type: Void
28.0
public static Void setTestSearchUsers(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.UserPage result)
Type: Void
28.0
public static Void setTestSearchUsers(String communityId, String q, String searchContextId, Integer pageParam, Integer pageSize, ConnectApi.UserPage result)
Type: Void