Newer Version Available
ChatterUsers Class
Namespace
ChatterUsers Methods
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
exportUserActivities(communityId, userId)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserActivitiesJob exportUserActivities(String communityId, String userId)
Parameters
Return Value
Usage
The following activities can be exported.
- Bookmark—User bookmarked a post.
- ChatterActivity—Total counts of posts and comments made and likes and comments received for a user.
- ChatterLike—User liked a post or comment.
- Comment—User commented on a post.
- CompanyVerify—User verified comment.
- DownVote—User downvoted a post or comment.
- FeedEntityRead—User read a post.
- FeedRead—User read a feed.
- Mute—User muted a post.
- Post—User made a post.
- TopicEndorsement—User endorsed another user on a topic or received endorsement on a topic.
- UpVote—User upvoted a post or comment.
follow(communityId, userId, subjectId)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.Subscription follow(String communityId, String userId, String subjectId)
Parameters
Return Value
Type: ConnectApi.Subscription
Example
Usage
This method creates an EntitySubscription record, which requires certain permissions. See the Usage section of the EntitySubscription object for more information.
getChatterSettings(communityId, userId)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserChatterSettings getChatterSettings(String communityId, String userId)
Parameters
Return Value
getFollowers(communityId, userId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowerPage getFollowers(String communityId, String userId)
Parameters
Return Value
Type: ConnectApi.FollowerPage
getFollowers(communityId, userId, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowerPage getFollowers(String communityId, String userId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.FollowerPage
getFollowings(communityId, userId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId)
Parameters
Return Value
getFollowings(communityId, userId, pageParam)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, Integer pageParam)
Parameters
Return Value
getFollowings(communityId, userId, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getFollowings(communityId, userId, filterType)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- filterType
- Type: String
- Specifies the key prefix to filter the type of objects returned. A key prefix is the first three characters of the object ID, which specifies the object type. For example, User objects have a prefix of 005 and Group objects have a prefix of 0F9.
Return Value
getFollowings(communityId, userId, filterType, pageParam)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType, Integer pageParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- filterType
- Type: String
- Specifies the key prefix to filter the type of objects returned. A key prefix is the first three characters of the object ID, which specifies the object type. For example, User objects have a prefix of 005 and Group objects have a prefix of 0F9.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
Return Value
getFollowings(communityId, userId, filterType, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FollowingPage getFollowings(String communityId, String userId, String filterType, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- filterType
- Type: String
- Specifies the key prefix to filter the type of objects returned. A key prefix is the first three characters of the object ID, which specifies the object type. For example, User objects have a prefix of 005 and Group objects have a prefix of 0F9.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getReputation(communityId, userId)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Reputation getReputation(String communityId, String userId)
Parameters
Return Value
Type: ConnectApi.Reputation
getUser(communityId, userId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserSummary getUser(String communityId, String userId)
Parameters
Return Value
Type: ConnectApi.UserDetail
Usage
getUserBatch(communityId, userIds)
API Version
31.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] getUserBatch(String communityId, List<String> userIds)
Parameters
Return Value
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.User object and errors for users that didn’t load.
Example
getUserGroups(communityId, userId)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupDetailPage getUserGroups(String communityId, String userId)
Parameters
Return Value
getUserGroups(communityId, userId, pageParam, pageSize)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupDetailPage getUserGroups(String communityId, String userId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getUsers(communityId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserPage getUsers(String communityId)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
Return Value
Type: ConnectApi.UserPage
getUsers(communityId, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserPage getUsers(String communityId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.UserPage
purgeUserActivities(communityId, userId)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserActivitiesJob purgeUserActivities(String communityId, String userId)
Parameters
Return Value
Usage
The following activities can be purged with this method.
- Bookmark—User bookmarked a post.
- ChatterActivity—Total counts of posts and comments made and likes and comments received for a user.
- ChatterLike—User liked a post or comment.
- CompanyVerify—User verified comment.
- DownVote—User downvoted a post or comment.
- FeedEntityRead—User read a post.
- FeedRead—User read a feed.
- Mute—User muted a post.
- TopicEndorsement—User endorsed another user on a topic or received endorsement on a topic.
- UpVote—User upvoted a post or comment.
To delete a user’s posts and comments, use these methods, respectively.
searchUserGroupDetails(communityId, userId, q)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupDetailPage searchUserGroupDetails(String communityId, String userId, String q)
Parameters
Return Value
searchUserGroupDetails(communityId, userId, q, pageParam, pageSize)
API Version
45.0
Available to Guest Users
45.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupDetailPage searchUserGroupDetails(String communityId, String userId, String q, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
searchUsers(communityId, q)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserPage searchUsers(String communityId, String q)
Parameters
Return Value
Type: ConnectApi.UserPage
Usage
searchUsers(communityId, q, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserPage searchUsers(String communityId, String q, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.UserPage
Usage
searchUsers(communityId, q, searchContextId, pageParam, pageSize)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserPage searchUsers(String communityId, String q, String searchContextId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- searchContextId
- Type: String
- A feed item ID that filters search results for feed @mentions. More useful results are listed first. When you specify this argument, you cannot query more than 500 results and you cannot use wildcards in the search term.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.UserPage
Usage
updateChatterSettings(communityId, userId, defaultGroupEmailFrequency)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserChatterSettings updateChatterSettings(String communityId, String userId, ConnectApi.GroupEmailFrequency defaultGroupEmailFrequency)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- defaultGroupEmailFrequency
- Type: ConnectApi.GroupEmailFrequency
- Frequency with which a user receives
email. Values are:
- EachPost
- DailyDigest
- WeeklyDigest
- Never
- UseDefault
Don’t pass the value UseDefault for the defaultGroupEmailFrequency parameter because calling updateChatterSettings sets the default value.
Return Value
updateUser(communityId, userId, userInput)
API Version
29.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserDetail updateUser(String communityId, String userId, ConnectApi.UserInput userInput)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- userInput
- Type: ConnectApi.UserInput
- Specifies the updated information.
Return Value
Type: ConnectApi.UserDetail
ChatterUsers Test Methods
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
setTestSearchUsers(communityId, q, result)
API Version
28.0
Signature
public static Void setTestSearchUsers(String communityId, String q, ConnectApi.UserPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- result
- Type: ConnectApi.UserPage
- Object containing test data.
Return Value
Type: Void
setTestSearchUsers(communityId, q, pageParam, pageSize, result)
API Version
28.0
Signature
public static Void setTestSearchUsers(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.UserPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
- result
- Type: ConnectApi.UserPage
- Object containing test data.
Return Value
Type: Void
setTestSearchUsers(communityId, q, searchContextId, pageParam, pageSize, result)
API Version
28.0
Signature
public static Void setTestSearchUsers(String communityId, String q, String searchContextId, Integer pageParam, Integer pageSize, ConnectApi.UserPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- searchContextId
- Type: String
- A feed item ID that filters search results for feed @mentions. More useful results are listed first. When you specify this argument, you cannot query more than 500 results and you cannot use wildcards in the search term.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
- result
- Type: ConnectApi.UserPage
- Object containing test data.
Return Value
Type: Void
Retired ChatterUsers Methods
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
getGroups(communityId, userId)
API Version
Available to Guest Users
32.0–44.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupPage getGroups(String communityId, String userId)
Parameters
Return Value
getGroups(communityId, userId, pageParam, pageSize)
API Version
28.0–44.0
Available to Guest Users
32.0–44.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupPage getGroups(String communityId, String userId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getPhoto(communityId, userId)
API Version
28.0–34.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Photo getPhoto(String communityId, String userId)
Parameters
Return Value
Type: ConnectApi.Photo
searchUserGroups(communityId, userId, q)
API Version
30.0–44.0
Available to Guest Users
32.0–44.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupPage searchUserGroups(String communityId, String userId, String q)
Parameters
Return Value
searchUserGroups(communityId, userId, q, pageParam, pageSize)
API Version
30.0–44.0
Available to Guest Users
32.0–44.0
Requires Chatter
Yes
Signature
public static ConnectApi.UserGroupPage searchUserGroups(String communityId, String userId, String q, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for a user.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
setPhoto(communityId, userId, fileId, versionNumber)
API Version
28.0–34.0
Requires Chatter
Yes
Signature
public static ConnectApi.Photo setPhoto(String communityId, String userId, String fileId, Integer versionNumber)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- fileId
- Type: String
- ID of a file already uploaded. The file must be an image, and be smaller than 2 GB.
- versionNumber
- Type: Integer
- Version number of the existing file. Specify either an existing version number, or null to get the latest version.
Return Value
Type: ConnectApi.Photo
Usage
Photos are processed asynchronously and might not be visible right away.
setPhoto(communityId, userId, fileUpload)
API Version
28.0–34.0
Requires Chatter
Yes
Signature
public static ConnectApi.Photo setPhoto(String communityId, String userId, ConnectApi.BinaryInput fileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- fileUpload
- Type: ConnectApi.BinaryInput
- File to use as the photo. The content type must be usable as an image.
Return Value
Type: ConnectApi.Photo
Usage
Photos are processed asynchronously and might not be visible right away.
setPhotoWithAttributes(communityId, userId, photo)
API Version
29.0–34.0
Requires Chatter
Yes
Signature
public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- photo
- Type: ConnectApi.PhotoInput
- A ConnectApi.PhotoInput object specifying the file ID, version number, and cropping parameters.
Return Value
Type: ConnectApi.Photo
Usage
Photos are processed asynchronously and might not be visible right away.
setPhotoWithAttributes(communityId, userId, photo, fileUpload)
API Version
29.0–34.0
Requires Chatter
Yes
Signature
public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String userId, ConnectApi.PhotoInput photo, ConnectApi.BinaryInput fileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- userId
- Type: String
- ID for the context user or the keyword me.
- photo
- Type: ConnectApi.PhotoInput
- A ConnectApi.PhotoInput object specifying the cropping parameters.
- fileUpload
- Type: ConnectApi.BinaryInput
- File to use as the photo. The content type must be usable as an image.
Return Value
Type: ConnectApi.Photo
Usage
Photos are processed asynchronously and might not be visible right away.