ChatterGroups Class

Information about groups, such as the group’s members, photo, and the groups the specified user is a member of. Add members to a group, remove members, and change the group photo.

ConnectApi

These methods are for ChatterGroups. All methods are static.

All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.

Add a user to a group as a standard member.

28.0

Yes

public static ConnectApi.GroupMember addMember(String communityId, String groupId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

userId

Type: String

ID for a user.

Type: ConnectApi.​GroupMember

To execute this method, the context user must be the group owner or moderator.

Add a user with a role to a group.

29.0

Yes

public static ConnectApi.GroupMember addMemberWithRole(String communityId, String groupId, String userId, ConnectApi.GroupMembershipType role)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

userId

Type: String

ID for a user.

role

Type: ConnectApi.GroupMembershipType

The group membership type. One of these values:

  • GroupManager
  • StandardMember

Type: ConnectApi.​GroupMember

To execute this method, the context user must be the group owner or moderator.

Associate a record with a group.

34.0

Yes

public static ConnectApi.GroupRecord addRecord(String communityId, String groupId, String recordId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID of the group with which to associate the record.

recordId

Type: String

ID of the record to associate with the group.

Type: ConnectApi.GroupRecord

Create a group.

29.0

Yes

public static ConnectApi.ChatterGroupDetail createGroup(String, communityId, ConnectApi.ChatterGroupInput groupInput)

communityId

Type: String,

ID for an Experience Cloud site, internal, or null.

groupInput

Type: ConnectApi.Chatter​​GroupInput

The properties of the group.

Type: ConnectApi.​Chatter​Group​Detail

Delete the group banner photo.

36.0

Yes

public static Void deleteBannerPhoto(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID of the group.

Type: Void

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Delete a group.

29.0

Yes

public static Void deleteGroup(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: Void

Remove a member from a group.

28.0

Yes

public static Void deleteMember(String communityId, String membershipId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

membershipId

Type: String

ID for a membership.

Type: Void

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Delete the group photo.

28.0

Yes

public static Void deletePhoto(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: Void

This method is only successful when the context user is the group manager or owner, or has Modify All Data permission.

Get the first page of announcements in a group.

31.0

Yes

public static ConnectApi.AnnouncementPage getAnnouncements(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.AnnouncementPage

To post an announcement, get information about an announcement, update the expiration date of an announcement, or delete an announcement, use the methods of the ConnectApi.Announcements class.

Get a page of announcements in a group.

31.0

Yes

public static ConnectApi.AnnouncementPage getAnnouncements(String communityId, String groupId, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

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.

Type: ConnectApi.AnnouncementPage

To post an announcement, get information about an announcement, update the expiration date of an announcement, or delete an announcement, use the methods of the ConnectApi.Announcements class.

Get the group banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto getBannerPhoto(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

The ID of the group.

Type: ConnectApi.BannerPhoto

Get information about a group.

28.0

31.0

Yes

public static ConnectApi.ChatterGroupDetail getGroup(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.​Chatter​Group​Detail

Get information about a list of groups.

31.0

Yes

public static ConnectApi.BatchResult[] getGroupBatch(String communityId, List<String> groupIds)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupIds

Type: List<String>

A list of up to 500 group IDs.

Type: ConnectApi.BatchResult[]

The ConnectApi.BatchResult.getResult() method returns a ConnectApi.ChatterGroup object and errors embedded in the results for groups that didn’t load.

See Also

Get information about a request to join a private group.

28.0

Yes

public static ConnectApi.GroupMembershipRequest getGroupMembershipRequest(String communityId, String requestId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

requestId

Type: String

The ID of a request to join a private group.

Type: ConnectApi.​Group​Membership​Request

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Get information about every request to join a private group.

28.0

Yes

public static ConnectApi.GroupMembershipRequests getGroupMembershipRequests(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.Group​​MembershipRequests

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Get information about every request to join a private group that has a specified status.

28.0

Yes

public static ConnectApi.GroupMembershipRequests getGroupMembershipRequests(String communityId, String groupId, ConnectApi.GroupMembershipRequestStatus status)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

status

Type: ConnectApi.​GroupMembership​RequestStatus

status—Status of a request to join a private group.

  • Accepted
  • Declined
  • Pending

Type: ConnectApi.Group​​MembershipRequests

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Get the first page of groups.

28.0

31.0

Yes

public static ConnectApi.ChatterGroupPage getGroups(String communityId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

Type: ConnectApi.Chatter​​​GroupPage

Get a page of groups.

28.0

31.0

Yes

public static ConnectApi.ChatterGroupPage getGroups(String communityId, Integer pageParam, Integer pageSize)

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.

Type: ConnectApi.Chatter​​​GroupPage

Get a page of groups with an archive status.

29.0

31.0

Yes

public static ConnectApi.ChatterGroupPage getGroups(String communityId, Integer pageParam, Integer pageSize, ConnectApi.GroupArchiveStatus archiveStatus)

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.

archiveStatus

Type: ConnectApi.GroupArchiveStatus

Archive status of groups.

  • All—All groups, including groups that are archived and groups that aren’t archived.
  • Archived—Groups that are archived.
  • NotArchived—Groups that aren’t archived.

If you pass in null, the default value is All.

Type: ConnectApi.Chatter​​​GroupPage

Get information about a group member.

28.0

Yes

public static ConnectApi.GroupMember getMember(String communityId, String membershipId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

membershipId

Type: String

ID for a membership.

Type: ConnectApi.​GroupMember

Get the first page of information about the members of a group.

28.0

36.0

Yes

public static ConnectApi.GroupMemberPage getMembers(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.Group​​MemberPage

Get a page of information about the members of a group.

28.0

36.0

Yes

public static ConnectApi.GroupMemberPage getMembers(String communityId, String groupId, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

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.

Type: ConnectApi.Group​​MemberPage

Get information about a list of group memberships.

31.0

Yes

public static ConnectApi.BatchResult[] getMembershipBatch(String communityId, List<String> membershipIds)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

membershipIds

Type: List<String>

A list of up to 500 group membership IDs.

Type: ConnectApi.BatchResult[]

The ConnectApi.BatchResult.getResult() method returns a ConnectApi.GroupMember object and errors embedded in the results for group memberships that didn’t load.

See Also

Get the context user’s Chatter settings for a group.

28.0

Yes

public static ConnectApi.GroupChatterSettings getMyChatterSettings(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.Group​​ChatterSettings

Get the photo for a group.

28.0

Yes

public static ConnectApi.Photo getPhoto(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.Photo

Get a record associated with a group.

34.0

Yes

public static ConnectApi.GroupRecord getRecord(String communityId, String groupRecordId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupRecordId

Type: String

ID of the group record.

Type: ConnectApi.GroupRecord

Get the first page of records associated with a group.

33.0

Yes

public static ConnectApi.GroupRecordPage getRecords(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.​GroupRecordPage

Get a page of records associated with a group.

33.0

Yes

public static ConnectApi.GroupRecordPage getRecords(String communityId, String groupId, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

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.

Type: ConnectApi.​GroupRecordPage

Invite internal and external users to join a group.

39.0

Yes

public static ConnectApi.Invitations inviteUsers(String groupId, ConnectApi.InviteInput invite)

groupId

Type: String

ID of the group.

invite

Type: ConnectApi.InviteInput

A ConnectApi.InviteInput body.

Type: ConnectApi.Invitations

Post an announcement to a group.

31.0

Yes

public static ConnectApi.Announcement postAnnouncement(String communityId, String groupId, ConnectApi.AnnouncementInput announcement)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

announcement

Type: ConnectApi.AnnouncementInput

A ConnectApi.AnnouncementInput object.

Type: ConnectApi.Announcement

Use an announcement to highlight information. Users can discuss, like, and post comments on announcements. Deleting the feed post deletes the announcement.

To post an announcement, get information about an announcement, update the expiration date of an announcement, or delete an announcement, use the methods of the ConnectApi.Announcements class.

Remove the association of a record with a group.

34.0

Yes

public static Void removeRecord(String communityId, String groupRecordId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupRecordId

Type: String

ID of the group record.

Type: Void

Request membership in a private group.

28.0

Yes

public static ConnectApi.GroupMembershipRequest requestGroupMembership(String communityId, String groupId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

Type: ConnectApi.​Group​Membership​Request

This sample code calls ConnectApi.ChatterGroups.requestGroupMembership to request to join a private group.

Get the first page of groups that match the search criteria.

28.0

31.0

Yes

public static ConnectApi.ChatterGroupPage searchGroups(String communityId, String q)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as null.

Type: ConnectApi.Chatter​​​GroupPage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

See Also

Get a page of groups that match the search criteria.

28.0

31.0

Yes

public static ConnectApi.ChatterGroupPage searchGroups(String communityId, String q, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as 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.

Type: ConnectApi.Chatter​​​GroupPage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

See Also

Get a page of groups with the archive status that match the search criteria.

29.0

31.0

Yes

public static ConnectApi.ChatterGroupPage searchGroups(String communityId, String q, ConnectApi.GroupArchiveStatus archiveStatus, Integer pageParam, Integer pageSize)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as null.

archiveStatus

Type: ConnectApi.GroupArchiveStatus

Archive status of groups.

  • All—All groups, including groups that are archived and groups that aren’t archived.
  • Archived—Groups that are archived.
  • NotArchived—Groups that aren’t archived.

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.

Type: ConnectApi.Chatter​​​GroupPage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). Use the set test method with the same parameters or the code throws an exception.

See Also

Set an uploaded file as the group banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhoto(String communityId, String groupId, String fileId, Integer versionNumber)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

The ID of the group.

fileId

Type: String

The ID of the already uploaded file. The key prefix must be 069, and the image must be smaller than 8 MB.

versionNumber

Type: Integer

Version number of the existing file. Specify either an existing version number or, to get the latest version, specify null.

Type: ConnectApi.BannerPhoto

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Set a file that hasn’t been uploaded as the group banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhoto(String communityId, String groupId, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

The ID of the group.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.BannerPhoto

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Set and crop an uploaded file as the group banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhotoWithAttributes(String communityId, String groupId, ConnectApi.BannerPhotoInput bannerPhoto)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

The ID of the group.

bannerPhoto

Type: ConnectApi.BannerPhotoInput

A ConnectApi.BannerPhotoInput object that specifies the ID and version of the file, and how to crop the file.

Type: ConnectApi.BannerPhoto

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Set and crop a file that hasn’t been uploaded as the group banner photo.

36.0

Yes

public static ConnectApi.BannerPhoto setBannerPhotoWithAttributes(String communityId, String groupId, ConnectApi.BannerPhotoInput bannerPhoto, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

The ID of the group.

bannerPhoto

Type: ConnectApi.BannerPhotoInput

A ConnectApi.BannerPhotoInput object specifying the cropping parameters.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.BannerPhoto

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Set an uploaded file as the group photo.

28.0

Yes

public static ConnectApi.Photo setPhoto(String communityId, String groupId, String fileId, Integer versionNumber)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

fileId

Type: String

ID of a file already uploaded. The key prefix must be 069, and the file must be an image that is smaller than 2 GB.

versionNumber

Type: Integer

Version number of the existing file. Specify either an existing version number or, to get the latest version, specify null.

Type: ConnectApi.Photo

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

When a group is created, it doesn’t have a group photo. You can set an existing photo that has already been uploaded to Salesforce as the group photo. The key prefix must be 069 and the file size must be less than 2 GB.

Set a file that hasn’t been uploaded as the group photo.

28.0

Yes

public static ConnectApi.Photo setPhoto(String communityId, String groupId, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.Photo

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

When a group is created, it doesn’t have a group photo. You can upload a photo and set it as the group photo.

Set and crop an uploaded file as the group photo.

29.0

Yes

public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String groupId, ConnectApi.PhotoInput photo)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

photo

Type: ConnectApi.PhotoInput

A ConnectApi.PhotoInput object that specifies the ID and version of the file, and how to crop the file.

Type: ConnectApi.Photo

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Set and crop a file that hasn’t been uploaded as the group photo.

29.0

Yes

public static ConnectApi.Photo setPhotoWithAttributes(String communityId, String groupId, ConnectApi.PhotoInput photo, ConnectApi.BinaryInput fileUpload)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

photo

Type: ConnectApi.PhotoInput

A ConnectApi.PhotoInput object that specifies how to crop the file specified in fileUpload.

fileUpload

Type: ConnectApi.Binary​​Input

File to use as the photo. The content type must be usable as an image.

Type: ConnectApi.Photo

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Photos are processed asynchronously and might not be visible right away.

Update the settings of a group.

28.0

Yes

public static ConnectApi.ChatterGroup updateGroup(String communityId, String groupId, ConnectApi.ChatterGroupInput groupInput)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

groupInput

Type: ConnectApi.Chatter​​GroupInput

A ConnectApi.ChatterGroupInput object.

Type: ConnectApi.ChatterGroup

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission. Use this method to update any settings in the ConnectApi.ChatterGroupInput class. These settings include the group title and text in the “Information” section, whether the group is public or private, and whether the group is archived.

This example archives a group.

Update the role of a group member.

29.0

Yes

public static ConnectApi.ChatterGroup updateGroupMember(String communityId, String membershipId, ConnectApi.GroupMembershipType role)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

membershipId

Type: String

ID for a membership.

role

Type: ConnectApi.GroupMembershipType

The group membership type. One of these values:

  • GroupManager
  • StandardMember

Type: ConnectApi.ChatterGroup

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

Update the context user’s email frequency for a group.

28.0

Yes

public static ConnectApi.GroupChatterSettings updateMyChatterSettings(String communityId, String groupId, ConnectApi.GroupEmailFrequency emailFrequency)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

groupId

Type: String

ID for a group.

emailFrequency

Type: ConnectApi.​GroupEmail​Frequency

Frequency with which a user receives email.

  • EachPost
  • DailyDigest
  • WeeklyDigest
  • Never
  • UseDefault

The value UseDefault uses the value set in a call to updateChatterSettings(communityId, userId, defaultGroupEmailFrequency).

Type: ConnectApi.Group​​ChatterSettings

Update a request to join a private group.

28.0

Yes

public static ConnectApi.GroupMembershipRequest updateRequestStatus(String communityId, String requestId, ConnectApi.GroupMembershipRequestStatus status)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

requestId

Type: String

ID for a request to join a private group.

status

Type: ConnectApi.​GroupMembership​RequestStatus

Status of the request:

  • Accepted
  • Declined

The Pending value of the enum is not valid in this method.

Type: ConnectApi.​Group​Membership​Request

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

This sample code calls ConnectApi.ChatterGroups.updateRequestStatus and passes it the membership request ID and an ConnectApi.GroupMembershipRequestStatus.Accepted status. You can also pass ConnectApi.GroupMembershipRequestStatus.Declined.

Update a request to join a private group and optionally provide a message when the request is denied.

35.0

Yes

public static ConnectApi.GroupMembershipRequest updateRequestStatus(String communityId, String requestId, ConnectApi.GroupMembershipRequestStatus status, String responseMessage)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

requestId

Type: String

ID for a request to join a private group.

status

Type: ConnectApi.GroupMembershipRequestStatus

Status of the request:

  • Accepted
  • Declined

The Pending value of the enum is not valid in this method.

responseMessage

Type: String

Provide a message to the user if their membership request is declined. The value of this property is used only when the value of the status property is Declined.

The maximum length is 756 characters.

Type: ConnectApi.​Group​Membership​Request

This method is successful only when the context user is the group manager or owner, or has Modify All Data permission.

These test methods are for ChatterGroups. All methods are static.

For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.

Register a ConnectApi.ChatterGroupPage object to be returned when the matching ConnectApi.searchGroups method is called in a test context. Use the test method with the same parameters or you receive an exception.

29.0

public static Void setTestSearchGroups(String communityId, String q, ConnectApi.ChatterGroupPage result)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as null.

result

Type: ConnectApi.Chatter​​​GroupPage

Test ConnectApi.ChatterGroupPage object.

Type: Void

See Also

Register a ConnectApi.ChatterGroupPage object to be returned when the matching ConnectApi.searchGroups method is called in a test context. Use the test method with the same parameters or you receive an exception.

28.0

public static Void setTestSearchGroups(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.ChatterGroupPage result)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as 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.

result

Type: ConnectApi.Chatter​​​GroupPage

Test ConnectApi.ChatterGroupPage object.

Type: Void

See Also

Register a ConnectApi.ChatterGroupPage object to be returned when the matching ConnectApi.searchGroups method is called in a test context. Use the test method with the same parameters or you receive an exception.

29.0

public static Void setTestSearchGroups(String communityId, String q, ConnectApi.GroupArchiveStatus, archiveStatus, Integer pageParam, Integer pageSize, ConnectApi.ChatterGroupPage result)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

q

Type: String

Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards. Can be specified as null.

archiveStatus

Type: ConnectApi.GroupArchiveStatus

Archive status of groups.

  • All—All groups, including groups that are archived and groups that aren’t archived.
  • Archived—Groups that are archived.
  • NotArchived—Groups that aren’t archived.

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.Chatter​​​GroupPage

Test ConnectApi.ChatterGroupPage object.

Type: Void

See Also