ChatterFeeds Class
Get, post, and delete feed elements, likes, comments, and bookmarks. You can also search feed elements, share feed elements, and vote on polls.
The Chatter feed is a container of feed elements. The abstract class ConnectApi.FeedElement is a parent class to the ConnectApi.FeedItem class, representing feed posts, and the ConnectApi.GenericFeedElement class, representing bundles and recommendations in the feed. For detailed information, see Working with Feeds and Feed Elements.
Feed item methods aren’t available in version 32.0. In version 32.0 and later, use feed element methods.
Message segments in a feed item are typed as ConnectApi.MessageSegment. Feed item capabilities are typed as ConnectApi.FeedItemCapability. Record fields are typed as ConnectApi.AbstractRecordField. These classes are all abstract and have several concrete subclasses. At runtime you can use instanceof to check the concrete types of these objects and then safely proceed with the corresponding downcast. When you downcast, you must have a default case that handles unknown subclasses.
The composition of a feed can change between releases. Write your code to handle instances of unknown subclasses.
These methods are for ChatterFeeds. All methods are static.
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
-
createStream(communityId, streamInput)
Create a Chatter feed stream.
-
deleteComment(communityId, commentId)
Delete a comment.
-
deleteFeedElement(communityId, feedElementId)
Delete a feed element.
-
deleteLike(communityId, likeId)
Delete a like on a comment or post.
-
deleteStream(communityId, streamId)
Delete a Chatter feed stream.
-
getComment(communityId, commentId)
Get a comment.
-
getCommentBatch(communityId, commentIds)
Get a list of comments.
-
getCommentInContext(communityId, commentId, pageSize)
Get a threaded comment in the context of its parent comments and post.
-
getCommentsForFeedElement(communityId, feedElementId)
Get comments for a feed element.
-
getCommentsForFeedElement(communityId, feedElementId, threadedCommentsCollapsed)
Get comments in a threaded style for a feed element.
-
getCommentsForFeedElement(communityId, feedElementId, pageParam, pageSize)
Get a page of comments for a feed element.
-
Get a page of comments in a threaded style for a feed element.
-
getCommentsForFeedElement(communityId, feedElementId, threadedCommentsCollapsed, sortParam)
Get sorted comments in a threaded style for a feed element.
-
Get a page of sorted comments in a threaded style for a feed element.
-
getCommentsForFeedElement(communityId, feedElementId, sortParam)
Get sorted comments for a feed element.
-
getCommentsForFeedElement(communityId, feedElementId, sortParam, threadedCommentsCollapsed)
Get sorted comments in a threaded style for a feed element.
-
getExtensions(communityId, pageParam, pageSize)
Get extensions.
-
getFeed(communityId, feedType)
Get a feed.
-
getFeed(communityId, feedType, sortParam)
Get a sorted feed.
-
getFeed(communityId, feedType, subjectId)
Get a feed for a record or user.
-
getFeed(communityId, feedType, subjectId, sortParam)
Get a sorted feed for a record or user.
-
Get a list of all feeds available to the context user.
-
getFeedElement(communityId, feedElementId)
Get a feed element.
-
getFeedElement(communityId, feedElementId, commentSort)
Get a feed element with sorted comments.
-
getFeedElement(communityId, feedElementId, threadedCommentsCollapsed)
Get a feed element and its comments in a threaded style.
-
getFeedElement(communityId, feedElementId, threadedCommentsCollapsed, commentSort)
Get a feed element and its sorted comments in a threaded style.
-
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle)
Get a feed element with the specified number of elements per bundle including no more than the specified number of comments per feed element.
-
Get a feed element with its comments in a threaded style with the specified number of elements per bundle and comments per feed element.
-
Get a feed element with its sorted comments in a threaded style with the specified number of elements per bundle and comments per feed element.
-
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle, commentSort)
Get a feed element with the specified number of elements per bundle including no more than the specified number of sorted comments per feed element.
-
getFeedElementBatch(communityId, feedElementIds)
Get a list of feed elements.
-
getFeedElementPoll(communityId, feedElementId)
Get the poll associated with a feed element.
-
getFeedElementsFromBundle(communityId, feedElementId)
Get feed elements from a bundle.
-
Get a page of feed elements from a bundle. Specify the number of elements per bundle and include no more than the specified number of comments per feed element.
-
getFeedElementsFromFeed(communityId, feedType)
Get feed elements from the
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReviewfeeds. -
getFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
Get a page of sorted feed elements from the
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReviewfeeds. -
Get a page of sorted feed elements from the
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReviewfeeds. Each feed element contains no more than the specified number of comments. -
Get a page of sorted and filtered feed elements from the
Homefeed. Each feed element contains no more than the specified number of comments. -
Get a page of filtered and sorted feed elements with comments in a threaded style from the
Homefeed. Each feed element contains no more than the specified number of comments. -
getFeedElementsFromFeed(communityId, feedType, subjectId)
Get feed elements from any feed other than
Company,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReviewfor a user or record. -
getFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
Get a page of sorted feed elements from any feed other than
Company,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview. -
Get a page of sorted feed elements from any feed other than
Company,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview. Each feed element includes no more than the specified number of comments. -
Get a page of sorted feed elements from a record feed. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements from the
UserProfilefeed. -
Get a page of feed elements with comments in a threaded style from the
UserProfilefeed. -
Get a page of sorted and filtered feed elements from the case feed.
-
Get a page of sorted feed elements from a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements from a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements with comments in a threaded style for a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements from a case feed.
-
Get a page of filtered and sorted feed elements with comments in a threaded style from a case feed.
-
getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix)
Get feed elements from a feed filtered by a key prefix for a user.
-
getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
Get a page of sorted feed elements from a feed filtered by a key prefix for a user.
-
Get a page of sorted feed elements from a feed filtered by a key prefix for a user. Each feed element contains no more than the specified number of comments.
-
Get a page of feed elements from a feed filtered by a key prefix for a user. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
-
Get a page of feed elements from the
Company,DirectMessageModeration,Home, andModerationfeeds. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments. -
Get a page of filtered feed elements from the
Homefeed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments. -
Get a page of feed elements from the
Files,Groups,News,People, andRecordfeeds. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments. -
Get a page of feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of filtered feed elements from a
UserProfilefeed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. -
Get a page of filtered feed elements from a case feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
-
Get a page of feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify the maximum number of feed elements in a bundle and whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of filtered feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify the maximum number of feed elements in a bundle and whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of filtered feed elements from a case feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
-
getFeedWithFeedElements(communityId, feedType, pageSize)
Get information about a feed and a page of feed elements from the feed.
-
getFeedWithFeedElements(communityId, feedType, pageSize, recentCommentCount)
Get a page of information about the feed and the feed elements with the specified number of comments per feed element from the feed.
-
getFilterFeed(communityId, subjectId, keyPrefix)
Get a feed filtered by a key prefix for a user.
-
getFilterFeed(communityId, subjectId, keyPrefix, sortParam)
Get a sorted feed filtered by a key prefix for a user.
-
getFilterFeedDirectory(communityId, subjectId)
Get a feed directory of filter feeds available to the context user.
-
Get a like on a post or comment.
-
getLikesForComment(communityId, commentId)
Get likes for a comment.
-
getLikesForComment(communityId, commentId, pageParam, pageSize)
Get a page of likes for a comment.
-
getLikesForFeedElement(communityId, feedElementId)
Get likes for a feed element.
-
getLikesForFeedElement(communityId, feedElementId, pageParam, pageSize)
Get a page of likes for a feed element.
-
getLinkMetadata(communityId, urls)
Get link metadata for URLs.
-
getPinnedFeedElementsFromFeed(communityId, feedType, subjectId)
Get pinned feed elements from a group or topic feed.
-
getReadByForFeedElement(communityId, feedElementId)
Get information about who read a feed element and when.
-
getReadByForFeedElement(communityId, feedElementId, pageParam, pageSize)
Get a page of information about who read a feed element and when.
-
getRelatedPosts(communityId, feedElementId, filter, maxResults)
Get posts related to the context feed element.
-
getStream(communityId, streamId)
Get information about a Chatter feed stream.
-
getStream(communityId, streamId, globalScope)
Get information about a Chatter feed stream, regardless of Experience Cloud site.
-
Get the Chatter feed streams for the context user.
-
getStreams(communityId, sortParam)
Get and sort the Chatter feed streams for the context user.
-
getStreams(communityId, pageParam, pageSize)
Get a page of Chatter feed streams for the context user.
-
getStreams(communityId, pageParam, pageSize, sortParam)
Get a sorted page of Chatter feed streams for the context user.
-
getStreams(communityId, pageParam, pageSize, sortParam, globalScope)
Get a sorted page of Chatter feed streams from all Enterprise Cloud sites for the context user.
-
Get supported emojis for the org.
-
getThreadsForFeedComment(communityId, commentId)
Get threaded comments for a comment.
-
getThreadsForFeedComment(communityId, commentId, pageParam, pageSize)
Get a page of threaded comments for a comment.
-
getThreadsForFeedComment(communityId, commentId, threadedCommentsCollapsed)
Access the comments capability for a comment.
-
getTopUnansweredQuestions(communityId) (Pilot)
Get top unanswered questions for the context user in aExperience Cloud site.
-
getTopUnansweredQuestions(communityId, filter) (Pilot)
Get filtered top unanswered questions for the context user in an Experience Cloud site.
-
getTopUnansweredQuestions(communityId, pageSize) (Pilot)
Get a page of top unanswered questions for the context user in an Experience Cloud site.
-
getTopUnansweredQuestions(communityId, filter, pageSize) (Pilot)
Get a page of filtered top unanswered questions for the context user in an Experience Cloud site.
-
getVotesForComment(communityId, commentId, vote)
Get the first page of users who upvoted or downvoted a comment.
-
getVotesForComment(communityId, commentId, vote, pageParam, pageSize)
Get a page of users who upvoted or downvoted a comment.
-
getVotesForFeedElement(communityId, feedElementId, vote)
Get the first page of users who upvoted or downvoted a feed element.
-
getVotesForFeedElement(communityId, feedElementId, vote, pageParam, pageSize)
Get a page of users who upvoted or downvoted a feed element.
-
isCommentEditableByMe(communityId, commentId)
Discover whether the context user can edit a comment.
-
isFeedElementEditableByMe(communityId, feedElementId)
Discover whether the context user can edit a feed element.
-
isModified(communityId, feedType, subjectId, since)
Discover whether a news feed has been updated or changed. Use this method to poll a news feed for updates.
-
likeComment(communityId, commentId)
Like a comment for the context user.
-
likeFeedElement(communityId, feedElementId)
Like a feed element.
-
postCommentToFeedElement(communityId, feedElementId, text)
Post a plain-text comment to a feed element.
-
postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload)
Post a rich-text comment to a feed element. Use this method to include mentions and to attach a file.
-
postFeedElement(communityId, subjectId, feedElementType, text)
Post a plain-text feed element.
-
postFeedElement(communityId, feedElement)
Post a rich-text feed element. Include mentions and hashtag topics, attach already uploaded files to a feed element, and associate action link groups with a feed element. You can also use this method to share a feed element and add a comment.
-
postFeedElementBatch(communityId, feedElements)
Post a list of feed elements.
-
publishDraftFeedElement(communityId, feedElementId, feedElement)
Publish a draft feed element.
-
searchFeedElements(communityId, q)
Get the first page of feed elements that match the search criteria.
-
searchFeedElements(communityId, q, sortParam)
Get the first page of sorted feed elements that match the search criteria.
-
searchFeedElements(communityId, q, threadedCommentsCollapsed)
Get the feed elements and comments that match the search criteria.
-
searchFeedElements(communityId, q, pageParam, pageSize)
Get a page of feed elements that match the search criteria.
-
searchFeedElements(communityId, q, pageParam, pageSize, sortParam)
Get a page of sorted feed elements that match the search criteria.
-
searchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed)
Get a page of feed elements with comments in a threaded style that match the search criteria.
-
searchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
Get a page of sorted feed elements that match the search criteria. Each feed element includes no more than the specified number of comments.
-
searchFeedElementsInFeed(communityId, feedType, q)
Get the feed elements from the
Company,DirectMessageModeration,Home,Isolated,Moderation, andPendingReviewfeeds that match the search criteria. -
searchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
Get a page of sorted feed elements from the
Company,DirectMessageModeration,Home,Isolated,Moderation, andPendingReviewfeeds that match the search criteria. -
Get a page of sorted feed elements from the
Company,DirectMessageModeration,Home,Isolated,Moderation, andPendingReviewfeeds that match the search criteria. Each feed element includes no more than the specified number of comments. -
Get a page of sorted and filtered feed elements from the
Homefeed that match the search criteria. Each feed element includes no more than the specified number of comments. -
searchFeedElementsInFeed(communityId, feedType, subjectId, q)
Search up to 5,000 of the most recent feed elements in a feed for a subject ID that match the search string. Feed elements are returned in order of most recent activity.
-
searchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
Get a page of sorted feed elements from a feed for a record or user that match the search criteria.
-
Get a page of sorted feed elements from a feed that match the search criteria. Each feed element includes no more than the specified number of comments.
-
Get a page of sorted and filtered feed elements from a
UserProfilefeed that match the search criteria. -
Get a page of sorted and filtered feed elements from a case feed that match the search criteria.
-
Get a page of sorted feed elements from a feed for a record or user that match the search criteria. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements from a feed for a record or user that match the search criteria. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
-
Get a page of sorted and filtered feed elements from a case feed that match the search criteria.
-
searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q)
Get the feed elements from a feed filtered by a key prefix that match the search criteria.
-
searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
Get a page of sorted feed elements from a feed filtered by a key prefix that match the search criteria.
-
Get a page of sorted feed elements from a feed filtered by a key prefix that match the search criteria. Each feed element includes no more than the specified number of comments.
-
Search the Chatter feed streams for the context user.
-
searchStreams(communityId, q, sortParam)
Search and sort the Chatter feed streams for the context user.
-
searchStreams(communityId, q, pageParam, pageSize)
Search the Chatter feed streams for the context user and return a page of results.
-
searchStreams(communityId, q, pageParam, pageSize, sortParam)
Search the Chatter feed streams for the context user and return a sorted page of results.
-
searchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope)
Search the Chatter feed streams from all Experience Cloud sites for the context user and return a sorted page of results.
-
setCommentIsVerified(communityId, commentId, isVerified)
Mark a comment as verified or unverified.
-
setCommentIsVerifiedByAnonymized(communityId, commentId, isVerified, isVerifiedByAnonymized)
Mark a comment as verified by an anonymous user.
-
setCommentVote(communityId, commentId, upDownVote)
Upvote or downvote a comment.
-
setFeedCommentStatus(communityId, commentId, status)
Set the status of a comment.
-
setFeedElementIsClosed(communityId, feedElementId, isClosed)
Set a feed element to closed.
-
setFeedElementVote(communityId, feedElementId, upDownVote)
Upvote or downvote a feed element.
-
setFeedEntityStatus(communityId, feedElementId, status)
Set the status of a feed post.
-
setIsMutedByMe(communityId, feedElementId, isMutedByMe)
Mute or unmute a feed element.
-
setIsReadByMe(communityId, feedElementId, readBy)
Mark a feed element as read for the context user using an input class.
-
setIsReadByMe(communityId, feedElementId, isReadByMe)
Mark a feed element as read for the context user.
-
updateComment(communityId, commentId, comment)
Edit a comment.
-
updateDirectMessage(communityId, feedElementId, directMessage)
Update the members of a direct message.
-
updateFeedElement(communityId, feedElementId, feedElement)
Edit a feed element.
-
updateFeedElementBookmarks(communityId, feedElementId, bookmarks)
Bookmark a feed element or remove a bookmark from a feed element using an input class.
-
updateFeedElementBookmarks(communityId, feedElementId, isBookmarkedByCurrentUser)
Bookmark a feed element or remove a bookmark from a feed element.
-
updateFeedElementReadByCapabilityBatch(communityId, feedElementIds, readBy)
Mark multiple feed elements as read by the context user at the same time using an input class.
-
updateFeedElementReadByCapabilityBatch(communityId, feedElementIds, isReadByMe)
Mark multiple feed elements as read by the context user at the same time.
-
updateLikeForComment(communityId, commentId, isLikedByCurrentUser)
Like or unlike a comment.
-
updateLikeForFeedElement(communityId, feedElementId, isLikedByCurrentUser)
Like or unlike a feed element.
-
updatePinnedFeedElements(communityId, feedType, subjectId, pin)
Pin or unpin feed elements to a group or topic feed.
-
updateStream(communityId, streamId, streamInput)
Update a Chatter feed stream.
-
voteOnFeedElementPoll(communityId, feedElementId, myChoiceId)
Vote on a poll or change your vote on a poll.
Create a Chatter feed stream.
39.0
Yes
public static ConnectApi.ChatterStream createStream(String communityId, ConnectApi.ChatterStreamInput streamInput)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- streamInput
Type:
ConnectApi.ChatterStreamInputA
ConnectApi.ChatterStreamInputbody.
Type: ConnectApi.ChatterStream
Delete a comment.
28.0
Yes
public static Void deleteComment(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID for a comment.
Type: Void
Delete a feed element.
31.0
Yes
public static deleteFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: Void
Delete a like on a comment or post.
28.0
Yes
public static Void deleteLike(String communityId, String likeId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- likeId
Type: String
ID for a like.
Type: Void
Delete a Chatter feed stream.
39.0
Yes
public static Void deleteStream(String communityId, String streamId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- streamId
Type: String
ID of the Chatter feed stream.
Type: Void
Get a comment.
28.0
31.0
Yes
public static ConnectApi.Comment getComment(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID for a comment.
Type: ConnectApi.Comment
Get a list of comments.
42.0
Yes
public static ConnectApi.BatchResult[] getCommentBatch(String communityId, List<String> commentIds)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentIds
Type: List<String>
A list of up to 100 comment IDs.
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.Comment object and errors for comments that didn’t load.
Get a threaded comment in the context of its parent comments and post.
44.0
44.0
Yes
public static ConnectApi.FeedElement getCommentInContext(String communityId, String commentId, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. If you don’t specify a value, the default size is 25.
Type: ConnectApi.FeedElement
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
Get comments for a feed element.
32.0
32.0
Yes
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get comments in a threaded style for a feed element.
44.0
44.0
Yes
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get a page of comments for a feed element.
32.0
32.0
Yes
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of comments per page. Valid values are from 1 through 100. If you pass
null, the default size is 25.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get a page of comments in a threaded style for a feed element.
44.0
44.0
Yes
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of comments per page. Valid values are from 1 through 100. If you pass
null, the default size is 25.- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get sorted comments in a threaded style for a feed element.
44.0
44.0
Yes
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
sortParam
Type: ConnectApi.FeedCommentSortOrder
Order of comments. Values are:
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get a page of sorted comments in a threaded style for a feed element.
44.0
44.0
Yes
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of comments per page. Valid values are from 1 through 100. If you pass null, the default size is 25.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
sortParam
Type: ConnectApi.FeedCommentSortOrder
Order of comments. Values are:
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get sorted comments for a feed element.
41.0
41.0
Yes
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
sortParam
Type: ConnectApi.FeedCommentSortOrder
Order of comments. Values are:
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
Type: ConnectApi.CommentsCapability
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get sorted comments in a threaded style for a feed element.
44.0
44.0
Yes
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder sortParam, Boolean threadedCommentsCollapsed)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
sortParam
Type: ConnectApi.FeedCommentSortOrder
Order of comments. Values are:
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
Type: ConnectApi.CommentsCapability
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Get extensions.
40.0
40.0
Yes
public static ConnectApi.ExtensionDefinitions getExtensions(String communityId, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 through 100. The default size is 15.
Type: ConnectApi.ExtensionDefinitions
Get a feed.
28.0
32.0
Yes
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.
Type: ConnectApi.Feed
Get a sorted feed.
28.0
32.0
Yes
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Type: ConnectApi.Feed
Get a feed for a record or user.
28.0
32.0
Yes
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.
Type: ConnectApi.Feed
Get a sorted feed for a record or user.
28.0
32.0
Yes
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.Feed
Get a list of all feeds available to the context user.
30.0
Yes
public static ConnectApi.FeedDirectory getFeedDirectory(String communityId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.
Type: ConnectApi.FeedDirectory
Get a feed element.
31.0
31.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.FeedElement
Get a feed element with sorted comments.
41.0
41.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder commentSort)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
commentSort
Type: ConnectApi.FeedCommentSortOrder
Order of comments.
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
The default value is CreatedDateLatestAsc.
Sorting in descending order isn’t supported.
Type: ConnectApi.FeedElement
Get a feed element and its comments in a threaded style.
44.0
44.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.FeedElement
Get a feed element and its sorted comments in a threaded style.
44.0
44.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder commentSort)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
commentSort
Type: ConnectApi.FeedCommentSortOrder
Order of comments.
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
Type: ConnectApi.FeedElement
Get a feed element with the specified number of elements per bundle including no more than the specified number of comments per feed element.
31.0
31.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
- elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
Type: ConnectApi.FeedElement
Get a feed element with its comments in a threaded style with the specified number of elements per bundle and comments per feed element.
44.0
44.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
- elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.FeedElement
Get a feed element with its sorted comments in a threaded style with the specified number of elements per bundle and comments per feed element.
44.0
44.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder commentSort)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
commentSort
Type: ConnectApi.FeedCommentSortOrder
Order of comments.
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
Sorting in descending order isn’t supported.
Type: ConnectApi.FeedElement
Get a feed element with the specified number of elements per bundle including no more than the specified number of sorted comments per feed element.
41.0
41.0
Yes
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedCommentSortOrder commentSort)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
commentSort
Type: ConnectApi.FeedCommentSortOrder
Order of comments.
CreatedDateLatestAsc—Sorts by most recently created comments in ascending order.CreatedDateOldestAsc—Sorts by oldest comments in ascending order.Relevance—Sorts by most relevant content.
The default value is CreatedDateLatestAsc.
Sorting in descending order isn’t supported.
Type: ConnectApi.FeedElement
Get a list of feed elements.
31.0
32.0
Yes
public static ConnectApi.BatchResult[] getFeedElementBatch(String communityId, List<String> feedElementIds)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementIds
Type: List<String>
A list of up to 500 feed element IDs.
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedElement object and errors for feed elements that didn’t load.
Get the poll associated with a feed element.
32.0
32.0
Yes
public static ConnectApi.PollCapability getFeedElementPoll(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.PollCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.
Get feed elements from a bundle.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromBundle(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.FeedElementPage
Get a page of feed elements from a bundle. Specify the number of elements per bundle and include no more than the specified number of comments per feed element.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromBundle(String communityId, String feedElementId, String pageParam, Integer pageSize, Integer elementsPerBundle, Integer recentCommentCount)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
- recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
Type: ConnectApi.FeedElementPage
Get feed elements from the Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview feeds.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from the Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview feeds.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from the Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview feeds. Each feed element contains no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from the Home feed. Each feed element contains no more than the specified number of comments.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
When the sortParam is MostViewed, you must pass in null for the pageParam.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
When the sortParam is MostViewed, the pageSize must be a value from 1 to 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered and sorted feed elements with comments in a threaded style from the Home feed. Each feed element contains no more than the specified number of comments.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
When the sortParam is MostViewed, you must pass in null for the pageParam.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
When the sortParam is MostViewed, the pageSize must be a value from 1 to 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get feed elements from any feed other than Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview for a user or record.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from any feed other than Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
The number of feed elements per page.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from any feed other than Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview. Each feed element includes no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a record feed. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from the UserProfile feed.
35.0
35.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped or ConnectApi.FeedFilter.AuthoredBy.
Type: ConnectApi.FeedElementPage
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.
This example gets only community-specific feed elements.
See Also
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements with comments in a threaded style from the UserProfile feed.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped or ConnectApi.FeedFilter.AuthoredBy.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from the case feed.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements with comments in a threaded style for a record feed. Specify the number of elements per bundle and include no more than the specified number of comments per feed element. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a case feed.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered and sorted feed elements with comments in a threaded style from a case feed.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, String customFilter, Boolean threadedCommentsCollapsed)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get feed elements from a feed filtered by a key prefix for a user.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed filtered by a key prefix for a user.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed filtered by a key prefix for a user. Each feed element contains no more than the specified number of comments.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements from a feed filtered by a key prefix for a user. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements from the Company, DirectMessageModeration, Home, and Moderation feeds. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, and Moderation.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered feed elements from the Home feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements from the Files, Groups, News, People, and Record feeds. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
One of these values:
FilesGroupsNewsPeopleRecord
subjectId
Type: String
If feedType is ConnectApi.Record, subjectId can be any record ID, including a group ID. Otherwise, it must be the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered feed elements from a UserProfile feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
35.0
35.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered feed elements from a case feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify the maximum number of feed elements in a bundle and whether to return feed elements posted by internal (non-Experience Cloud site) users only.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered feed elements from a record feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter. Specify the maximum number of feed elements in a bundle and whether to return feed elements posted by internal (non-Experience Cloud site) users only.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered feed elements from a case feed. Include only feed elements that have been updated since the time specified in the updatedSince parameter.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get information about a feed and a page of feed elements from the feed.
40.0
40.0
Yes
public static ConnectApi.Feed getFeedWithFeedElements(String communityId, ConnectApi.FeedType feedType, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeThe type of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Landing,Moderation, andPendingReview.Landingis valid only when communityId isinternal.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in 0, feed elements aren’t returned with the feed.
Type: ConnectApi.Feed
Get a page of information about the feed and the feed elements with the specified number of comments per feed element from the feed.
40.0
40.0
Yes
public static ConnectApi.Feed getFeedWithFeedElements(String communityId, ConnectApi.FeedType feedType, Integer pageSize, Integer recentCommentCount)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeThe type of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Landing,Moderation, andPendingReview.Landingis valid only when communityId isinternal.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in 0, feed elements aren’t returned with the feed.
- recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
Type: ConnectApi.Feed
Get a feed filtered by a key prefix for a user.
28.0
Yes
public static ConnectApi.Feed getFilterFeed(String communityId, String subjectId, String keyPrefix)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix is the first three characters of a record ID, which specifies the object type.
Type: ConnectApi.Feed
Get a sorted feed filtered by a key prefix for a user.
28.0
Yes
public static ConnectApi.Feed getFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedType sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
sortParam
Type: ConnectApi.FeedType
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.Feed
Get a feed directory of filter feeds available to the context user.
30.0
Yes
public static ConnectApi.FeedDirectory getFilterFeedDirectory(String communityId, String subjectId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.
Type: ConnectApi.FeedDirectory
This feed directory contains a list of filter feeds, which are the news feed filtered to include feed items whose parent is a specific entity type.
Call this method to return a directory containing a list of ConnectApi.FeedDirectoryItem objects. Each object contains a key prefix associated with an entity type the context user is following. A key prefix is the first three characters of a record ID, which specifies the object type.
Use key prefixes to filter the news feed so that it contains only feed items whose parent is the entity type associated with the key prefix. For example, get all the feed items whose parent is an Account. To get the feed items, pass a key prefix to the ConnectApi.getFeedItemsFromFilterFeed method.
The information about filter feeds never contains the key prefixes for users (005) or groups (0F9), but all users can use those key prefixes as filters.
The ConnectApi.FeedDirectory.favorites property is always empty when returned by a call to getFilterFeedDirectory because you can’t filter a news feed by favorites.
This example calls getFilterFeedDirectory and loops through the returned FeedDirectoryItem objects to find the key prefixes the context user can use to filter their news feed. It then copies each keyPrefix value to a list. Finally, it passes one of the key prefixes from the list to the getFeedItemsFromFilterFeed method. The returned feed items include every feed item from the news feed whose parent is the entity type specified by the passed key prefix.
Get a like on a post or comment.
28.0
32.0
Yes
public static ConnectApi.ChatterLike getLike(String communityId, String likeId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- likeId
Type: String
ID for a like.
Type: ConnectApi.ChatterLike
Get likes for a comment.
28.0
31.0
Yes
public static ConnectApi.ChatterLikePage getLikesForComment(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID for a comment.
Type: ConnectApi.ChatterLikePage
Get a page of likes for a comment.
28.0
31.0
Yes
public static ConnectApi.ChatterLikePage getLikesForComment(String communityId, String commentId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID for a comment.
- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.ChatterLikePage
Get likes for a feed element.
32.0
32.0
Yes
public static ConnectApi.ChatterLikePage getLikesForFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
Get a page of likes for a feed element.
32.0
32.0
Yes
public static ConnectApi.ChatterLikePage getLikesForFeedElement(String communityId, String feedElementId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, 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.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
Get link metadata for URLs.
42.0
42.0
No
public static ConnectApi.LinkMetadataCollection getLinkMetadata(String communityId, String urls)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- urls
Type: String
Comma-separated list of URL-encoded URLs.
Type: ConnectApi.LinkMetadataCollection
Get pinned feed elements from a group or topic feed.
41.0
41.0
Yes
public static ConnectApi.PinnedFeedElements getPinnedFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeThe type of feed. Valid values are
RecordandTopics.- subjectId
Type: String
If feedType is
Record, subjectId must be a group ID. If feedType isTopics, subjectId must be a topic ID.
Type: ConnectApi.PinnedFeedElements
If the feed doesn’t support this capability, the return value is ConnectApi.NotFoundException.
In the UI, pinned feed elements don’t show all auxiliary information, such as comments, likes, interaction counts, or read by information. As a result, the ConnectApi.PinnedFeedElements output class doesn’t include all the information for these capabilities.
Get information about who read a feed element and when.
40.0
Yes
public static ConnectApi.ReadByPage getReadByForFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.ReadByPage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Get a page of information about who read a feed element and when.
40.0
Yes
public static ConnectApi.ReadByPage getReadByForFeedElement(String communityId, String feedElementId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, 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.ReadByPage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Get posts related to the context feed element.
37.0
37.0
Yes
public static ConnectApi.RelatedFeedPosts getRelatedPosts(String communityId, String feedElementId, ConnectApi.RelatedFeedPostType filter, Integer maxResults)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element. The feed element must be a question.
filter
Type: ConnectApi.RelatedFeedPostType
Specifies the type of related post. Values are:
Answered—Related questions that have at least one answer.BestAnswer—Related questions that have a best answer.Generic—All types of related questions, including answered, with a best answer, and unanswered.Unanswered—Related questions that don’t have answers.
Generic is the default value.
maxResults
Type: Integer
The maximum number of results to return. You can return up to 25 results; 5 is the default.
Type: ConnectApi.RelatedFeedPosts
In version 37.0 and later, related feed posts are questions.
Each related feed post has a score indicating how closely it’s related to the context feed post. We return related feed posts sorted by score, with the highest score first.
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.
Get information about a Chatter feed stream.
39.0
Yes
public static ConnectApi.ChatterStream getStream(String communityId, String streamId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- streamId
Type: String
ID of the Chatter feed stream.
Type: ConnectApi.ChatterStream
Get information about a Chatter feed stream, regardless of Experience Cloud site.
41.0
Yes
public static ConnectApi.ChatterStream getStream(String communityId, String streamId, Boolean globalScope)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- streamId
Type: String
ID of the Chatter feed stream.
- globalScope
Type: Boolean
Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value.
If you know the communityId for the stream, we recommend setting globalScope to
false.
Type: ConnectApi.ChatterStream
Get the Chatter feed streams for the context user.
39.0
Yes
public static ConnectApi.ChatterStreamPage getStreams(String communityId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.
Type: ConnectApi.ChatterStreamPage
Get and sort the Chatter feed streams for the context user.
40.0
Yes
public static ConnectApi.ChatterStreamPage getStreams(String communityId, ConnectApi.SortOrder sortParam)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.
Type: ConnectApi.ChatterStreamPage
Get a page of Chatter feed streams for the context user.
39.0
Yes
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
Type: ConnectApi.ChatterStreamPage
Get a sorted page of Chatter feed streams for the context user.
40.0
Yes
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.
Type: ConnectApi.ChatterStreamPage
Get a sorted page of Chatter feed streams from all Enterprise Cloud sites for the context user.
41.0
Yes
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.- globalScope
Type: Boolean
Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value.
If you know the communityId for the streams, we recommend setting globalScope to
false.
Type: ConnectApi.ChatterStreamPage
Get supported emojis for the org.
39.0
Yes
public static ConnectApi.SupportedEmojis getSupportedEmojis()
Type: ConnectApi.SupportedEmojis
To get the list, emojis must be enabled in your org.
Get threaded comments for a comment.
44.0
44.0
Yes
public static ConnectApi.CommentPage getThreadsForFeedComment(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
Type: ConnectApi.CommentPage
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
Get a page of threaded comments for a comment.
44.0
44.0
Yes
public static ConnectApi.CommentPage getThreadsForFeedComment(String communityId, String commentId, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as
currentPageTokenornextPageToken. If you pass innull, 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.CommentPage
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
Access the comments capability for a comment.
44.0
44.0
Yes
public static ConnectApi.CommentsCapability getThreadsForFeedComment(String communityId, String commentId, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.CommentsCapability
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
Get top unanswered questions for the context user in aExperience Cloud site.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
Yes
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId)
- communityId
Type: String
ID of the Experience Cloud site.
Type: ConnectApi.FeedElementPage
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
- setTestGetTopUnansweredQuestions(communityId, result) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Get filtered top unanswered questions for the context user in an Experience Cloud site.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
Yes
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, ConnectApi.TopUnansweredQuestionsFilterType filter)
- communityId
Type: String
ID of the Experience Cloud site.
- filter
Type:
ConnectApi.FeedFilterSpecifies the filter for the feed.
UnansweredQuestionsWithCandidateAnswersis the only valid value.
Type: ConnectApi.FeedElementPage
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
- setTestGetTopUnansweredQuestions(communityId, filter, result) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of top unanswered questions for the context user in an Experience Cloud site.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
Yes
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, Integer pageSize)
- communityId
Type: String
ID of the Experience Cloud site.
- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 0 through 10. If you pass in
null, the default size is 5.
Type: ConnectApi.FeedElementPage
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
- setTestGetTopUnansweredQuestions(communityId, pageSize, result) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of filtered top unanswered questions for the context user in an Experience Cloud site.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
Yes
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, ConnectApi.FeedFilter filter, Integer pageSize)
- communityId
Type: String
ID of the Experience Cloud site.
- filter
Type:
ConnectApi.FeedFilterSpecifies the filter for the feed.
UnansweredQuestionsWithCandidateAnswersis the only valid value.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 0 through 10. If you pass in
null, the default size is 5.
Type: ConnectApi.FeedElementPage
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
- setTestGetTopUnansweredQuestions(communityId, filter, pageSize, result) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Get the first page of users who upvoted or downvoted a comment.
42.0
42.0
Yes
public static ConnectApi.VotePage getVotesForComment(String communityId, String commentId, ConnectApi.UpDownVoteValue vote)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- vote
Type:
ConnectApi.UpDownVoteValueSpecifies the value of the vote for the feed element. Values are:
DownUp
You can’t specify
None.
Type: ConnectApi.VotePage
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Get a page of users who upvoted or downvoted a comment.
42.0
42.0
Yes
public static ConnectApi.VotePage getVotesForComment(String communityId, String commentId, ConnectApi.UpDownVoteValue vote, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- vote
Type:
ConnectApi.UpDownVoteValueSpecifies the value of the vote for the feed element. Values are:
DownUp
You can’t specify
None.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.VotePage
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Get the first page of users who upvoted or downvoted a feed element.
42.0
42.0
Yes
public static ConnectApi.VotePage getVotesForFeedElement(String communityId, String feedElementId, ConnectApi.UpDownVoteValue vote)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- vote
Type:
ConnectApi.UpDownVoteValueSpecifies the value of the vote for the feed element. Values are:
DownUp
You can’t specify
None.
Type: ConnectApi.VotePage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Get a page of users who upvoted or downvoted a feed element.
42.0
42.0
Yes
public static ConnectApi.VotePage getVotesForFeedElement(String communityId, String feedElementId, ConnectApi.UpDownVoteValue vote, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- vote
Type:
ConnectApi.UpDownVoteValueSpecifies the value of the vote for the feed element. Values are:
DownUp
You can’t specify
None.- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.VotePage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Discover whether the context user can edit a comment.
34.0
Yes
public static ConnectApi.FeedEntityIsEditable isCommentEditableByMe(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
Type: ConnectApi.FeedEntityIsEditable
If the comment doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
See Also
Discover whether the context user can edit a feed element.
34.0
Yes
public static ConnectApi.FeedEntityIsEditable isFeedElementEditableByMe(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element. Feed items are the only type of feed element that can be edited.
Type: ConnectApi.FeedEntityIsEditable
If the feed element doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
See Also
Discover whether a news feed has been updated or changed. Use this method to poll a news feed for updates.
This feature is available through a Feed Polling pilot program. This pilot program is closed and not accepting new participants.
28.0
Yes
public static ConnectApi.FeedModifiedInfo isModified(String communityId, ConnectApi.FeedType feedType, String subjectId, String since)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeSpecifies the type of feed. The only supported type is
News- subjectId
Type: String
ID of the context user or the alias
me.- since
Type: String
An opaque token containing information about the last modified date of the feed. Retrieve this token from the
FeedElementPage.isModifiedTokenproperty.
Type: ConnectApi.FeedModifiedInfo
Like a comment for the context user.
28.0
Yes
public static ConnectApi.ChatterLike likeComment(String communityId, String commentId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID for a comment.
Type: ConnectApi.ChatterLike
If the context user has already liked the comment, this method is a non-operation and returns the existing like.
Like a feed element.
32.0
Yes
public static ConnectApi.ChatterLike likeFeedElement(String communityId, String feedElementId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
Type: ConnectApi.ChatterLike
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
Post a plain-text comment to a feed element.
32.0
Yes
public static ConnectApi.Comment postCommentToFeedElement(String communityId, String feedElementId, String text)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- text
Type: String
Text of the comment. A comment can contain up to 10,000 characters.
Type: ConnectApi.Comment
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Post a rich-text comment to a feed element. Use this method to include mentions and to attach a file.
32.0
Yes
public static ConnectApi.Comment postCommentToFeedElement(String communityId, String feedElementId, ConnectApi.CommentInput comment, ConnectApi.BinaryInput feedElementFileUpload)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- comment
Type:
ConnectApi.CommentInputThe comment body, including text and mentions, and capabilities, such as information about an attached file. A comment can contain up to 10,000 characters.
- feedElementFileUpload
Type:
ConnectApi.BinaryInputA new binary file to attach to the comment, or
null. If you specify a binary file, specify the title and description of the file in the comment parameter.
Type: ConnectApi.Comment
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
You can post comments with mentions two ways. Use the ConnectApiHelper repository on GitHub to write a single line of code, or use this method example.
You can post rich-text comments with inline images and mentions two ways. Use the ConnectApiHelper repository on GitHub to write a single line of code, or use this method example. In this example, the image file is existing content that has already been uploaded to Salesforce.
Post a plain-text feed element.
31.0
Yes
public static ConnectApi.FeedElement postFeedElement(String communityId, String subjectId, ConnectApi.FeedElementType feedElementType, String text)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
The ID of the parent this feed element is being posted to. This value can be the ID of a user, group, or record, or the string
meto indicate the context user.- feedElementType
Type:
ConnectApi.FeedElementTypeThe only possible value is
FeedItem.- text
Type: String
The text of the feed element. A feed element can contain up to 10,000 characters.
Type: ConnectApi.FeedElement
Post a rich-text feed element. Include mentions and hashtag topics, attach already uploaded files to a feed element, and associate action link groups with a feed element. You can also use this method to share a feed element and add a comment.
36.0
Yes
public static ConnectApi.FeedElement postFeedElement(String communityId, ConnectApi.FeedElementInput feedElement)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElement
Type:
ConnectApi.FeedElementInputSpecify rich text, including mentions. Optionally, specify a link, a poll, or up to 10 existing files.
Type: ConnectApi.FeedElement
You can post feed elements with mentions two ways. Use the ConnectApiHelper repository on GitHub to write a single line of code, or use this method example.
You can post rich-text feed elements with inline images and mentions two ways. Use the ConnectApiHelper repository on GitHub to write a single line of code, or use this method example. In this example, the image file is existing content that has already been uploaded to Salesforce. The post also includes text and a mention.
Post a list of feed elements.
32.0
Yes
public static ConnectApi.BatchResult[] postFeedElementBatch(String communityId, List<ConnectApi.BatchInput> feedElements)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElements
Type: List<
ConnectApi.BatchInput>The list can contain up to 500
ConnectApi.BatchInputobjects. In theConnectApi.BatchInputconstructor, the input object must be a concrete instance of the abstractConnectApi.FeedElementInputclass.
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedElement object.
The returned objects correspond to each of the input objects and are returned in the same order as the input objects.
The method call fails only if an error occurs that affects the entire operation (such as a parsing failure). If an individual object causes an error, the error is embedded within the ConnectApi.BatchResult list.
Use this method to post a list of feed elements efficiently. Create a list containing up to 500 objects and insert them all for the cost of one DML statement.
In version 36.0 and later, you can attach only one already uploaded file to each post. The ConnectApi.BatchInput has three constructors, but the postFeedElementBatch method supports only ConnectApi.BatchInput(Object input) in version 35.0 and later. This constructor doesn’t support a binary input.
In version 32.0–35.0, this method supports both ConnectApi.BatchInput(Object input) and ConnectApi.BatchInput(Object input, ConnectApi.BinaryInput binary) constructors. The ConnectApi.BatchInput(Object input, ConnectApi.BinaryInput binary) constructor allows for a single binary input.
In each constructor, the input object must be an instance of ConnectApi.FeedElementInput.
This trigger bulk posts to the feeds of newly inserted accounts.
Publish a draft feed element.
44.0
Yes
public static ConnectApi.FeedElement publishDraftFeedElement(String communityId, String feedElementId, ConnectApi.FeedElementInput feedElement)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element to publish.
- feedElement
Type:
ConnectApi.FeedElementInputUse this optional parameter to edit your draft before publishing.
Type: ConnectApi.FeedElement
The published feed element has a new ID.
Get the first page of feed elements that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.
Type: ConnectApi.FeedElementPage
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 the first page of sorted feed elements that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, ConnectApi.FeedSortOrder sortParam)
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.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed elements and comments that match the search criteria.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed elements with comments in a threaded style that match the search criteria.
44.0
44.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements that match the search criteria. Each feed element includes no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed elements from the Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview feeds that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,Home,Isolated,Moderation, andPendingReview.- 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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from the Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview feeds that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from the Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview feeds that match the search criteria. Each feed element includes no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from the Home feed that match the search criteria. Each feed element includes no more than the specified number of comments.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
When the sortParam is MostViewed, you must pass in null for the pageParam.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
When the sortParam is MostViewed, the pageSize must be a value from 1 to 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Search up to 5,000 of the most recent feed elements in a feed for a subject ID that match the search string. Feed elements are returned in order of most recent activity.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessages,Filter,Landing,Streams, andTopics.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.- 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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed for a record or user that match the search criteria.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, Streams, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Order of feed items in the feed.
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter doesn’t support wildcards. This parameter is required.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed that match the search criteria. Each feed element includes no more than the specified number of comments.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, Streams, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a UserProfile feed that match the search criteria.
35.0
35.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a case feed that match the search criteria.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed for a record or user that match the search criteria. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
31.0
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a feed for a record or user that match the search criteria. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-Experience Cloud site) users only.
32.0
32.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, ConnectApi.FeedFilter filter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, filter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted and filtered feed elements from a case feed that match the search criteria.
40.0
40.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, String customFilter)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, customFilter, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed elements from a feed filtered by a key prefix that match the search criteria.
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- 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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed filtered by a key prefix that match the search criteria.
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed elements from a feed filtered by a key prefix that match the search criteria. Each feed element includes no more than the specified number of comments.
31.0
Yes
public static ConnectApi.FeedElementPage searchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedElementPage
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
- setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Search the Chatter feed streams for the context user.
40.0
Yes
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.
Type: ConnectApi.ChatterStreamPage
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
Search and sort the Chatter feed streams for the context user.
40.0
Yes
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, ConnectApi.SortOrder sortParam)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.
Type: ConnectApi.ChatterStreamPage
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
- setTestSearchStreams(communityId, q, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Search the Chatter feed streams for the context user and return a page of results.
40.0
Yes
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
Type: ConnectApi.ChatterStreamPage
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
- setTestSearchStreams(communityId, q, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Search the Chatter feed streams for the context user and return a sorted page of results.
40.0
Yes
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.
Type: ConnectApi.ChatterStreamPage
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
- setTestSearchStreams(communityId, q, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Search the Chatter feed streams from all Experience Cloud sites for the context user and return a sorted page of results.
41.0
Yes
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.- globalScope
Type: Boolean
Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value. If you know the communityId for the streams, we recommend setting globalScope to
false.
Type: ConnectApi.ChatterStreamPage
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.
Mark a comment as verified or unverified.
41.0
Yes
public static ConnectApi.VerifiedCapability setCommentIsVerified(String communityId, String commentId, Boolean isVerified)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment on a question post. Only one comment on a question post can be marked as verified.
- isVerified
Type: Boolean
Specifies whether to mark the comment as verified (
true) or unverified (false).Only verified comments can be marked as unverified, and only unverified comments can be marked as verified.
Type: ConnectApi.VerifiedCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Mark a comment as verified by an anonymous user.
43.0
Yes
public static ConnectApi.VerifiedCapability setCommentIsVerifiedByAnonymized(String communityId, String commentId, Boolean isVerified, Boolean isVerifiedByAnonymized)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment on a question post. Only one comment on a question post can be marked as verified.
- isVerified
Type: Boolean
Specifies whether to mark the comment as verified (
true) or unverified (false).Only verified comments can be marked as unverified, and only unverified comments can be marked as verified.
- isVerifiedByAnonymized
Type: Boolean
Specifies whether to mark the comment as verified by an anonymous user (
true).If a user previously verified a comment and then requested the activity to be deleted, use
isVerifiedByAnonymizedto maintain the verification and anonymize the value oflastVerifiedByUser.You can’t set
isVerifiedandisVerifiedByAnonymizedtotrueat the same time.isVerifiedByAnonymizedcan be set totrueonly ifisVerifiedis already set totrue.You can’t set
isVerifiedByAnonymizedtofalse. AfterisVerifiedByAnonymizedis set totrue, it can be undone only when another user marks the comment as unverified and then reverifies the comment.
Type: ConnectApi.VerifiedCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Upvote or downvote a comment.
41.0
Yes
public static ConnectApi.UpDownVoteCapability setCommentVote(String communityId, String commentId, ConnectApi.UpDownVoteCapabilityInput upDownVote)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- upDownVote
Type:
ConnectApi.UpDownVoteCapabilityInputA
ConnectApi.UpDownVoteCapabilityInputobject that includes your vote.
Type: ConnectApi.UpDownVoteCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Set the status of a comment.
38.0
Yes
public static ConnectApi.StatusCapability setFeedCommentStatus(String communityId, String commentId, ConnectApi.StatusCapabilityInput status)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- status
Type:
ConnectApi.StatusCapabilityInputA
ConnectApi.StatusCapabilityInputobject that includes the status you want to set.
Type: ConnectApi.StatusCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Only users with the Can Approve Feed Post and Comment permission can set the status of a feed post or comment.
Set a feed element to closed.
Users can’t edit (specifically the feed item body or title), comment on, or delete a closed feed element. If the closed feed element is a poll, users can’t vote on it. Users can’t edit (specifically the comment body) or delete a comment on a closed feed element or select or remove it as best answer.
Admins and moderators can edit and delete closed feed elements and comments on closed feed elements. Admins and moderators can select or remove the best answer status on comments on closed feed elements.
43.0
Yes
public static ConnectApi.CloseCapability setFeedElementIsClosed(String communityId, String feedElementId, Boolean isClosed)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- isClosed
Type: Boolean
Specifies whether to set the feed element to closed (
true) or not (false).
Type: ConnectApi.CloseCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Upvote or downvote a feed element.
41.0
Yes
public static ConnectApi.UpDownVoteCapability setFeedElementVote(String communityId, String feedElementId, ConnectApi.UpDownVoteCapabilityInput upDownVote)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- upDownVote
Type:
ConnectApi.UpDownVoteCapabilityInputA
ConnectApi.UpDownVoteCapabilityInputobject that includes your vote.
Type: ConnectApi.UpDownVoteCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Set the status of a feed post.
37.0
Yes
public static ConnectApi.StatusCapability setFeedEntityStatus(String communityId, String feedElementId, ConnectApi.StatusCapabilityInput status)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- status
Type:
ConnectApi.StatusCapabilityInputA
ConnectApi.StatusCapabilityInputobject that includes the status you want to set.
Type: ConnectApi.StatusCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Only users with the Can Approve Feed Post and Comment permission can set the status of a feed post or comment.
Mute or unmute a feed element.
35.0
Yes
public static ConnectApi.MuteCapability setIsMutedByMe(String communityId, String feedElementId, Boolean isMutedByMe)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- isMutedByMe
Type: Boolean
Indicates whether the feed element is muted for the context user. Default value is
false.
Type: ConnectApi.MuteCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Mark a feed element as read for the context user using an input class.
40.0
Yes
public static ConnectApi.ReadByCapability setIsReadByMe(String communityId, String feedElementId, ConnectApi.ReadByCapabilityInput readBy)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element to mark as read.
- readBy
Type:
ConnectApi.ReadByCapabilityInputA
ConnectApi.ReadByCapabilityInputbody indicating to mark the feed elements as read.
Type: ConnectApi.ReadByCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Mark a feed element as read for the context user.
40.0
Yes
public static ConnectApi.ReadByCapability setIsReadByMe(String communityId, String feedElementId, Boolean isReadByMe)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element to mark as read.
- isReadByMe
Type: Boolean
Specifies to mark the feed element as read (
true) for the context user.
Type: ConnectApi.ReadByCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Edit a comment.
34.0
Yes
public static ConnectApi.Comment updateComment(String communityId, String commentId, ConnectApi.CommentInput comment)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment to be edited.
- comment
Type:
ConnectApi.CommentInputInformation about the comment to be edited.
Type: ConnectApi.Comment
If the comment doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
Update the members of a direct message.
40.0
Yes
public static ConnectApi.DirectMessageCapability updateDirectMessage(String communityId, String feedElementId, ConnectApi.DirectMessageCapabilityInput directMessage)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- directMessage
Type:
ConnectApi.DirectMessageCapabilityInputA
ConnectApi.DirectMessageCapabilityInputbody that includes the members to add and remove.
Type: ConnectApi.DirectMessageCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Edit a feed element.
34.0
Yes
public static ConnectApi.FeedElement updateFeedElement(String communityId, String feedElementId, ConnectApi.FeedElementInput feedElement)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element to be edited. Feed items are the only type of feed element that can be edited.
- feedElement
Type:
ConnectApi.FeedElementInputInformation about the feed item to be edited.
Type: ConnectApi.FeedElement
If the feed element doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
Bookmark a feed element or remove a bookmark from a feed element using an input class.
32.0
Yes
public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, ConnectApi.BookmarksCapabilityInput bookmarks)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- bookmarks
Type:
ConnectApi.BookmarksCapabilityInputInformation about a bookmark.
Type: ConnectApi.BookmarksCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Bookmark a feed element or remove a bookmark from a feed element.
32.0
Yes
public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, Boolean isBookmarkedByCurrentUser)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- isBookmarkedByCurrentUser
Type: Boolean
Specify whether to bookmark the feed element (
true) or not (false).
Type: ConnectApi.BookmarksCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Mark multiple feed elements as read by the context user at the same time using an input class.
40.0
Yes
public static ConnectApi.BatchResult[] updateFeedElementReadByCapabilityBatch(String communityId, List<String> feedElementIds, ConnectApi.ReadByCapabilityInput readBy)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementIds
Type: List<String>
Up to 500 feed element IDs to mark as read.
- readBy
Type:
ConnectApi.ReadByCapabilityInputA
ConnectApi.ReadByCapabilityInputbody indicating to mark the feed elements as read.
Type: ConnectApi.BatchResult[]
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
The returned objects correspond to each of the input objects and are returned in the same order as the input objects.
The method call fails only if an error occurs that affects the entire operation (such as a parsing failure). If an individual object causes an error, the error is embedded within the ConnectApi.BatchResult list.
Mark multiple feed elements as read by the context user at the same time.
40.0
Yes
public static ConnectApi.BatchResult[] updateFeedElementReadByCapabilityBatch(String communityId, List<String> feedElementIds, Boolean isReadByMe)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementIds
Type: List<String>
Up to 500 feed element IDs to mark as read.
- isReadByMe
Type: Boolean
Specifies to mark the feed element as read (
true) for the context user.
Type: ConnectApi.BatchResult[]
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Like or unlike a comment.
39.0
Yes
public static ConnectApi.ChatterLikePage updateLikeForComment(String communityId, String commentId, Boolean isLikedByCurrentUser)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- commentId
Type: String
ID of the comment.
- isLikedByCurrentUser
Type: Boolean
Specifies if the context user likes (
true) or unlikes (false) the comment.
Type: ConnectApi.ChatterLikePage
Like or unlike a feed element.
39.0
Yes
public static ConnectApi.ChatterLikePage updateLikeForFeedElement(String communityId, String feedElementId, Boolean isLikedByCurrentUser)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- isLikedByCurrentUser
Type: Boolean
Specifies if the context user likes (
true) or unlikes (false) the feed element.
Type: ConnectApi.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
Pin or unpin feed elements to a group or topic feed.
41.0
41.0
Yes
public static ConnectApi.PinCapability updatePinnedFeedElements(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.PinCapabilityInput pin)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeThe type of feed. Valid values are
RecordandTopics.- subjectId
Type: String
If feedType is
Record, subjectId must be a group ID. If feedType isTopics, subjectId must be a topic ID.- pin
Type:
ConnectApi.PinCapabilityInputA
ConnectApi.PinCapabilityInputobject indicating the feed element to pin or unpin.
Type: ConnectApi.PinCapability
If the feed doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Update a Chatter feed stream.
39.0
Yes
public static ConnectApi.ChatterStream updateStream(String communityId, String streamId, ConnectApi.ChatterStreamInput streamInput)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- streamId
Type: String
ID of the Chatter feed stream.
- streamInput
Type:
ConnectApi.ChatterStreamInputA
ConnectApi.ChatterStreamInputobject.
Type: ConnectApi.ChatterStream
Vote on a poll or change your vote on a poll.
32.0
Yes
public static ConnectApi.PollCapability voteOnFeedElementPoll(String communityId, String feedElementId, String myChoiceId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElementId
Type: String
ID of the feed element.
- myChoiceId
Type: String
ID of the poll item you’re voting for. The key prefix for poll items is 09A.
Type: ConnectApi.PollCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
These test methods are for ChatterFeeds. All methods are static.
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
-
setTestGetFeedElementsFromFeed(communityId, feedType, result)
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
setTestGetFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getFeedElementsFromFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, result)
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getFeedElementsFromFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getFeedElementsFromFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, result)
a
ConnectApi.FeedElementPageobject to be returned when the matchinggetFeedElementsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchinggetFeedElementsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchinggetFeedElementsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when thegetFeedElementsFromFilterFeedUpdatedSincemethod is called in a test context. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whengetFeedElementsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
setTestGetRelatedPosts(communityId, feedElementId, filter, maxResults, result)
Register a
ConnectApi.RelatedFeedPostsobject to be returned when the matchingConnectApi.getRelatedPosts(communityId, feedElementId, filter, maxResults)method is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetTopUnansweredQuestions(communityId, result) (Pilot)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getTopUnansweredQuestionsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetTopUnansweredQuestions(communityId, filter, result) (Pilot)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getTopUnansweredQuestionsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetTopUnansweredQuestions(communityId, pageSize, result) (Pilot)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getTopUnansweredQuestionsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestGetTopUnansweredQuestions(communityId, filter, pageSize, result) (Pilot)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.getTopUnansweredQuestionsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, sortParam, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, threadedCommentsCollapsed, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, pageParam, pageSize, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, pageParam, pageSize, sortParam, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElementsInFeed(communityId, feedType, q, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, q, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned whensearchFeedElementsInFeedis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedElementPageobject to be returned when the matchingConnectApi.searchFeedElementsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchStreams(communityId, q, result)
Register a
ConnectApi.ChatterStreamPageobject to be returned when the matchingConnectApi.searchStream(communityId, q)method is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchStreams(communityId, q, sortParam, result)
Register a
ConnectApi.ChatterStreamPageobject to be returned when the matchingConnectApi.searchStream(communityId, q, sortParam)method is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchStreams(communityId, q, pageParam, pageSize, result)
Register a
ConnectApi.ChatterStreamPageobject to be returned when the matchingConnectApi.searchStreams(communityId, q, pageParam, pageSize)method is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchStreams(communityId, q, pageParam, pageSize, sortParam, result)
Register a
ConnectApi.ChatterStreamPageobject to be returned when the matchingConnectApi.searchStreams(communityId, q, pageParam, pageSize, sortParam)method is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope, result)
Register a
ConnectApi.ChatterStreamPageobject to be returned when the matchingConnectApi.searchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope)method is called in a test context. Use the method with the same parameters or you receive an exception.
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The only valid value for this parameter is Company.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
32.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getFeedElementsFromFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
44.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- Apex Developer Guide: Testing ConnectApi Code
- getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed)
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeThe feed type.
- subjectId
Type: String
ID of the context user or the alias
me.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
35.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out. Currently, feed elements scoped to sites have a User or a Group parent record. However, other parent record types could be scoped to sites in the future.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getFeedElementsFromFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
44.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out. Currently, feed elements scoped to sites have a User or a Group parent record. However, other parent record types could be scoped to sites in the future.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- Apex Developer Guide: Testing ConnectApi Code
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed)
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
40.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
32.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
44.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedFilter filter, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, threadedCommentsCollapsed)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
40.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getFeedElementsFromFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
44.0
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, String customFilter, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (true) or not (false). If you pass in null, the default is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- Apex Developer Guide: Testing ConnectApi Code
- getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, threadedCommentsCollapsed)
a ConnectApi.FeedElementPage object to be returned when the matching getFeedElementsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching getFeedElementsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching getFeedElementsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the getFeedElementsFromFilterFeedUpdatedSince method is called in a test context.
31.0
public static Void setTestGetFeedElementsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
32.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
One of these values:
FilesGroupsNewsPeopleRecord
subjectId
Type: String
If feedType is ConnectApi.Record, subjectId can be any record ID, including a group ID. Otherwise, it must be the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
35.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out. Currently, feed elements scoped to sites have a User or a Group parent record. However, other parent record types could be scoped to sites in the future.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
40.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token defining the modification timestamp of the feed and the sort order.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
31.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
32.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
40.0
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
Maximum number of feed elements to include in a bundle. The value must be an integer between 0 and 10. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedElementPage response body.
The updatedSince parameter doesn’t return feed elements that are created in the same second as the call.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.RelatedFeedPosts object to be returned when the matching ConnectApi.getRelatedPosts(communityId, feedElementId, filter, maxResults) method is called in a test context. Use the method with the same parameters or you receive an exception.
37.0
public static Void setTestGetRelatedPosts(String communityId, String feedElementId, ConnectApi.RelatedFeedPostType filter, Integer maxResults, ConnectApi.RelatedFeedPosts result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedElementId
Type: String
ID of the feed element. The feed element must be a question.
filter
Type: ConnectApi.RelatedFeedPostType
Specifies the type of related feed post. Values are:
Answered—Related questions that have at least one answer.BestAnswer—Related questions that have a best answer.Generic—All types of related questions, including answered, with a best answer, and unanswered.Unanswered—Related questions that don’t have answers.
Generic is the default value.
maxResults
Type: Integer
The maximum number of results to return. You can return up to 25 results; 5 is the default.
result
Type: ConnectApi.RelatedFeedPosts
Object containing test data.
In version 37.0 and later, related feed posts are questions.
Type: Void
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getTopUnansweredQuestions method is called in a test context. Use the method with the same parameters or you receive an exception.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID of the Experience Cloud site.
- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getTopUnansweredQuestions method is called in a test context. Use the method with the same parameters or you receive an exception.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.TopUnansweredQuestionsFilterType filter, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID of the Experience Cloud site.
- filter
Type:
ConnectApi.FeedFilterSpecifies the filter for the feed.
UnansweredQuestionsWithCandidateAnswersis the only valid value.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- getTopUnansweredQuestions(communityId, filter) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getTopUnansweredQuestions method is called in a test context. Use the method with the same parameters or you receive an exception.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
public static Void setTestGetTopUnansweredQuestions(String communityId, Integer pageSize, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID of the Experience Cloud site.
- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 0 through 10. If you pass in
null, the default size is 5.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- getTopUnansweredQuestions(communityId, pageSize) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.getTopUnansweredQuestions method is called in a test context. Use the method with the same parameters or you receive an exception.
We provided top-five unanswered questions to selected customers through a pilot program that required agreement to specific terms and conditions. This pilot program is closed and not accepting new participants.
42.0
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.FeedFilter filter, Integer pageSize, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID of the Experience Cloud site.
- filter
Type:
ConnectApi.FeedFilterSpecifies the filter for the feed.
UnansweredQuestionsWithCandidateAnswersis the only valid value.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 0 through 10. If you pass in
null, the default size is 5.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- getTopUnansweredQuestions(communityId, filter, pageSize) (Pilot)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.FeedElementPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
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.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
44.0
public static Void setTestSearchFeedElements(String communityId, String q, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElements(communityId, q, threadedCommentsCollapsed)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.D- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElements(communityId, q, pageParam, pageSize)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElements(communityId, q, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
44.0
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- threadedCommentsCollapsed
Type: Boolean
Specifies whether to return threaded comments in a collapsed style (
true) or not (false). If you pass innull, the default isfalse.- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElements method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElements(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String q, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,Home,Isolated,Moderation, andPendingReview.- 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.FeedElementPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
32.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
filter
Type: ConnectApi.FeedFilter
Specifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessages,Filter,Landing,Streams, andTopics.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feed type isUserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the aliasme.- 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.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, Streams, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Order of feed items in the feed.
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter doesn’t support wildcards. This parameter is required.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, Streams, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when searchFeedElementsInFeed is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
35.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
The amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to Experience Cloud sites. Feed elements that are always visible in all sites are filtered out. Currently, feed elements scoped to sites have a User or a Group parent record. However, other parent record types could be scoped to sites in the future.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
The amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Specifies the page token to use to view a page of information. Page tokens are returned as part of the response class, such as currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
customFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
32.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeValue must be
ConnectApi.FeedType.Record.- subjectId
Type: String
Any record ID, including a group ID.
- recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
- density
Type:
ConnectApi.FeedDensitySpecify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
- pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- sortParam
Type:
ConnectApi.FeedSortOrderValues are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in
null, the default valueCreatedDateDescis used.- 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.- showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (
true), or not (false). The default value isfalse.- filter
Type:
ConnectApi.FeedFilterSpecifies the feed filters.
AllQuestions—Feed elements that are questions.AuthoredBy—Feed elements authored by the user profile owner. This value is valid only for theUserProfilefeed.CommunityScoped—Feed elements that are scoped to Experience Cloud sites. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to sites in the future. Feed elements that are always visible in all sites are filtered out. This value is valid only for theUserProfilefeed.QuestionsWithCandidateAnswers—Feed elements that are questions that have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.QuestionsWithCandidateAnswersReviewedPublished—Feed elements that are questions that have candidate answers that have been reviewed or published. This value is valid only for users with the Access Einstein-Generated Answers permission.Read—Feed elements that are older than 30 days or are marked as read for the context user. Includes existing feed elements when the context user joined the group. This value is valid only for theRecordfeed of a group.SolvedQuestions—Feed elements that are questions and that have a best answer.UnansweredQuestions—Feed elements that are questions and that don’t have any answers.UnansweredQuestionsWithCandidateAnswers—Feed elements that are questions that don’t have answers but have candidate answers associated with them. This value is valid only for users with the Access Einstein-Generated Answers permission.Unread—Feed elements that are created in the past 30 days and aren’t marked as read for the context user. This value is valid only for theRecordfeed of a group.UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
- result
Type:
ConnectApi.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, filter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, String customFilter, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
The ID of a case.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed elements from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
cusotmFilter
Type: String
Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
result
Type: ConnectApi.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, customFilter)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q, ConnectApi.FeedElementPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- 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.FeedElementPageObject containing test data.
Type: Void
See Also
- searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedElementPage object to be returned when the matching ConnectApi.searchFeedElementsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
31.0
public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed element. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
If you pass in null, the default value CreatedDateDesc is used.
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.FeedElementPage
Object containing test data.
Type: Void
See Also
- searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ChatterStreamPage object to be returned when the matching ConnectApi.searchStream(communityId, q) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchStreams(String communityId, String q, ConnectApi.ChatterStreamPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.ChatterStreamPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.ChatterStreamPage object to be returned when the matching ConnectApi.searchStream(communityId, q, sortParam) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchStreams(String communityId, String q, ConnectApi.SortOrder sortParam, ConnectApi.ChatterStreamPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.- result
Type:
ConnectApi.ChatterStreamPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.ChatterStreamPage object to be returned when the matching ConnectApi.searchStreams(communityId, q, pageParam, pageSize) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.ChatterStreamPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- result
Type:
ConnectApi.ChatterStreamPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.ChatterStreamPage object to be returned when the matching ConnectApi.searchStreams(communityId, q, pageParam, pageSize, sortParam) method is called in a test context. Use the method with the same parameters or you receive an exception.
40.0
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, ConnectApi.ChatterStreamPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.- result
Type:
ConnectApi.ChatterStreamPageObject containing test data.
Type: Void
See Also
- searchStreams(communityId, q, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.ChatterStreamPage object to be returned when the matching ConnectApi.searchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope) method is called in a test context. Use the method with the same parameters or you receive an exception.
41.0
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope, ConnectApi.ChatterStreamPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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
nullor 0, the first page is returned.- pageSize
Type: Integer
Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
Type:
ConnectApi.SortOrderSpecifies the sort order. Values are:
Ascending—Items are in ascending alphabetical order (A-Z).Descending—Items are in descending alphabetical order (Z-A).MostRecentlyViewed—Items are in descending chronological order by view. This sort order is valid only for Chatter feed streams.
If not specified, default value is
Ascending.- globalScope
Type: Boolean
Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value.
- result
Type:
ConnectApi.ChatterStreamPageObject containing test data.
Type: Void
These methods for ChatterFeeds are retired.
-
deleteFeedItem(communityId, feedItemId)
Delete a feed item.
-
getCommentsForFeedItem(communityId, feedItemId)
Get comments for a feed item.
-
getCommentsForFeedItem(communityId, feedItemId, pageParam, pageSize)
Get a page of comments for a feed item.
-
getFeedItem(communityId, feedItemId)
Get a feed item.
-
getFeedItemBatch(communityId, feedItemIds)
Get a list of feed items.
-
getFeedItemsFromFeed(communityId, feedType)
Get feed items from the
Company,Home, andModerationfeeds. -
getFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
Get a page of sorted feed items from the
Company,Home, andModerationfeeds. -
Get a page of sorted feed items from the
Company,Home, andModerationfeeds. Each feed item contains no more than the specified number of comments. -
getFeedItemsFromFeed(communityId, feedType, subjectId)
Get feed items from a feed for a user or record.
-
getFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
Get a page of sorted feed items from a feed for a user or record.
-
Get a page of sorted feed items from a feed for a user or record. Each feed item includes no more than the specified number of comments.
-
Get a page of sorted feed items from a record feed for a user or record. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
-
getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix)
Get feed items from a feed filtered by a key prefix for a user.
-
getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
Get a page of sorted feed items from a feed filtered by a key prefix for a user.
-
Get a page of sorted feed items from a feed filtered by a key prefix for a user. Each feed item contains no more than the specified number of comments.
-
Get a page of feed items from a feed filtered by a key prefix for a user. Include only feed items that have been updated since the time specified in the updatedSince parameter.
-
Get a page of feed items from the
Company,Home, andModerationfeeds. Include only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments. -
Get a page of feed items from the
Files,Groups,News,People, andRecordfeeds. Include only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments. -
Get a page of feed items from a record feed. Include only feed items that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
-
getFeedPoll(communityId, feedItemId)
Get the poll associated with a feed item.
-
getLikesForFeedItem(communityId, feedItemId)
Get likes for a feed item.
-
getLikesForFeedItem(communityId, feedItemId, pageParam, pageSize)
Get a page of likes for a feed item.
-
likeFeedItem(communityId, feedItemId)
Like a feed item for the context user.
-
postComment(communityId, feedItemId, text)
Post a plain-text comment to a feed item.
-
postComment(communityId, feedItemId, comment, feedItemFileUpload)
Post a rich-text comment to a feed item. Use this method to include mentions and to attach a file to a comment.
-
postFeedElement(communityId, feedElement, feedElementFileUpload)
Post a rich-text feed element. Include mentions and hashtag topics, attach a file to a feed element, and associate action link groups with a feed element. You can also use this method to share a feed element and add a comment.
-
postFeedItem(communityId, feedType, subjectId, text)
Post a plain-text feed item.
-
postFeedItem(communityId, feedType, subjectId, feedItemInput, feedItemFileUpload)
Post a rich-text feed item to a feed. Use this method to include mentions and hashtag topics and to attach a file to a feed item. You can also use this method to share a feed item and add a comment.
-
searchFeedItems(communityId, q)
Get the feed items that match the search criteria.
-
searchFeedItems(communityId, q, sortParam)
Get the sorted feed items that match the search criteria.
-
searchFeedItems(communityId, q, pageParam, pageSize)
Get a page of feed items that match the search criteria.
-
searchFeedItems(communityId, q, pageParam, pageSize, sortParam)
Get a page of sorted feed items that match the search criteria.
-
searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
Get a page of sorted feed items that match the search criteria.
-
searchFeedItemsInFeed(communityId, feedType, q)
Get the feed items from the
Company,Home, andModerationfeeds that match the search criteria. -
searchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
Get a page of sorted feed items from the
Company,Home, andModerationfeeds that match the search criteria. -
Get a page of sorted feed items from the
Company,Home, andModerationfeeds that match the search criteria. Each feed item includes no more than the specified number of comments. -
searchFeedItemsInFeed(communityId, feedType, subjectId, q)
Get the feed items from a feed that match the search criteria.
-
searchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
Get a page of sorted feed items from a feed for a user or record that match the search criteria.
-
Get a page of sorted feed items from a feed that match the search criteria. Each feed item includes no more than the specified number of comments.
-
Get a page of sorted feed items from a feed for a user or record that match the search criteria. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
-
searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q)
Get the feed items that match the search criteria from a feed filtered by a key prefix for a user.
-
searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
Get a page of sorted feed items that match the search criteria from a feed filtered by a key prefix for a user.
-
Get a page of sorted feed items that match the search criteria from a feed filtered by a key prefix for a user. Each feed item includes no more than the specified number of comments.
-
shareFeedElement(communityId, subjectId, feedElementType, originalFeedElementId)
Share the originalFeedElementId as the context user.
-
shareFeedItem(communityId, feedType, subjectId, originalFeedItemId)
Share the originalFeedItemId to the feed specified by the feedType.
-
updateBookmark(communityId, feedItemId, isBookmarkedByCurrentUser)
Bookmark a feed item or remove a bookmark from a feed item.
-
voteOnFeedPoll(communityId, feedItemId, myChoiceId)
Vote or change your vote on a feed poll.
-
setTestGetFeedItemsFromFeed(communityId, feedType, result)
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
setTestGetFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, result)
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsFromFeedis called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception. -
setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, result)
Register a
ConnectApi.FeedItemPageobject to be returned when the matchinggetFeedItemsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchinggetFeedItemsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchinggetFeedItemsFromFilterFeedmethod is called in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when thegetFeedItemsFromFilterFeedUpdatedSincemethod is called in a test context. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned whengetFeedItemsUpdatedSinceis called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception. -
setTestSearchFeedItems(communityId, q, result)
Register a test feed item page to be returned when
searchFeedItems(communityId, q)is called during a test. -
setTestSearchFeedItems(communityId, q, sortParam, result)
Register a test feed item page to be returned when
searchFeedItems(String, String, ConnectApi.FeedSortOrder)is called during a test. -
setTestSearchFeedItems(communityId, q, pageParam, pageSize, result)
Register a test feed item page to be returned when
searchFeedItems(String, String, String, Integer)is called during a test. -
setTestSearchFeedItems(communityId, q, pageParam, pageSize, sortParam, result)
Register a test feed item page to be returned when
searchFeedItems(String, String, String, Integer, ConnectApi.FeedSortOrder)is called during a test. -
setTestSearchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)
Register a test feed item page to be returned when
searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)is called during a test. -
setTestSearchFeedItemsInFeed(communityId, feedType, q, result)
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, q, result)
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
setTestSearchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception. -
Register a
ConnectApi.FeedItemPageobject to be returned when the matchingConnectApi.searchFeedItemsInFilterFeedmethod is called in a test context. Use the method with the same parameters or you receive an exception.
Delete a feed item.
28.0–31.0
In version 32.0 and later, use deleteFeedElement(communityId, feedElementId).
Yes
public static Void deleteFeedItem(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: Void
Get comments for a feed item.
28.0–31.0
In version 32.0 and later, use getCommentsForFeedElement(communityId, feedElementId).
31.0 only
Yes
public static ConnectApi.CommentPage getCommentsForFeedItem(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: ConnectApi.CommentPage
Get a page of comments for a feed item.
28.0–31.0
In version 32.0 and later, use getCommentsForFeedElement(communityId, feedElementId, pageParam, pageSize).
31.0 only
Yes
public static ConnectApi.CommentPage getCommentsForFeedItem(String communityId, String feedItemId, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
- pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, 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.CommentPage
Get a feed item.
28.0–31.0
In version 32.0 and later, use getFeedElement(communityId, feedElementId).
31.0 only
Yes
public static ConnectApi.FeedItem getFeedItem(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: ConnectApi.FeedItem
Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.
Get a list of feed items.
31.0–31.0
In version 32.0 and later, use getFeedElementBatch(communityId, feedElementIds).
Yes
public static ConnectApi.BatchResult[] getFeedItemBatch(String communityId, List<String> feedItemIds)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemIds
Type: List<String>
A list of up to 500 feed item IDs.
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedItem object and errors for feed items that didn’t load.
Get feed items from the Company, Home, and Moderation feeds.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from the Company, Home, and Moderation feeds.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from the Company, Home, and Moderation feeds. Each feed item contains no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get feed items from a feed for a user or record.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, subjectId).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed for a user or record.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed for a user or record. Each feed item includes no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a record feed for a user or record. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
30.0–31.0
In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get feed items from a feed filtered by a key prefix for a user.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix).
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed filtered by a key prefix for a user.
28.0–31.0
In version 32.0 and later, use getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam).
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed filtered by a key prefix for a user. Each feed item contains no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam).
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed items from a feed filtered by a key prefix for a user. Include only feed items that have been updated since the time specified in the updatedSince parameter.
30.0–31.0
In version 32.0 and later, use getFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince).
Yes
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
Opaque token containing information about the last modified date of the feed. Do not construct this token. To retrieve this token, call getFeedItemsFromFilterFeed and take the value from the updatesToken property of the ConnectApi.FeedItemPage response body.
Type: ConnectApi.FeedItemPage
This method returns only feed items that have been updated since the time specified in the updatedSince argument. A feed item is considered to be updated if it was created since the last feed request, or if sort=LastModifiedDateDesc and a comment was added to the feed item since the last feed request. Adding likes and topics doesn’t update a feed item.
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
- setTestGetFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, updatedSince, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed items from the Company, Home, and Moderation feeds. Include only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments.
30.0–31.0
In version 32.0 and later, use getFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
Type: ConnectApi.FeedItemPage
This method returns only feed items that have been updated since the time specified in the updatedSince argument. A feed item is considered to be updated if it was created since the last feed request, or if sort=LastModifiedDateDesc and a comment was added to the feed item since the last feed request. Adding likes and topics doesn’t update a feed item.
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.
This example gets the feed items in the company feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
See Also
- setTestGetFeedItemsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, ConnectApi.FeedItemPage, results)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed items from the Files, Groups, News, People, and Record feeds. Include only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments.
30.0–31.0
In version 32.0 and later, use getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
One of these values:
FilesGroupsNewsPeopleRecord
subjectId
Type: String
If feedType is ConnectApi.Record, subjectId can be any record ID, including a group ID. Otherwise, it must be the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
Type: ConnectApi.FeedItemPage
This method returns only feed items that have been updated since the time specified in the updatedSince argument. A feed item is considered to be updated if it was created since the last feed request, or if sort=LastModifiedDateDesc and a comment was added to the feed item since the last feed request. Adding likes and topics doesn’t update a feed item.
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.
This example gets the feed items in the news feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
See Also
- setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed items from a record feed. Include only feed items that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
30.0–31.0
In version 32.0 and later, use getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly).
31.0 only
Yes
public static ConnectApi.FeedItemPage getFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedItemPage
This method returns only feed items that have been updated since the time specified in the updatedSince argument. A feed item is considered to be updated if it was created since the last feed request, or if sort=LastModifiedDateDesc and a comment was added to the feed item since the last feed request. Adding likes and topics doesn’t update a feed item.
If showInternalOnly is true and digital experiences is enabled, feed items from Experience Cloud sites are included. Otherwise, only feed items from the internal site are included.
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.
This example gets the feed items in the news feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
See Also
- setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the poll associated with a feed item.
28.0–31.0
In version 32.0 and later, use getFeedElementPoll(communityId, feedElementId).
Yes
public static ConnectApi.FeedPoll getFeedPoll(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: ConnectApi.FeedPoll
Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.
Get likes for a feed item.
28.0–31.0
In version 32.0 and later, use getLikesForFeedElement(communityId, feedElementId).
31.0 only
Yes
public static ConnectApi.ChatterLikePage getLikesForFeedItem(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: ConnectApi.ChatterLikePage
Get a page of likes for a feed item.
28.0–31.0
In version 32.0 and later, use getLikesForFeedElement(communityId, feedElementId, pageParam, pageSize).
31.0 only
Yes
public static ConnectApi.ChatterLikePage getLikesForFeedItem(String communityId, String feedItemId, Integer pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
- pageParam
Type: Integer
Number of the page you want returned. Starts at 0. If you pass in
nullor 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.ChatterLikePage
Like a feed item for the context user.
28.0–31.0
In version 32.0 and later, use likeFeedElement(communityId, feedElementId).
Yes
public static ConnectApi.ChatterLike likeFeedItem(String communityId, String feedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
Type: ConnectApi.ChatterLike
If the context user already liked the feed item, this method is a non-operation and returns the existing like.
Post a plain-text comment to a feed item.
28.0–31.0
In version 32.0 and later, use postCommentToFeedElement(communityId, feedElementId, text).
Yes
public static ConnectApi.Comment postComment(String communityId, String feedItemId, String text)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
- text
Type: String
The text of the comment. Mentions are downgraded to plain text. To include a mention that links to a user, call
postComment(communityId, feedItemId, comment, feedItemFileUpload)and pass the mention in aConnectApi.CommentInputobject.
Type: ConnectApi.Comment
If hashtags or links are detected in text, they’re included in the comment as hashtag and link segments. Mentions aren’t detected in text and aren’t separated out of the text.
Feed items and comments can contain up to 10,000 characters.
Post a rich-text comment to a feed item. Use this method to include mentions and to attach a file to a comment.
28.0–31.0
In version 32.0 and later, use postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload).
Yes
public static ConnectApi.Comment postComment(String communityId, String feedItemId, ConnectApi.CommentInput comment, ConnectApi.BinaryInput feedItemFileUpload)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
- comment
Type:
ConnectApi.CommentInputIn the
CommentInputobject, specify rich text, including @mentions. Optionally, in theCommentInput.attachmentproperty, specify an existing file or a new file- feedItemFileUpload
Type:
ConnectApi.BinaryInputIf you specify a
NewFileAttachmentInputobject in theCommentInput.attachmentproperty, specify the new binary file to attach in this argument. Otherwise, do not specify a value.
Type: ConnectApi.Comment
Feed items and comments can contain up to 10,000 characters.
To post a comment and upload and attach a new file to the comment, create a ConnectApi.CommentInput object and a ConnectApi.BinaryInput object to pass to the ConnectApi.ChatterFeeds.postComment method.
Post a rich-text feed element. Include mentions and hashtag topics, attach a file to a feed element, and associate action link groups with a feed element. You can also use this method to share a feed element and add a comment.
31.0–35.0
In version 36.0 and later, this method is no longer available because you can’t create a feed post and upload a binary file in the same call. Upload files to Salesforce first, and then use postFeedElement(communityId, feedElement) to create the feed post and attach the files.
Yes
public static ConnectApi.FeedElement postFeedElement(String communityId, ConnectApi.FeedElementInput feedElement, ConnectApi.BinaryInput feedElementFileUpload)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedElement
Type:
ConnectApi.FeedElementInputSpecify rich text, including mentions. Optionally, specify a link, a poll, an existing file, or a new file.
- feedElementFileUpload
Type:
ConnectApi.BinaryInputSpecify the new binary file to attach to the post only if you also specify a
NewFileAttachmentInputobject in the feedElement parameter. Otherwise, passnull.
Type: ConnectApi.FeedElement
Post a plain-text feed item.
28.0–31.0
In version 32.0 and later, use postFeedElement(communityId, subjectId, feedElementType, text).
Yes
public static ConnectApi.FeedItem postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeOne of the following:
NewsRecordUserProfile
Use
Recordto post to a group.- subjectId
Type: String
The value depends on the feedType:
News—ID of the context user or the keywordme.Record—ID of any record with a feed, including groups.UserProfile—ID of any user.
- text
Type: String
Text of the feed item. Mentions are downgraded to plain text. To include a mention that links to the user, call the
postFeedItem(communityId, feedType, subjectId, feedItemInput, feedItemFileUpload)method and pass the mention in aConnectApi.FeedItemInputobject.
Type: ConnectApi.FeedItem
Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.
Feed items and comments can contain up to 10,000 characters.
Posts to ConnectApi.FeedType.UserProfile in API versions 23.0 and 24.0 created user status updates, not feed items. For posts to the User Profile Feed in those API versions, the character limit is 1,000 characters.
Post a rich-text feed item to a feed. Use this method to include mentions and hashtag topics and to attach a file to a feed item. You can also use this method to share a feed item and add a comment.
28.0–31.0
In version 32.0 and later, use postFeedElement(communityId, feedElement, feedElementFileUpload).
Yes
public static ConnectApi.FeedItem postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedItemInput feedItemInput, ConnectApi.BinaryInput feedItemFileUpload)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeOne of the following:
NewsRecordUserProfile
To post a feed item to a group, use
Recordand use a group ID as the subjectId.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.- feedItemInput
Type:
ConnectApi.FeedItemInputIn the
FeedItemInputobject, specify rich text. Optionally, in theFeedItemInput.attachmentproperty, specify a link, a poll, an existing file, or a new file.- feedItemFileUpload
Type:
ConnectApi.BinaryInputIf you specify a
NewFileAttachmentInputobject in theFeedItemInput.attachmentproperty, specify the new binary file to attach in this argument. Otherwise, do not specify a value.
Type: ConnectApi.FeedItem
Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.
Feed items and comments can contain up to 10,000 characters. Posts to ConnectApi.FeedType.UserProfile in API versions 23.0 and 24.0 created user status updates, not feed items. For posts to the User Profile Feed in those API versions, the character limit is 1,000 characters.
To share a feed item and add a comment, create a ConnectApi.FeedItemInput object containing the comment and the feed item to share. Then pass the object to ConnectApi.ChatterFeeds.postFeeditem in the feedItemInput argument. The message segments in the message body input are used as the comment.
To post to a user profile feed and include an @mention, call the ConnectApi.ChatterFeeds.postFeedItem method.
Get the feed items that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElements(communityId, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.
Type: ConnectApi.FeedItemPage
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 the sorted feed items that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElements(communityId, q, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, ConnectApi.FeedSortOrder sortParam)
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.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItems(communityId, q, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of feed items that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElements(communityId, q, pageParam, pageSize).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, String pageParam, Integer pageSize)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItems(communityId, q, pageParam, pageSize, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElements(communityId, q, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItems(communityId, q, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items that match the search criteria.
29.0–31.0
In version 32.0 and later, use searchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed items from the Company, Home, and Moderation feeds that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.- 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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from the Company, Home, and Moderation feeds that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from the Company, Home, and Moderation feeds that match the search criteria. Each feed item includes no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed items from a feed that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, subjectId, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessages,Filter,Landing, andStreams.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feed type isUserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the aliasme.- 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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed for a user or record that match the search criteria.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, and Streams.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Order of feed items in the feed.
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter doesn’t support wildcards. This parameter is required.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed that match the search criteria. Each feed item includes no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, and Streams.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items from a feed for a user or record that match the search criteria. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-Experience Cloud site) users only.
30.0–31.0
In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly).
31.0 only
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.Record.
subjectId
Type: String
Any record ID, including a group ID.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)
- Apex Developer Guide: Testing ConnectApi Code
Get the feed items that match the search criteria from a feed filtered by a key prefix for a user.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q).
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- 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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items that match the search criteria from a feed filtered by a key prefix for a user.
28.0–31.0
In version 32.0 and later, use searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q).
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFilterFeed(communityId, feedType, subjectId, keyPrefix, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Get a page of sorted feed items that match the search criteria from a feed filtered by a key prefix for a user. Each feed item includes no more than the specified number of comments.
29.0–31.0
In version 32.0 and later, use searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q).
Yes
public static ConnectApi.FeedItemPage searchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
Type: ConnectApi.FeedItemPage
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
- setTestSearchFeedItemsInFilterFeed(communityId, feedType, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
- Apex Developer Guide: Testing ConnectApi Code
Share the originalFeedElementId as the context user.
31.0–38.0
In version 39.0 and later, use postFeedElement(communityId, feedElement) or updateFeedElement(communityId, feedElementId, feedElement) with the ConnectApi.FeedEntityShareCapabilityInput to share a feed entity with a feed element.
Yes
public static ConnectApi.FeedElement shareFeedElement(String communityId, String subjectId, ConnectApi.FeedElementType feedElementType, String originalFeedElementId)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
The ID of the user or group with whom to share the feed element.
feedElementType
Type: ConnectApi.FeedElementType
Values are:
Bundle—A container of feed elements. A bundle also has a body made up of message segments that can always be gracefully degraded to text-only values.FeedItem—A feed item has a single parent and is scoped to oneExperience Cloud site or across all Experience Cloud sites. A feed item can have capabilities such as bookmarks, canvas, content, comment, link, poll. Feed items have a body made up of message segments that can always be gracefully degraded to text-only values.Recommendation—A recommendation is a feed element with a recommendations capability. A recommendation suggests records to follow, groups to join, or applications that are helpful to the context user.
originalFeedElementId
Type: String
The ID of the feed element to share.
Type: ConnectApi.FeedElement
Share the originalFeedItemId to the feed specified by the feedType.
28.0–31.0
- In version 32.0–38.0, use
shareFeedElement(communityId, subjectId, feedElementType, originalFeedElementId). - In version 39.0 and later, use
postFeedElement(communityId, feedElement)orupdateFeedElement(communityId, feedElementId, feedElement)with theConnectApi.FeedEntityShareCapabilityInput.
Yes
public static ConnectApi.FeedItem shareFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String originalFeedItemId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeOne of the following:
NewsRecordUserProfile
To share a feed item with a group, use
Recordand use a group ID as the subjectId.- subjectId
Type: String
The value depends on the value of feedType:
News—subjectId must be the ID of the context user or the keywordme.Record—subjectId can be a group ID or the ID of the context user (orme).UserProfile—subjectId can be any user ID.
- originalFeedItemId
Type: String
The ID of the feed item to share.
Type: ConnectApi.FeedItem
To share a feed item with a group, pass in the Experience Cloud site ID (or null), the feed type Record, the group ID, and the ID of the feed item to share.
Bookmark a feed item or remove a bookmark from a feed item.
28.0–31.0
In version 32.0 and later, use updateFeedElementBookmarks(communityId, feedElementId, bookmarks) or updateFeedElementBookmarks(communityId, feedElementId, isBookmarkedByCurrentUser).
Yes
public static ConnectApi.FeedItem updateBookmark(String communityId, String feedItemId, Boolean isBookmarkedByCurrentUser)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID for a feed item.
- isBookmarkedByCurrentUser
Type: Boolean
—Specifying
trueadds the feed item to the list of bookmarks for the context user. Specifyfalseto remove a bookmark.
Type: ConnectApi.FeedItem
Vote or change your vote on a feed poll.
28.0–31.0
In version 32.0 and later, use voteOnFeedElementPoll(communityId, feedElementId, myChoiceId).
Yes
public static ConnectApi.FeedPoll voteOnFeedPoll(String communityId, String feedItemId, String myChoiceId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedItemId
Type: String
ID of the feed item that is associated with the poll.
- myChoiceId
Type: String
ID of the item in the poll you’re voting for.
Type: ConnectApi.FeedPoll
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.- result
Type:
ConnectApi.FeedItemPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
29.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessageModeration,DirectMessages,Filter,Home,Isolated,Landing,Moderation, andPendingReview.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.- result
Type:
ConnectApi.FeedItemPageObject containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, subjectId)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
29.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.
30.0–31.0
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching getFeedItemsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- result
Type:
ConnectApi.FeedItemPageObject containing test data.
Type: Void
See Also
- getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching getFeedItemsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
28.0–31.0
public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching getFeedItemsFromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.
29.0–31.0
public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the getFeedItemsFromFilterFeedUpdatedSince method is called in a test context.
30.0–31.0
public static Void setTestGetFeedItemsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String updatedSince, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
updatedSince
Type: String
Opaque token containing information about the last modified date of the feed. Do not construct this token. To retrieve this token, call getFeedItemsFromFilterFeed and take the value from the updatesToken property of the ConnectApi.FeedItemPage response body.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
30.0–31.0
public static Void setTestGetFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedItemPage results)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
30.0–31.0
public static Void setTestGetFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
One of these values:
FilesGroupsNewsPeopleRecord
subjectId
Type: String
If feedType is ConnectApi.Record, subjectId can be any record ID, including a group ID. Otherwise, it must be the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when getFeedItemsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.
30.0–31.0
public static Void setTestGetFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
One of these values:
FilesGroupsNewsPeopleRecord
subjectId
Type: String
If feedType is ConnectApi.Record, subjectId can be any record ID, including a group ID. Otherwise, it must be the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
updatedSince
Type: String
An opaque token containing information about the last modified date of the feed. Do not construct this token. Retrieve this token from the updatesToken property of the ConnectApi.FeedItemPage response body.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- getFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a test feed item page to be returned when searchFeedItems(communityId, q) is called during a test.
28.0–31.0
public static Void searchFeedItems(String communityId, String q, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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.FeedItemPageObject containing test data.
Type: Void
See Also
Register a test feed item page to be returned when searchFeedItems(String, String, ConnectApi.FeedSortOrder) is called during a test.
28.0–31.0
public static Void setTestSearchFeedItems(String communityId, String q, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
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.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The feed item test page.
Type: Void
See Also
Register a test feed item page to be returned when searchFeedItems(String, String, String, Integer) is called during a test.
28.0–31.0
public static Void setTestSearchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example,
currentPageTokenornextPageToken. If you pass innull, the first page is returned.- pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in
null, the default size is 25.- result
Type:
ConnectApi.FeedItemPageThe test feed item page.
Type: Void
See Also
Register a test feed item page to be returned when searchFeedItems(String, String, String, Integer, ConnectApi.FeedSortOrder) is called during a test.
28.0–31.0
public static Void setTestSearchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The test feed item page.
Type: Void
See Also
- searchFeedItems(communityId, q, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a test feed item page to be returned when searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam) is called during a test.
29.0–31.0
public static Void setTestSearchFeedItems(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The test feed item page.
Type: Void
See Also
- searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String q, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values are
Company,DirectMessageModeration,DirectMessages,Home,Isolated,Moderation, andPendingReview.- 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.FeedItemPageObject containing test data.
Type: Void
See Also
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Object containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
29.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Object containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- feedType
Type:
ConnectApi.FeedTypeType of feed. Valid values include every
ConnectApi.FeedTypeexceptCompany,DirectMessages,Filter,Landing, andStreams.- subjectId
Type: String
If feedType is
Record, subjectId can be any record ID, including a group ID. If feedType isStreams, subjectId must be a stream ID. If feedType isTopics, subjectId must be a topic ID. If feedType isUserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the aliasme.- 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.FeedItemPageObject containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, subjectId, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, and Streams.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Object containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
29.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, and Streams.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Object containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
29.0–31.0
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, Boolean showInternalOnly, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessages, Filter, Landing, and Streams.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is Streams, subjectId must be a stream ID. If feedType is Topics, subjectId must be a topic ID. If feedType is UserProfile, subjectId can be any user ID. If the feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-Experience Cloud site) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
Object containing test data.
Type: Void
See Also
- searchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q, ConnectApi.FeedItemPage result)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- subjectId
Type: String
ID of the context user or the alias
me.- keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
- 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.FeedItemPageSpecify the test feed item page.
Type: Void
See Also
- searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
28.0–31.0
public static Void setTestSearchFeedItemsInFilterFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Specify the test feed item page.
Type: Void
See Also
- searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
- Apex Developer Guide: Testing ConnectApi Code
Register a ConnectApi.FeedItemPage object to be returned when the matching ConnectApi.searchFeedItemsInFilterFeed method is called in a test context. Use the method with the same parameters or you receive an exception.
29.0–31.0
public static Void setTestSearchFeedItemsInFilterFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
communityId
Type: String
ID for an Experience Cloud site, internal, or null.
feedType
Type: ConnectApi.FeedType
Type of feed. Valid values include every ConnectApi.FeedType except Company, DirectMessageModeration, DirectMessages, Filter, Home, Isolated, Landing, Moderation, and PendingReview.
subjectId
Type: String
ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix that specifies record type. A key prefix is the first three characters in 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.
recentCommentCount
Type: Integer
Maximum number of comments to return with each feed item. The default value is 3.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations.FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of. Also displays custom recommendations, but hides some system-generated updates from records.
pageParam
Type: String
Page token to use to view the page. Page tokens are returned as part of the response class, for example, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
pageSize
Type: Integer
Number of feed items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
CreatedDateAsc—Sorts by oldest creation date. This sort order is available only forDirectMessageModeration,Draft,Isolated,Moderation, andPendingReviewfeeds.CreatedDateDesc—Sorts by most recent creation date.LastModifiedDateDesc—Sorts by most recent activity.MostViewed—Sorts by most viewed content. This sort order is available only forHomefeeds when theConnectApi.FeedFilterisUnansweredQuestions.Relevance—Sorts by most relevant content. This sort order is available only forCompany,Home, andTopicsfeeds.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
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.FeedItemPage
Specify the test feed item page.
Type: Void
See Also