ChatterFeeds Class
Namespace
Usage
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.
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.
ChatterFeeds Methods
All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.
createStream(communityId, streamInput)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStream createStream(String communityId, ConnectApi.ChatterStreamInput streamInput)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- streamInput
- Type: ConnectApi.ChatterStreamInput
- A ConnectApi.ChatterStreamInput body.
Return Value
Type: ConnectApi.ChatterStream
deleteFeedElement(communityId, feedElementId)
API Version
31.0
Requires Chatter
Yes
Signature
public static deleteFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: Void
deleteStream(communityId, streamId)
API Version
39.0
Requires Chatter
Yes
Signature
public static Void deleteStream(String communityId, String streamId)
Parameters
Return Value
Type: Void
getComment(communityId, commentId)
API Version
28.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment getComment(String communityId, String commentId)
Parameters
Return Value
Type: ConnectApi.Comment
getCommentBatch(communityId, commentIds)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] getCommentBatch(String communityId, List<String> commentIds)
Parameters
Return Value
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.Comment object and errors for comments that didn’t load.
getCommentInContext(communityId, commentId, pageSize)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getCommentInContext(String communityId, String commentId, Integer pageSize)
Parameters
Return Value
Type: ConnectApi.FeedElement
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
getCommentsForFeedElement(communityId, feedElementId)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
getCommentsForFeedElement(communityId, feedElementId, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.getCommentsForFeedElement(communityId, feedElementId, pageParam, pageSize)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
getCommentsForFeedElement(communityId, feedElementId, pageParam, pageSize, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.getCommentsForFeedElement(communityId, feedElementId, threadedCommentsCollapsed, sortParam)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder sortParam)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
getCommentsForFeedElement(communityId, feedElementId, pageParam, pageSize, threadedCommentsCollapsed, sortParam)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder sortParam)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentPage
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.getCommentsForFeedElement(communityId, feedElementId, sortParam)
API Version
41.0
Available to Guest Users
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder sortParam)
Parameters
- 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.
Return Value
Type: ConnectApi.CommentsCapability
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
getCommentsForFeedElement(communityId, feedElementId, sortParam, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentsCapability getCommentsForFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder sortParam, Boolean threadedCommentsCollapsed)
Parameters
- 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.
- 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.
Return Value
Type: ConnectApi.CommentsCapability
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
getExtensions(communityId, pageParam, pageSize)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ExtensionDefinitions getExtensions(String communityId, String pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 items per page. Valid values are from 1 through 100. The default size is 15.
Return Value
getFeed(communityId, feedType)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType)
Parameters
- 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.
Return Value
Type: ConnectApi.Feed
getFeed(communityId, feedType, sortParam)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Return Value
Type: ConnectApi.Feed
getFeed(communityId, feedType, subjectId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
Parameters
- 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.
Return Value
Type: ConnectApi.Feed
getFeed(communityId, feedType, subjectId, sortParam)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.Feed
getFeedDirectory(String)
API Version
30.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedDirectory getFeedDirectory(String communityId)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
Return Value
Type: ConnectApi.FeedDirectory
getFeedElement(communityId, feedElementId)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, commentSort)
API Version
41.0
Available to Guest Users
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, ConnectApi.FeedCommentSortOrder commentSort)
Parameters
- 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.
Sorting in descending order isn’t supported.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, threadedCommentsCollapsed, commentSort)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder commentSort)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, Boolean threadedCommentsCollapsed)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle, threadedCommentsCollapsed, commentSort)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, Boolean threadedCommentsCollapsed, ConnectApi.FeedCommentSortOrder commentSort)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedElement
getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle, commentSort)
API Version
41.0
Available to Guest Users
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedCommentSortOrder commentSort)
Parameters
- 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.
Sorting in descending order isn’t supported.
Return Value
Type: ConnectApi.FeedElement
getFeedElementBatch(communityId, feedElementIds)
API Version
31.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] getFeedElementBatch(String communityId, List<String> feedElementIds)
Parameters
Return Value
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedElement object and errors for feed elements that didn’t load.
getFeedElementPoll(communityId, feedElementId)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.PollCapability getFeedElementPoll(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.PollCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getFeedElementsFromBundle(communityId, feedElementId)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromBundle(String communityId, String feedElementId)
Parameters
Return Value
getFeedElementsFromBundle(communityId, feedElementId, pageParam, pageSize, elementsPerBundle, recentCommentCount)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromBundle(String communityId, String feedElementId, String pageParam, Integer pageSize, Integer elementsPerBundle, Integer recentCommentCount)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 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.
- 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.
Return Value
getFeedElementsFromFeed(communityId, feedType)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType)
Parameters
- 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.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
If feedType is DirectMessages, sortParam must be LastModifiedDateDesc.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Usage
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.
getFeedElementsFromFeed(communityId, feedType, subjectId)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
Parameters
- 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.
Return Value
Usage
Example for Getting the Context User’s News Feed
ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.News, 'me');
Example for Getting Another User’s Profile Feed
ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.UserProfile, '005R0000000HwMA');
Example for Getting Another User’s Record Feed
ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.Record, '005R0000000HwMA');
getFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter)
API Version
35.0
Available to Guest Users
35.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- filter
- Type: ConnectApi.FeedFilter
- Value must be ConnectApi.FeedFilter.CommunityScoped or ConnectApi.FeedFilter.AuthoredBy.
Return Value
Usage
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.
Example
ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.UserProfile, 'me', 3, ConnectApi.FeedDensity.FewerUpdates, null, null, ConnectApi.FeedSortOrder.LastModifiedDateDesc, ConnectApi.FeedFilter.CommunityScoped);
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- customFilter
- Type: String
- Custom filter that applies only to the case feed. See customFeedFilter in the Metadata API Developer Guide for supported values.
Return Value
Usage
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.
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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.
- QuestionsWithCandidateAnswers���ReviewedPublished—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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
getFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix)
Parameters
- 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.
Return Value
Usage
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.
getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
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.
getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam)
API Version
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
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.
getFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerBundle, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- 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.
Return Value
Usage
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.
getFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- 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.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedFilter filter)
Parameters
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of these values:
- Files
- Groups
- News
- People
- Record
- 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.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, filter)
API Version
35.0
Available to Guest Users
35.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Usage
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.
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Usage
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.
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
getFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Usage
getFeedWithFeedElements(communityId, feedType, pageSize)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeedWithFeedElements(String communityId, ConnectApi.FeedType feedType, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- The type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Landing, Moderation, and PendingReview. Landing is valid only when communityId is internal.
- 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.
Return Value
Type: ConnectApi.Feed
getFeedWithFeedElements(communityId, feedType, pageSize, recentCommentCount)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFeedWithFeedElements(String communityId, ConnectApi.FeedType feedType, Integer pageSize, Integer recentCommentCount)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- The type of feed. Valid values are Company, DirectMessageModeration, DirectMessages, Home, Isolated, Landing, Moderation, and PendingReview. Landing is valid only when communityId is internal.
- 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.
Return Value
Type: ConnectApi.Feed
getFilterFeed(communityId, subjectId, keyPrefix)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFilterFeed(String communityId, String subjectId, String keyPrefix)
Parameters
Return Value
Type: ConnectApi.Feed
getFilterFeed(communityId, subjectId, keyPrefix, sortParam)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.Feed getFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedType sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.Feed
getFilterFeedDirectory(communityId, subjectId)
API Version
30.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedDirectory getFilterFeedDirectory(String communityId, String subjectId)
Parameters
Return Value
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.
Usage
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.
Example
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.
String communityId = null;
String subjectId = 'me';
// Create a list to populate with key prefixes.
List<String> keyPrefixList = new List<String>();
// Prepopulate with User and Group record types
// which are available to all users.
keyPrefixList.add('005');
keyPrefixList.add('0F9');
System.debug(keyPrefixList);
// Get the key prefixes available to the context user.
ConnectApi.FeedDirectory myFeedDirectory =
ConnectApi.ChatterFeeds.getFilterFeedDirectory(null, 'me');
// Loop through the returned feeds list.
for (ConnectApi.FeedDirectoryItem i : myFeedDirectory.feeds) {
// Grab each key prefix and add it to the list.
keyPrefixList.add(i.keyPrefix);
}
System.debug(keyPrefixList);
// Use a key prefix from the list to filter the feed items in the news feed.
ConnectApi.FeedItemPage myFeedItemPage =
ConnectApi.ChatterFeeds.getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefixList[0]);
System.debug(myFeedItemPage);
getLike(communityId, likeId)
API Version
28.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLike getLike(String communityId, String likeId)
Parameters
Return Value
Type: ConnectApi.ChatterLike
getLikesForComment(communityId, commentId)
API Version
28.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForComment(String communityId, String commentId)
Parameters
Return Value
getLikesForComment(communityId, commentId, pageParam, pageSize)
API Version
28.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForComment(String communityId, String commentId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID for a comment.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getLikesForFeedElement(communityId, feedElementId)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
getLikesForFeedElement(communityId, feedElementId, pageParam, pageSize)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForFeedElement(String communityId, String feedElementId, Integer pageParam, Integer pageSize)
Parameters
- 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 items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
getLinkMetadata(communityId, urls)
API Version
42.0
Available to Guest Users
42.0
Requires Chatter
No
Signature
public static ConnectApi.LinkMetadataCollection getLinkMetadata(String communityId, String urls)
Parameters
Return Value
getPinnedFeedElementsFromFeed(communityId, feedType, subjectId)
API Version
41.0
Available to Guest Users
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.PinnedFeedElements getPinnedFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- The type of feed. Valid values are Record and Topics.
- subjectId
- Type: String
- If feedType is Record, subjectId must be a group ID. If feedType is Topics, subjectId must be a topic ID.
Return Value
Type: ConnectApi.PinnedFeedElements
If the feed doesn’t support this capability, the return value is ConnectApi.NotFoundException.getReadByForFeedElement(communityId, feedElementId)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ReadByPage getReadByForFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.ReadByPage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getReadByForFeedElement(communityId, feedElementId, pageParam, pageSize)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ReadByPage getReadByForFeedElement(String communityId, String feedElementId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 currentPageToken or nextPageToken. If you pass in null, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.ReadByPage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getRelatedPosts(communityId, feedElementId, filter, maxResults)
API Version
37.0
Available to Guest Users
37.0
Requires Chatter
Yes
Signature
public static ConnectApi.RelatedFeedPosts getRelatedPosts(String communityId, String feedElementId, ConnectApi.RelatedFeedPostType filter, Integer maxResults)
Parameters
- 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.
- maxResults
- Type: Integer
- The maximum number of results to return. You can return up to 25 results; 5 is the default.
Return Value
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.
Usage
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.
getStream(communityId, streamId)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStream getStream(String communityId, String streamId)
Parameters
Return Value
Type: ConnectApi.ChatterStream
getStream(communityId, streamId, globalScope)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStream getStream(String communityId, String streamId, Boolean globalScope)
Parameters
Return Value
Type: ConnectApi.ChatterStream
getStreams(communityId)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage getStreams(String communityId)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
Return Value
getStreams(communityId, sortParam)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage getStreams(String communityId, ConnectApi.SortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
Return Value
getStreams(communityId, pageParam, pageSize)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
Return Value
getStreams(communityId, pageParam, pageSize, sortParam)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
Return Value
getStreams(communityId, pageParam, pageSize, sortParam, globalScope)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage getStreams(String communityId, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
- globalScope
- Type: Boolean
- Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value.
Return Value
getSupportedEmojis()
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.SupportedEmojis getSupportedEmojis()
Return Value
getThreadsForFeedComment(communityId, commentId)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getThreadsForFeedComment(String communityId, String commentId)
Parameters
Return Value
Type: ConnectApi.CommentPage
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
getThreadsForFeedComment(communityId, commentId, pageParam, pageSize)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getThreadsForFeedComment(String communityId, String commentId, String pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 currentPageToken or nextPageToken. If you pass in null, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.CommentPage
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
getThreadsForFeedComment(communityId, commentId, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.CommentsCapability getThreadsForFeedComment(String communityId, String commentId, Boolean threadedCommentsCollapsed)
Parameters
Return Value
Type: ConnectApi.CommentsCapability
If the comment doesn’t support the comments capability, the return value is ConnectApi.NotFoundException.
getTopUnansweredQuestions(communityId) (Pilot)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
Return Value
Usage
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.
getTopUnansweredQuestions(communityId, filter) (Pilot)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, ConnectApi.TopUnansweredQuestionsFilterType filter)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
- filter
- Type: ConnectApi.FeedFilter
- Specifies the filter for the feed. UnansweredQuestionsWithCandidateAnswers is the only valid value.
Return Value
Usage
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.
getTopUnansweredQuestions(communityId, pageSize) (Pilot)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, Integer pageSize)
Parameters
Return Value
Usage
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.
getTopUnansweredQuestions(communityId, filter, pageSize) (Pilot)
API Version
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage getTopUnansweredQuestions(String communityId, ConnectApi.FeedFilter filter, Integer pageSize)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
- filter
- Type: ConnectApi.FeedFilter
- Specifies the filter for the feed. UnansweredQuestionsWithCandidateAnswers is 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.
Return Value
Usage
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.
getVotesForComment(communityId, commentId, vote)
API Version
42.0
Available to Guest Users
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.VotePage getVotesForComment(String communityId, String commentId, ConnectApi.UpDownVoteValue vote)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID of the comment.
- vote
- Type: ConnectApi.UpDownVoteValue
- Specifies the value of the vote for the feed element. Values are:
- Down
- Up
Return Value
Type: ConnectApi.VotePage
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getVotesForComment(communityId, commentId, vote, pageParam, pageSize)
API Version
42.0
Available to Guest Users
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.VotePage getVotesForComment(String communityId, String commentId, ConnectApi.UpDownVoteValue vote, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID of the comment.
- vote
- Type: ConnectApi.UpDownVoteValue
- Specifies the value of the vote for the feed element. Values are:
- Down
- Up
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.VotePage
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getVotesForFeedElement(communityId, feedElementId, vote)
API Version
42.0
Available to Guest Users
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.VotePage getVotesForFeedElement(String communityId, String feedElementId, ConnectApi.UpDownVoteValue vote)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- vote
- Type: ConnectApi.UpDownVoteValue
-
Specifies the value of the vote for the feed element. Values are:
- Down
- Up
Return Value
Type: ConnectApi.VotePage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
getVotesForFeedElement(communityId, feedElementId, vote, pageParam, pageSize)
API Version
42.0
Available to Guest Users
42.0
Requires Chatter
Yes
Signature
public static ConnectApi.VotePage getVotesForFeedElement(String communityId, String feedElementId, ConnectApi.UpDownVoteValue vote, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- vote
- Type: ConnectApi.UpDownVoteValue
- Specifies the value of the vote for the feed element. Values are:
- Down
- Up
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of feed elements per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
Type: ConnectApi.VotePage
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
isCommentEditableByMe(communityId, commentId)
API Version
34.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedEntityIsEditable isCommentEditableByMe(String communityId, String commentId)
Parameters
Return Value
Type: ConnectApi.FeedEntityIsEditable
If the comment doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
isFeedElementEditableByMe(communityId, feedElementId)
API Version
34.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedEntityIsEditable isFeedElementEditableByMe(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.FeedEntityIsEditable
If the feed element doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
isModified(communityId, feedType, subjectId, since)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedModifiedInfo isModified(String communityId, ConnectApi.FeedType feedType, String subjectId, String since)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- Specifies 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.isModifiedToken property.
Return Value
likeComment(communityId, commentId)
API Version
28.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLike likeComment(String communityId, String commentId)
Parameters
Return Value
Type: ConnectApi.ChatterLike
If the context user has already liked the comment, this method is a non-operation and returns the existing like.
likeFeedElement(communityId, feedElementId)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLike likeFeedElement(String communityId, String feedElementId)
Parameters
Return Value
Type: ConnectApi.ChatterLike
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
Example
ConnectApi.ChatterLike chatterLike = ConnectApi.ChatterFeeds.likeFeedElement(null, '0D5D0000000KuGh');
postCommentToFeedElement(communityId, feedElementId, text)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment postCommentToFeedElement(String communityId, String feedElementId, String text)
Parameters
Return Value
Type: ConnectApi.Comment
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Example
ConnectApi.Comment comment = ConnectApi.ChatterFeeds.postCommentToFeedElement(null, '0D5D0000000KuGh', 'I agree with the proposal.' );
postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment postCommentToFeedElement(String communityId, String feedElementId, ConnectApi.CommentInput comment, ConnectApi.BinaryInput feedElementFileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- comment
- Type: ConnectApi.CommentInput
- The 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.BinaryInput
- A 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.
Return Value
Type: ConnectApi.Comment
If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.
Example for Posting a Comment with Mentions
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.
String communityId = null;
String feedElementId = '0D5D0000000KtW3';
ConnectApi.CommentInput commentInput = new ConnectApi.CommentInput();
ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegmentInput.text = 'Does anyone in this group have an idea? ';
messageBodyInput.messageSegments.add(textSegmentInput);
mentionSegmentInput.id = '005D00000000oOT';
messageBodyInput.messageSegments.add(mentionSegmentInput);
commentInput.body = messageBodyInput;
ConnectApi.Comment commentRep = ConnectApi.ChatterFeeds.postCommentToFeedElement(communityId, feedElementId, commentInput, null);
Example for Posting a Comment with an Existing File
String feedElementId = '0D5D0000000KtW3';
ConnectApi.CommentInput commentInput = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
textSegmentInput.text = 'I attached this file from Salesforce Files.';
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageBodyInput.messageSegments.add(textSegmentInput);
commentInput.body = messageBodyInput;
ConnectApi.CommentCapabilitiesInput commentCapabilitiesInput = new ConnectApi.CommentCapabilitiesInput();
ConnectApi.ContentCapabilityInput contentCapabilityInput = new ConnectApi.ContentCapabilityInput();
commentCapabilitiesInput.content = contentCapabilityInput;
contentCapabilityInput.contentDocumentId = '069D00000001rNJ';
commentInput.capabilities = commentCapabilitiesInput;
ConnectApi.Comment commentRep = ConnectApi.ChatterFeeds.postCommentToFeedElement(Network.getNetworkId(), feedElementId, commentInput, null);
Example for Posting a Comment with a New File
String feedElementId = '0D5D0000000KtW3';
ConnectApi.CommentInput commentInput = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
textSegmentInput.text = 'Enjoy this new file.';
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageBodyInput.messageSegments.add(textSegmentInput);
commentInput.body = messageBodyInput;
ConnectApi.CommentCapabilitiesInput commentCapabilitiesInput = new ConnectApi.CommentCapabilitiesInput();
ConnectApi.ContentCapabilityInput contentCapabilityInput = new ConnectApi.ContentCapabilityInput();
commentCapabilitiesInput.content = contentCapabilityInput;
contentCapabilityInput.title = 'Title';
commentInput.capabilities = commentCapabilitiesInput;
String text = 'These are the contents of the new file.';
Blob myBlob = Blob.valueOf(text);
ConnectApi.BinaryInput binInput = new ConnectApi.BinaryInput(myBlob, 'text/plain', 'fileName');
ConnectApi.Comment commentRep = ConnectApi.ChatterFeeds.postCommentToFeedElement(Network.getNetworkId(), feedElementId, commentInput, binInput);
Example for Posting a Rich-Text Comment with an Inline Image
String communityId = null;
String feedElementId = '0D5R0000000SBEr';
String imageId = '069R00000000IgQ';
String mentionedUserId = '005R0000000DiMz';
ConnectApi.CommentInput input = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
ConnectApi.MentionSegmentInput mentionSegment;
ConnectApi.MarkupBeginSegmentInput markupBeginSegment;
ConnectApi.MarkupEndSegmentInput markupEndSegment;
ConnectApi.InlineImageSegmentInput inlineImageSegment;
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
markupBeginSegment = new ConnectApi.MarkupBeginSegmentInput();
markupBeginSegment.markupType = ConnectApi.MarkupType.Bold;
messageInput.messageSegments.add(markupBeginSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'Hello ';
messageInput.messageSegments.add(textSegment);
mentionSegment = new ConnectApi.MentionSegmentInput();
mentionSegment.id = mentionedUserId;
messageInput.messageSegments.add(mentionSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = '!';
messageInput.messageSegments.add(textSegment);
markupEndSegment = new ConnectApi.MarkupEndSegmentInput();
markupEndSegment.markupType = ConnectApi.MarkupType.Bold;
messageInput.messageSegments.add(markupEndSegment);
inlineImageSegment = new ConnectApi.InlineImageSegmentInput();
inlineImageSegment.altText = 'image one';
inlineImageSegment.fileId = imageId;
messageInput.messageSegments.add(inlineImageSegment);
input.body = messageInput;
ConnectApi.ChatterFeeds.postCommentToFeedElement(communityId, feedElementId, input, null);
Example for Posting a Rich-Text Comment with a Code Block
String communityId = null;
String feedElementId = '0D5R0000000SBEr';
String codeSnippet = '<html>\n\t<body>\n\t\tHello, world!\n\t</body>\n</html>';
ConnectApi.CommentInput input = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
ConnectApi.MarkupBeginSegmentInput markupBeginSegment;
ConnectApi.MarkupEndSegmentInput markupEndSegment;
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
markupBeginSegment = new ConnectApi.MarkupBeginSegmentInput();
markupBeginSegment.markupType = ConnectApi.MarkupType.Code;
messageInput.messageSegments.add(markupBeginSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = codeSnippet;
messageInput.messageSegments.add(textSegment);
markupEndSegment = new ConnectApi.MarkupEndSegmentInput();
markupEndSegment.markupType = ConnectApi.MarkupType.Code;
messageInput.messageSegments.add(markupEndSegment);
input.body = messageInput;
ConnectApi.ChatterFeeds.postCommentToFeedElement(communityId, feedElementId, input, null);
postFeedElement(communityId, subjectId, feedElementType, text)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement postFeedElement(String communityId, String subjectId, ConnectApi.FeedElementType feedElementType, String text)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 me to indicate the context user.
- feedElementType
- Type: ConnectApi.FeedElementType
- The only possible value is FeedItem.
- text
- Type: String
- The text of the feed element. A feed element can contain up to 10,000 characters.
Return Value
Type: ConnectApi.FeedElement
Example
ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), '0F9d0000000TreH', ConnectApi.FeedElementType.FeedItem, 'On vacation this week.');
postFeedElement(communityId, feedElement)
API Version
36.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement postFeedElement(String communityId, ConnectApi.FeedElementInput feedElement)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElement
- Type: ConnectApi.FeedElementInput
- Specify rich text, including mentions. Optionally, specify a link, a poll, or up to 10 existing files.
Return Value
Type: ConnectApi.FeedElement
Example for Posting a Feed Element with a Mention
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
mentionSegmentInput.id = '005RR000000Dme9';
messageBodyInput.messageSegments.add(mentionSegmentInput);
textSegmentInput.text = 'Could you take a look?';
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
feedItemInput.feedElementType = ConnectApi.FeedElementType.FeedItem;
feedItemInput.subjectId = '0F9RR0000004CPw';
ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);
Example for Posting a Feed Element with Existing Content
// Define the FeedItemInput object to pass to postFeedElement
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
feedItemInput.subjectId = 'me';
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
textSegmentInput.text = 'Would you please review these docs?';
// The MessageBodyInput object holds the text in the post
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
// The FeedElementCapabilitiesInput object holds the capabilities of the feed item.
// For this feed item, we define a files capability to hold the file(s).
List<String> fileIds = new List<String>();
fileIds.add('069xx00000000QO');
fileIds.add('069xx00000000QT');
fileIds.add('069xx00000000Qn');
fileIds.add('069xx00000000Qi');
fileIds.add('069xx00000000Qd');
ConnectApi.FilesCapabilityInput filesInput = new ConnectApi.FilesCapabilityInput();
filesInput.items = new List<ConnectApi.FileIdInput>();
for (String fileId : fileIds) {
ConnectApi.FileIdInput idInput = new ConnectApi.FileIdInput();
idInput.id = fileId;
filesInput.items.add(idInput);
}
ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new ConnectApi.FeedElementCapabilitiesInput();
feedElementCapabilitiesInput.files = filesInput;
feedItemInput.capabilities = feedElementCapabilitiesInput;
// Post the feed item.
ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);
Example for Posting a Rich-Text Feed Element with an Inline Image
String communityId = null;
String imageId = '069D00000001INA';
String mentionedUserId = '005D0000001QNpr';
String targetUserOrGroupOrRecordId = '005D0000001Gif0';
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.subjectId = targetUserOrGroupOrRecordId;
input.feedElementType = ConnectApi.FeedElementType.FeedItem;
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
ConnectApi.MentionSegmentInput mentionSegment;
ConnectApi.MarkupBeginSegmentInput markupBeginSegment;
ConnectApi.MarkupEndSegmentInput markupEndSegment;
ConnectApi.InlineImageSegmentInput inlineImageSegment;
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
markupBeginSegment = new ConnectApi.MarkupBeginSegmentInput();
markupBeginSegment.markupType = ConnectApi.MarkupType.Bold;
messageInput.messageSegments.add(markupBeginSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'Hello ';
messageInput.messageSegments.add(textSegment);
mentionSegment = new ConnectApi.MentionSegmentInput();
mentionSegment.id = mentionedUserId;
messageInput.messageSegments.add(mentionSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = '!';
messageInput.messageSegments.add(textSegment);
markupEndSegment = new ConnectApi.MarkupEndSegmentInput();
markupEndSegment.markupType = ConnectApi.MarkupType.Bold;
messageInput.messageSegments.add(markupEndSegment);
inlineImageSegment = new ConnectApi.InlineImageSegmentInput();
inlineImageSegment.altText = 'image one';
inlineImageSegment.fileId = imageId;
messageInput.messageSegments.add(inlineImageSegment);
input.body = messageInput;
ConnectApi.ChatterFeeds.postFeedElement(communityId, input);
Example for Posting a Rich-Text Feed Element with a Code Block
String communityId = null;
String targetUserOrGroupOrRecordId = 'me';
String codeSnippet = '<html>\n\t<body>\n\t\tHello, world!\n\t</body>\n</html>';
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.subjectId = targetUserOrGroupOrRecordId;
input.feedElementType = ConnectApi.FeedElementType.FeedItem;
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
ConnectApi.MarkupBeginSegmentInput markupBeginSegment;
ConnectApi.MarkupEndSegmentInput markupEndSegment;
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
markupBeginSegment = new ConnectApi.MarkupBeginSegmentInput();
markupBeginSegment.markupType = ConnectApi.MarkupType.Code;
messageInput.messageSegments.add(markupBeginSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = codeSnippet;
messageInput.messageSegments.add(textSegment);
markupEndSegment = new ConnectApi.MarkupEndSegmentInput();
markupEndSegment.markupType = ConnectApi.MarkupType.Code;
messageInput.messageSegments.add(markupEndSegment);
input.body = messageInput;
ConnectApi.ChatterFeeds.postFeedElement(communityId, input);
Example for Sharing a Feed Element (in Version 39.0 and Later)
// Define the FeedItemInput object to pass to postFeedElement
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
feedItemInput.subjectId = 'me';
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
textSegmentInput.text = 'Look at this post I'm sharing.';
// The MessageBodyInput object holds the text in the post
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
ConnectApi.FeedEntityShareCapabilityInput shareInput = new ConnectApi.FeedEntityShareCapabilityInput();
shareInput.feedEntityId = '0D5R0000000SEbc';
ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new
ConnectApi.FeedElementCapabilitiesInput();
feedElementCapabilitiesInput.feedEntityShare = shareInput;
feedItemInput.capabilities = feedElementCapabilitiesInput;
// Post the feed item.
ConnectApi.FeedElement feedElement =
ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);
Example for Sending a Direct Message
// Define the FeedItemInput object to pass to postFeedElement
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
textSegmentInput.text = 'Thanks for attending my presentation test run this morning. Send me any feedback.';
// The MessageBodyInput object holds the text in the post
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
// The FeedElementCapabilitiesInput object holds the capabilities of the feed item.
// For this feed item, we define a direct message capability to hold the member(s) and the subject.
List<String> memberIds = new List<String>();
memberIds.add('005B00000016OUQ');
memberIds.add('005B0000001rIN6');
ConnectApi.DirectMessageCapabilityInput dmInput = new ConnectApi.DirectMessageCapabilityInput();
dmInput.subject = 'Thank you!';
dmInput.membersToAdd = memberIds;
ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new ConnectApi.FeedElementCapabilitiesInput();
feedElementCapabilitiesInput.directMessage = dmInput;
feedItemInput.capabilities = feedElementCapabilitiesInput;
// Post the feed item.
ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);
postFeedElementBatch(communityId, feedElements)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] postFeedElementBatch(String communityId, List<ConnectApi.BatchInput> feedElements)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElements
- Type: List<ConnectApi.BatchInput>
- The list can contain up to 500 ConnectApi.BatchInput objects. In the ConnectApi.BatchInput constructor, the input object must be a concrete instance of the abstract ConnectApi.FeedElementInput class.
Return Value
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.
Usage
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.
Example
trigger postFeedItemToAccount on Account (after insert) {
Account[] accounts = Trigger.new;
// Bulk post to the account feeds.
List<ConnectApi.BatchInput> batchInputs = new List<ConnectApi.BatchInput>();
for (Account a : accounts) {
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.subjectId = a.id;
ConnectApi.MessageBodyInput body = new ConnectApi.MessageBodyInput();
body.messageSegments = new List<ConnectApi.MessageSegmentInput>();
ConnectApi.TextSegmentInput textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'Let\'s win the ' + a.name + ' account.';
body.messageSegments.add(textSegment);
input.body = body;
ConnectApi.BatchInput batchInput = new ConnectApi.BatchInput(input);
batchInputs.add(batchInput);
}
ConnectApi.ChatterFeeds.postFeedElementBatch(Network.getNetworkId(), batchInputs);
}
publishDraftFeedElement(communityId, feedElementId, feedElement)
API Version
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement publishDraftFeedElement(String communityId, String feedElementId, ConnectApi.FeedElementInput feedElement)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element to publish.
- feedElement
- Type: ConnectApi.FeedElementInput
- Use this optional parameter to edit your draft before publishing.
searchFeedElements(communityId, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q)
Parameters
Return Value
Usage
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.
searchFeedElements(communityId, q, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.FeedSortOrder
- Values are:
- CreatedDateAsc—Sorts by oldest creation date. This sort order is available only for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
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.
searchFeedElements(communityId, q, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, Boolean threadedCommentsCollapsed)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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.
Return Value
Usage
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.
searchFeedElements(communityId, q, pageParam, pageSize)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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.
Return Value
Usage
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.
searchFeedElements(communityId, q, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
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.
searchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed)
API Version
44.0
Available to Guest Users
44.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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.
- 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.
Return Value
Usage
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.
searchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Usage
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.
searchFeedElementsInFeed(communityId, feedType, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String q)
Parameters
- 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.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q)
Parameters
- 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.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter)
API Version
35.0
Available to Guest Users
35.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly)
API Version
31.0
Available to Guest Users
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, filter)
API Version
32.0
Available to Guest Users
32.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed of a group.
- UnsolvedQuestions—Feed elements that are questions and that don’t have a best answer.
Return Value
Usage
searchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, customFilter)
API Version
40.0
Available to Guest Users
40.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q)
Parameters
- 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.
- 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.
Return Value
Usage
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.
searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
API Version
31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElementPage searchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
searchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Usage
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.
searchStreams(communityId, q)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q)
Parameters
Return Value
Usage
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.
searchStreams(communityId, q, sortParam)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, ConnectApi.SortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
Return Value
Usage
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.
searchStreams(communityId, q, pageParam, pageSize)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
Return Value
Usage
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.
searchStreams(communityId, q, pageParam, pageSize, sortParam)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
Return Value
Usage
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.
searchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStreamPage searchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
- globalScope
- Type: Boolean
- Specifies whether to get streams from all the context user’s Experience Cloud sites, regardless of the communityId value.
Return Value
Usage
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.
setCommentIsVerified(communityId, commentId, isVerified)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.VerifiedCapability setCommentIsVerified(String communityId, String commentId, Boolean isVerified)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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.
Return Value
Type: ConnectApi.VerifiedCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setCommentIsVerifiedByAnonymized(communityId, commentId, isVerified, isVerifiedByAnonymized)
API Version
43.0
Requires Chatter
Yes
Signature
public static ConnectApi.VerifiedCapability setCommentIsVerifiedByAnonymized(String communityId, String commentId, Boolean isVerified, Boolean isVerifiedByAnonymized)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 isVerifiedByAnonymized to maintain the verification and anonymize the value of lastVerifiedByUser.
You can’t set isVerified and isVerifiedByAnonymized to true at the same time. isVerifiedByAnonymized can be set to true only if isVerified is already set to true.
You can’t set isVerifiedByAnonymized to false. After isVerifiedByAnonymized is set to true, it can be undone only when another user marks the comment as unverified and then reverifies the comment.
Return Value
Type: ConnectApi.VerifiedCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setCommentVote(communityId, commentId, upDownVote)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.UpDownVoteCapability setCommentVote(String communityId, String commentId, ConnectApi.UpDownVoteCapabilityInput upDownVote)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID of the comment.
- upDownVote
- Type: ConnectApi.UpDownVoteCapabilityInput
- A ConnectApi.UpDownVoteCapabilityInput object that includes your vote.
Return Value
Type: ConnectApi.UpDownVoteCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setFeedCommentStatus(communityId, commentId, status)
API Version
38.0
Requires Chatter
Yes
Signature
public static ConnectApi.StatusCapability setFeedCommentStatus(String communityId, String commentId, ConnectApi.StatusCapabilityInput status)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID of the comment.
- status
- Type: ConnectApi.StatusCapabilityInput
- A ConnectApi.StatusCapabilityInput object that includes the status you want to set.
Return Value
Type: ConnectApi.StatusCapability
If the comment doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Usage
Only users with the Can Approve Feed Post and Comment permission can set the status of a feed post or comment.
setFeedElementIsClosed(communityId, feedElementId, isClosed)
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.
API Version
43.0
Requires Chatter
Yes
Signature
public static ConnectApi.CloseCapability setFeedElementIsClosed(String communityId, String feedElementId, Boolean isClosed)
Parameters
Return Value
Type: ConnectApi.CloseCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setFeedElementVote(communityId, feedElementId, upDownVote)
API Version
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.UpDownVoteCapability setFeedElementVote(String communityId, String feedElementId, ConnectApi.UpDownVoteCapabilityInput upDownVote)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- upDownVote
- Type: ConnectApi.UpDownVoteCapabilityInput
- A ConnectApi.UpDownVoteCapabilityInput object that includes your vote.
Return Value
Type: ConnectApi.UpDownVoteCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setFeedEntityStatus(communityId, feedElementId, status)
API Version
37.0
Requires Chatter
Yes
Signature
public static ConnectApi.StatusCapability setFeedEntityStatus(String communityId, String feedElementId, ConnectApi.StatusCapabilityInput status)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- status
- Type: ConnectApi.StatusCapabilityInput
- A ConnectApi.StatusCapabilityInput object that includes the status you want to set.
Return Value
Type: ConnectApi.StatusCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Usage
Only users with the Can Approve Feed Post and Comment permission can set the status of a feed post or comment.
setIsMutedByMe(communityId, feedElementId, isMutedByMe)
API Version
35.0
Requires Chatter
Yes
Signature
public static ConnectApi.MuteCapability setIsMutedByMe(String communityId, String feedElementId, Boolean isMutedByMe)
Parameters
Return Value
Type: ConnectApi.MuteCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setIsReadByMe(communityId, feedElementId, readBy)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ReadByCapability setIsReadByMe(String communityId, String feedElementId, ConnectApi.ReadByCapabilityInput readBy)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element to mark as read.
- readBy
- Type: ConnectApi.ReadByCapabilityInput
- A ConnectApi.ReadByCapabilityInput body indicating to mark the feed elements as read.
Return Value
Type: ConnectApi.ReadByCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
setIsReadByMe(communityId, feedElementId, isReadByMe)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.ReadByCapability setIsReadByMe(String communityId, String feedElementId, Boolean isReadByMe)
Parameters
Return Value
Type: ConnectApi.ReadByCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
updateComment(communityId, commentId, comment)
API Version
34.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment updateComment(String communityId, String commentId, ConnectApi.CommentInput comment)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- commentId
- Type: String
- ID of the comment to be edited.
- comment
- Type: ConnectApi.CommentInput
- Information about the comment to be edited.
Return Value
Type: ConnectApi.Comment
If the comment doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
Example
String commentId;
String communityId = Network.getNetworkId();
// Get the last feed item created by the context user.
List<FeedItem> feedItems = [SELECT Id FROM FeedItem WHERE CreatedById = :UserInfo.getUserId() ORDER BY CreatedDate DESC];
if (feedItems.isEmpty()) {
// Return null within anonymous apex.
return null;
}
String feedElementId = feedItems[0].id;
ConnectApi.CommentPage commentPage = ConnectApi.ChatterFeeds.getCommentsForFeedElement(communityId, feedElementId);
if (commentPage.items.isEmpty()) {
// Return null within anonymous apex.
return null;
}
commentId = commentPage.items[0].id;
ConnectApi.FeedEntityIsEditable isEditable = ConnectApi.ChatterFeeds.isCommentEditableByMe(communityId, commentId);
if (isEditable.isEditableByMe == true){
ConnectApi.CommentInput commentInput = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegmentInput.text = 'This is my edited comment.';
messageBodyInput.messageSegments.add(textSegmentInput);
commentInput.body = messageBodyInput;
ConnectApi.Comment editedComment = ConnectApi.ChatterFeeds.updateComment(communityId, commentId, commentInput);
}
updateDirectMessage(communityId, feedElementId, directMessage)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.DirectMessageCapability updateDirectMessage(String communityId, String feedElementId, ConnectApi.DirectMessageCapabilityInput directMessage)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- directMessage
- Type: ConnectApi.DirectMessageCapabilityInput
- A ConnectApi.DirectMessageCapabilityInput body that includes the members to add and remove.
Return Value
Type: ConnectApi.DirectMessageCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
updateFeedElement(communityId, feedElementId, feedElement)
API Version
34.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement updateFeedElement(String communityId, String feedElementId, ConnectApi.FeedElementInput feedElement)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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.FeedElementInput
- Information about the feed item to be edited.
Return Value
Type: ConnectApi.FeedElement
If the feed element doesn’t support the edit capability, the return value is ConnectApi.NotFoundException.
Example for Editing a Feed Post
String communityId = Network.getNetworkId();
// Get the last feed item created by the context user.
List<FeedItem> feedItems = [SELECT Id FROM FeedItem WHERE CreatedById = :UserInfo.getUserId() ORDER BY CreatedDate DESC];
if (feedItems.isEmpty()) {
// Return null within anonymous apex.
return null;
}
String feedElementId = feedItems[0].id;
ConnectApi.FeedEntityIsEditable isEditable = ConnectApi.ChatterFeeds.isFeedElementEditableByMe(communityId, feedElementId);
if (isEditable.isEditableByMe == true){
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegmentInput.text = 'This is my edited post.';
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
ConnectApi.FeedElement editedFeedElement = ConnectApi.ChatterFeeds.updateFeedElement(communityId, feedElementId, feedItemInput);
}
Example for Editing a Question Title and Post
String communityId = Network.getNetworkId();
// Get the last feed item created by the context user.
List<FeedItem> feedItems = [SELECT Id FROM FeedItem WHERE CreatedById = :UserInfo.getUserId() ORDER BY CreatedDate DESC];
if (feedItems.isEmpty()) {
// Return null within anonymous apex.
return null;
}
String feedElementId = feedItems[0].id;
ConnectApi.FeedEntityIsEditable isEditable = ConnectApi.ChatterFeeds.isFeedElementEditableByMe(communityId, feedElementId);
if (isEditable.isEditableByMe == true){
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new ConnectApi.FeedElementCapabilitiesInput();
ConnectApi.QuestionAndAnswersCapabilityInput questionAndAnswersCapabilityInput = new ConnectApi.QuestionAndAnswersCapabilityInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegmentInput.text = 'This is my edited question.';
messageBodyInput.messageSegments.add(textSegmentInput);
feedItemInput.body = messageBodyInput;
feedItemInput.capabilities = feedElementCapabilitiesInput;
feedElementCapabilitiesInput.questionAndAnswers = questionAndAnswersCapabilityInput;
questionAndAnswersCapabilityInput.questionTitle = 'Where is my edited question?';
ConnectApi.FeedElement editedFeedElement = ConnectApi.ChatterFeeds.updateFeedElement(communityId, feedElementId, feedItemInput);
}
updateFeedElementBookmarks(communityId, feedElementId, bookmarks)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, ConnectApi.BookmarksCapabilityInput bookmarks)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementId
- Type: String
- ID of the feed element.
- bookmarks
- Type: ConnectApi.BookmarksCapabilityInput
- Information about a bookmark.
Return Value
Type: ConnectApi.BookmarksCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
updateFeedElementBookmarks(communityId, feedElementId, isBookmarkedByCurrentUser)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, Boolean isBookmarkedByCurrentUser)
Parameters
Return Value
Type: ConnectApi.BookmarksCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Example
ConnectApi.BookmarksCapability bookmark = ConnectApi.ChatterFeeds.updateFeedElementBookmarks(null, '0D5D0000000KuGh', true);
updateFeedElementReadByCapabilityBatch(communityId, feedElementIds, readBy)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] updateFeedElementReadByCapabilityBatch(String communityId, List<String> feedElementIds, ConnectApi.ReadByCapabilityInput readBy)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElementIds
- Type: List<String>
- Up to 500 feed element IDs to mark as read.
- readBy
- Type: ConnectApi.ReadByCapabilityInput
- A ConnectApi.ReadByCapabilityInput body indicating to mark the feed elements as read.
Return Value
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.
updateFeedElementReadByCapabilityBatch(communityId, feedElementIds, isReadByMe)
API Version
40.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] updateFeedElementReadByCapabilityBatch(String communityId, List<String> feedElementIds, Boolean isReadByMe)
Parameters
Return Value
Type: ConnectApi.BatchResult[]
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
updateLikeForComment(communityId, commentId, isLikedByCurrentUser)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage updateLikeForComment(String communityId, String commentId, Boolean isLikedByCurrentUser)
Parameters
Return Value
updateLikeForFeedElement(communityId, feedElementId, isLikedByCurrentUser)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage updateLikeForFeedElement(String communityId, String feedElementId, Boolean isLikedByCurrentUser)
Parameters
Return Value
Type: ConnectApi.ChatterLikePage
If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.
updatePinnedFeedElements(communityId, feedType, subjectId, pin)
API Version
41.0
Available to Guest Users
41.0
Requires Chatter
Yes
Signature
public static ConnectApi.PinCapability updatePinnedFeedElements(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.PinCapabilityInput pin)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- The type of feed. Valid values are Record and Topics.
- subjectId
- Type: String
- If feedType is Record, subjectId must be a group ID. If feedType is Topics, subjectId must be a topic ID.
- pin
- Type: ConnectApi.PinCapabilityInput
- A ConnectApi.PinCapabilityInput object indicating the feed element to pin or unpin.
Return Value
Type: ConnectApi.PinCapability
If the feed doesn’t support this capability, the return value is ConnectApi.NotFoundException.updateStream(communityId, streamId, streamInput)
API Version
39.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterStream updateStream(String communityId, String streamId, ConnectApi.ChatterStreamInput streamInput)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- streamId
- Type: String
- ID of the Chatter feed stream.
- streamInput
- Type: ConnectApi.ChatterStreamInput
- A ConnectApi.ChatterStreamInput object.
Return Value
Type: ConnectApi.ChatterStream
voteOnFeedElementPoll(communityId, feedElementId, myChoiceId)
API Version
32.0
Requires Chatter
Yes
Signature
public static ConnectApi.PollCapability voteOnFeedElementPoll(String communityId, String feedElementId, String myChoiceId)
Parameters
Return Value
Type: ConnectApi.PollCapability
If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.
Example
ConnectApi.PollCapability poll = ConnectApi.ChatterFeeds.voteOnFeedElementPoll(null, '0D5D0000000XZaUKAW', '09AD000000000TKMAY');
ChatterFeeds Test Methods
For information about using these methods to test your ConnectApi code, see Testing ConnectApi Code.
setTestGetFeedElementsFromFeed(communityId, feedType, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedElementPage result)
Parameters
- 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.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed, result)
API Version
44.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- The feed type.
- subjectId
- Type: String
- ID of the context user or the alias me.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)
API Version
35.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, threadedCommentsCollapsed, result)
API Version
44.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, filter, threadedCommentsCollapsed, result)
API Version
44.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, showInternalOnly, customFilter, threadedCommentsCollapsed, result)
API Version
44.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedElementPage result)
Parameters
- 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.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, result)
API Version
31.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
API Version
31.0
Signature
public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedElementPage result)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
API Version
31.0
Signature
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)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of these values:
- Files
- Groups
- News
- People
- Record
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
API Version
31.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, filter, result)
API Version
35.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
API Version
31.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, showInternalOnly, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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.
Return Value
Type: Void
setTestGetRelatedPosts(communityId, feedElementId, filter, maxResults, result)
API Version
37.0
Signature
public static Void setTestGetRelatedPosts(String communityId, String feedElementId, ConnectApi.RelatedFeedPostType filter, Integer maxResults, ConnectApi.RelatedFeedPosts result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestGetTopUnansweredQuestions(communityId, result) (Pilot)
API Version
42.0
Signature
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetTopUnansweredQuestions(communityId, filter, result) (Pilot)
API Version
42.0
Signature
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.TopUnansweredQuestionsFilterType filter, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
- filter
- Type: ConnectApi.FeedFilter
- Specifies the filter for the feed. UnansweredQuestionsWithCandidateAnswers is the only valid value.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetTopUnansweredQuestions(communityId, pageSize, result) (Pilot)
API Version
42.0
Signature
public static Void setTestGetTopUnansweredQuestions(String communityId, Integer pageSize, ConnectApi.FeedElementPage result)
Parameters
- 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.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestGetTopUnansweredQuestions(communityId, filter, pageSize, result) (Pilot)
API Version
42.0
Signature
public static Void setTestGetTopUnansweredQuestions(String communityId, ConnectApi.FeedFilter filter, Integer pageSize, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID of the Experience Cloud site.
- filter
- Type: ConnectApi.FeedFilter
- Specifies the filter for the feed. UnansweredQuestionsWithCandidateAnswers is 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.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, sortParam, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.FeedSortOrder
- Values are:
- CreatedDateAsc—Sorts by oldest creation date. This sort order is available only for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, threadedCommentsCollapsed, result)
API Version
44.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, pageParam, pageSize, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.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, 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.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, pageParam, pageSize, threadedCommentsCollapsed, result)
API Version
44.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, Boolean threadedCommentsCollapsed, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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.
- 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.
Return Value
Type: Void
setTestSearchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElements(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedElementPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String q, ConnectApi.FeedElementPage result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q, ConnectApi.FeedElementPage result)
Parameters
- 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 feed type is UserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the alias me.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)
API Version
35.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, filter, result)
API Version
32.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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 the UserProfile feed.
- 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 the UserProfile feed.
- 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 the Record feed 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 the Record feed 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.
Return Value
Type: Void
setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, customFilter, result)
API Version
40.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q, ConnectApi.FeedElementPage result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedElementPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchStreams(communityId, q, result)
API Version
40.0
Signature
public static Void setTestSearchStreams(String communityId, String q, ConnectApi.ChatterStreamPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- result
- Type: ConnectApi.ChatterStreamPage
- Object containing test data.
Return Value
Type: Void
setTestSearchStreams(communityId, q, sortParam, result)
API Version
40.0
Signature
public static Void setTestSearchStreams(String communityId, String q, ConnectApi.SortOrder sortParam, ConnectApi.ChatterStreamPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
- result
- Type: ConnectApi.ChatterStreamPage
- Object containing test data.
Return Value
Type: Void
setTestSearchStreams(communityId, q, pageParam, pageSize, result)
API Version
40.0
Signature
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.ChatterStreamPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- result
- Type: ConnectApi.ChatterStreamPage
- Object containing test data.
Return Value
Type: Void
setTestSearchStreams(communityId, q, pageParam, pageSize, sortParam, result)
API Version
40.0
Signature
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, ConnectApi.ChatterStreamPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
- result
- Type: ConnectApi.ChatterStreamPage
- Object containing test data.
Return Value
Type: Void
setTestSearchStreams(communityId, q, pageParam, pageSize, sortParam, globalScope, result)
API Version
41.0
Signature
public static Void setTestSearchStreams(String communityId, String q, Integer pageParam, Integer pageSize, ConnectApi.SortOrder sortParam, Boolean globalScope, ConnectApi.ChatterStreamPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: Integer
- Number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 to 250. The default size is 25.
- sortParam
- Type: ConnectApi.SortOrder
-
Specifies 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.
- 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.ChatterStreamPage
- Object containing test data.
Return Value
Type: Void
Retired ChatterFeeds Methods
deleteFeedItem(communityId, feedItemId)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static Void deleteFeedItem(String communityId, String feedItemId)
Parameters
Return Value
Type: Void
getCommentsForFeedItem(communityId, feedItemId)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedItem(String communityId, String feedItemId)
Parameters
Return Value
getCommentsForFeedItem(communityId, feedItemId, pageParam, pageSize)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.CommentPage getCommentsForFeedItem(String communityId, String feedItemId, String pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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, currentPageToken or nextPageToken. If you pass in null, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
getFeedItem(communityId, feedItemId)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItem getFeedItem(String communityId, String feedItemId)
Parameters
Return Value
Type: ConnectApi.FeedItem
getFeedItemBatch(communityId, feedItemIds)
API Version
31.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.BatchResult[] getFeedItemBatch(String communityId, List<String> feedItemIds)
Parameters
Return Value
Type: ConnectApi.BatchResult[]
The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedItem object and errors for feed items that didn’t load.
Example
// Create a list of feed items.
ConnectApi.FeedItemPage feedItemPage = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(null, ConnectApi.FeedType.Company);
System.debug(feedItemPage);
// Create a list of feed item IDs.
List<String> feedItemIds = new List<String>();
for (ConnectApi.FeedItem aFeedItem : feedItemPage.items){
feedItemIds.add(aFeedItem.id);
}
// Get info about the feed items in the list.
ConnectApi.BatchResult[] batchResults = ConnectApi.ChatterFeeds.getFeedItemBatch(null, feedItemIds);
for (ConnectApi.BatchResult batchResult : batchResults) {
if (batchResult.isSuccess()) {
// Operation was successful.
// Print the header for each feed item.
ConnectApi.FeedItem aFeedItem;
if(batchResult.getResult() instanceof ConnectApi.FeedItem) {
aFeedItem = (ConnectApi.FeedItem) batchResult.getResult();
}
System.debug('SUCCESS');
System.debug(aFeedItem.header.text);
}
else {
// Operation failed. Print errors.
System.debug('FAILURE');
System.debug(batchResult.getErrorMessage());
}
}
getFeedItemsFromFeed(communityId, feedType)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam)
API Version
29.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, subjectId)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam)
API Version
29.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly)
API Version
30.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam)
API Version
29.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
getFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, updatedSince)
API Version
30.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
getFeedItemsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince)
API Version
30.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
Example
// Get the feed items in the company feed and return the updatesToken
String communityId = null;
// Get the feed and extract the update token
ConnectApi.FeedItemPage page = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.Company);
// page.updatesToken is opaque and has a value like '2:1384549034000'
// Get the feed items that changed since the provided updatesToken
ConnectApi.FeedItemPage feedItems= ConnectApi.ChatterFeeds.getFeedItemsUpdatedSince
(communityId, ConnectApi.FeedType.Company, 1, ConnectApi.FeedDensity.AllUpdates, null, 1, page.updatesToken);
getFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince)
API Version
30.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage getFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of these values:
- Files
- Groups
- News
- People
- Record
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
Example
// Get the feed items in the news feed and return the updatesToken
String communityId = null;
String subjectId = 'me';
// Get the feed and extract the update token
ConnectApi.FeedItemPage page = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.News, subjectId);
// page.updatesToken is opaque and has a value like '2:1384549034000'
// Get the feed items that changed since the provided updatesToken
ConnectApi.FeedItemPage feedItems= ConnectApi.ChatterFeeds.getFeedItemsUpdatedSince
(communityId, ConnectApi.FeedType.News, subjectId, 1, ConnectApi.FeedDensity.AllUpdates, null, 1, page.updatesToken);
getFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly)
API Version
30.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
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)
Parameters
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
Example
// Get the feed items in the news feed and return the updatesToken
String communityId = null;
String subjectId = 'me';
// Get the feed and extract the update token
ConnectApi.FeedItemPage page = ConnectApi.ChatterFeeds.getFeedItemsFromFeed(communityId, ConnectApi.FeedType.News, subjectId);
// page.updatesToken is opaque and has a value like '2:1384549034000'
// Get the feed items that changed since the provided updatesToken
ConnectApi.FeedItemPage feedItems= ConnectApi.ChatterFeeds.getFeedItemsUpdatedSince
(communityId, ConnectApi.FeedType.News, subjectId, 1, ConnectApi.FeedDensity.AllUpdates, null, 1, page.updatesToken, true);
getFeedPoll(communityId, feedItemId)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedPoll getFeedPoll(String communityId, String feedItemId)
Parameters
Return Value
Type: ConnectApi.FeedPoll
getLikesForFeedItem(communityId, feedItemId)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForFeedItem(String communityId, String feedItemId)
Parameters
Return Value
getLikesForFeedItem(communityId, feedItemId, pageParam, pageSize)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLikePage getLikesForFeedItem(String communityId, String feedItemId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
Return Value
likeFeedItem(communityId, feedItemId)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.ChatterLike likeFeedItem(String communityId, String feedItemId)
Parameters
Return Value
Type: ConnectApi.ChatterLike
If the context user already liked the feed item, this method is a non-operation and returns the existing like.
postComment(communityId, feedItemId, text)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment postComment(String communityId, String feedItemId, String text)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- 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 a ConnectApi.CommentInput object.
Return Value
Type: ConnectApi.Comment
Usage
Feed items and comments can contain up to 10,000 characters.
postComment(communityId, feedItemId, comment, feedItemFileUpload)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.Comment postComment(String communityId, String feedItemId, ConnectApi.CommentInput comment, ConnectApi.BinaryInput feedItemFileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedItemId
- Type: String
- ID for a feed item.
- comment
- Type: ConnectApi.CommentInput
- In the CommentInput object, specify rich text, including @mentions. Optionally, in the CommentInput.attachment property, specify an existing file or a new file
- feedItemFileUpload
- Type: ConnectApi.BinaryInput
- If you specify a NewFileAttachmentInput object in the CommentInput.attachment property, specify the new binary file to attach in this argument. Otherwise, do not specify a value.
Return Value
Type: ConnectApi.Comment
Usage
Feed items and comments can contain up to 10,000 characters.
Sample: Posting a Comment with a New File Attachment
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.
String communityId = null;
String feedItemId = '0D5D0000000Kcd1';
ConnectApi.CommentInput input = new ConnectApi.CommentInput();
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'Comment Text Body';
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
messageInput.messageSegments.add(textSegment);
input.body = messageInput;
ConnectApi.NewFileAttachmentInput attachmentInput = new ConnectApi.NewFileAttachmentInput();
attachmentInput.description = 'The description of the file';
attachmentInput.title = 'contentFile.txt';
input.attachment = attachmentInput;
String fileContents = 'This is the content of the file.';
Blob fileBlob = Blob.valueOf(fileContents);
ConnectApi.BinaryInput binaryInput = new ConnectApi.BinaryInput(fileBlob, 'text/plain', 'contentFile.txt');
ConnectApi.Comment commentRep = ConnectApi.ChatterFeeds.postComment(communityId, feedItemId, input, binaryInput);
postFeedElement(communityId, feedElement, feedElementFileUpload)
API Version
31.0–35.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedElement postFeedElement(String communityId, ConnectApi.FeedElementInput feedElement, ConnectApi.BinaryInput feedElementFileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedElement
- Type: ConnectApi.FeedElementInput
- Specify rich text, including mentions. Optionally, specify a link, a poll, an existing file, or a new file.
- feedElementFileUpload
- Type: ConnectApi.BinaryInput
- Specify the new binary file to attach to the post only if you also specify a NewFileAttachmentInput object in the feedElement parameter. Otherwise, pass null.
Return Value
Type: ConnectApi.FeedElement
Example for Posting a Feed Element with a New (Binary) File
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.subjectId = 'me';
ConnectApi.ContentCapabilityInput contentInput = new ConnectApi.ContentCapabilityInput();
contentInput.title = 'Title';
ConnectApi.FeedElementCapabilitiesInput capabilities = new ConnectApi.FeedElementCapabilitiesInput();
capabilities.content = contentInput;
input.capabilities = capabilities;
String text = 'These are the contents of the new file.';
Blob myBlob = Blob.valueOf(text);
ConnectApi.BinaryInput binInput = new ConnectApi.BinaryInput(myBlob, 'text/plain', 'fileName');
ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), input, binInput);
postFeedItem(communityId, feedType, subjectId, text)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItem postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of the following:
- News
- Record
- UserProfile
- subjectId
- Type: String
- The value depends on the feedType:
- News—ID of the context user or the keyword me.
- 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 a ConnectApi.FeedItemInput object.
Return Value
Type: ConnectApi.FeedItem
postFeedItem(communityId, feedType, subjectId, feedItemInput, feedItemFileUpload)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItem postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedItemInput feedItemInput, ConnectApi.BinaryInput feedItemFileUpload)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of the following:
- News
- Record
- UserProfile
- 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.
- feedItemInput
- Type: ConnectApi.FeedItemInput
- In the FeedItemInput object, specify rich text. Optionally, in the FeedItemInput.attachment property, specify a link, a poll, an existing file, or a new file.
- feedItemFileUpload
- Type: ConnectApi.BinaryInput
- If you specify a NewFileAttachmentInput object in the FeedItemInput.attachment property, specify the new binary file to attach in this argument. Otherwise, do not specify a value.
Return Value
Type: ConnectApi.FeedItem
Usage
Example for Sharing a Feed Item and Adding a Comment
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.
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
input.originalFeedItemId = '0D5D0000000JuAG';
ConnectApi.MessageBodyInput body = new ConnectApi.MessageBodyInput();
List<ConnectApi.MessageSegmentInput> segmentList = new List<ConnectApi.MessageSegmentInput>();
ConnectApi.TextSegmentInput textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'I hope you enjoy this post I found in another group.';
segmentList.add((ConnectApi.MessageSegmentInput)textSegment);
body.messageSegments = segmentList;
input.body = body;
ConnectApi.ChatterFeeds.postFeedItem(null, ConnectApi.FeedType.UserProfile, 'me', input, null);
Example for Posting a Mention to a User Profile Feed
To post to a user profile feed and include an @mention, call the ConnectApi.ChatterFeeds.postFeedItem method.
String communityId = null;
ConnectApi.FeedType feedType = ConnectApi.FeedType.UserProfile;
ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegment;
ConnectApi.MentionSegmentInput mentionSegment = new ConnectApi.MentionSegmentInput();
messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = 'Hey there ';
messageInput.messageSegments.add(textSegment);
mentionSegment.id = '005D0000001LLO1';
messageInput.messageSegments.add(mentionSegment);
textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = '. How are you?';
messageInput.messageSegments.add(textSegment);
input.body = messageInput;
ConnectApi.FeedItem feedItemRep = ConnectApi.ChatterFeeds.postFeedItem(communityId, feedType, 'me', input, null);
searchFeedItems(communityId, q)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q)
Parameters
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItems(communityId, q, sortParam)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.FeedSortOrder
- Values are:
- CreatedDateAsc—Sorts by oldest creation date. This sort order is available only for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItems(communityId, q, pageParam, pageSize)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, String pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItems(communityId, q, pageParam, pageSize, sortParam)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)
API Version
29.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItemsInFeed(communityId, feedType, q)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String q)
Parameters
- 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.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
29.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, subjectId, q)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q)
Parameters
- 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 feed type is UserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the alias me.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q)
API Version
28.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
29.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
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.
searchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly)
API Version
30.0–31.0
Available to Guest Users
31.0 only
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q)
Parameters
- 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.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItemPage searchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q)
API Version
29.0–31.0
Requires Chatter
Yes
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: ConnectApi.FeedItemPage
Usage
updateBookmark(communityId, feedItemId, isBookmarkedByCurrentUser)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedItem updateBookmark(String communityId, String feedItemId, Boolean isBookmarkedByCurrentUser)
Parameters
Return Value
Type: ConnectApi.FeedItem
voteOnFeedPoll(communityId, feedItemId, myChoiceId)
API Version
28.0–31.0
Requires Chatter
Yes
Signature
public static ConnectApi.FeedPoll voteOnFeedPoll(String communityId, String feedItemId, String myChoiceId)
Parameters
Return Value
Type: ConnectApi.FeedPoll
setTestGetFeedItemsFromFeed(communityId, feedType, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedItemPage result)
Parameters
- 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.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)
API Version
29.0–31.0
Signature
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedItemPage result)
Parameters
- 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.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)
API Version
30.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedItemPage result)
Parameters
- 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.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)
API Version
28.0–31.0
Signature
public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestGetFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, updatedSince, result)
API Version
30.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestGetFeedItemsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, ConnectApi.FeedItemPage, results)
API Version
30.0–31.0
Signature
public static Void setTestGetFeedItemsUpdatedSince(String communityId, ConnectApi.FeedType feedType, Integer recentCommentCount, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedItemPage results)
Parameters
- 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.
Return Value
Type: Void
setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)
API Version
30.0–31.0
Signature
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)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of these values:
- Files
- Groups
- News
- People
- Record
- 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.
Return Value
Type: Void
setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)
API Version
30.0–31.0
Signature
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)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- feedType
- Type: ConnectApi.FeedType
- One of these values:
- Files
- Groups
- News
- People
- Record
- 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.
Return Value
Type: Void
setTestSearchFeedItems(communityId, q, result)
API Version
28.0–31.0
Signature
public static Void searchFeedItems(String communityId, String q, ConnectApi.FeedItemPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- result
- Type: ConnectApi.FeedItemPage
- Object containing test data.
Return Value
Type: Void
setTestSearchFeedItems(communityId, q, sortParam, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItems(String communityId, String q, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- sortParam
- Type: ConnectApi.FeedSortOrder
- Values are:
- CreatedDateAsc—Sorts by oldest creation date. This sort order is available only for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- The feed item test page.
Return Value
Type: Void
setTestSearchFeedItems(communityId, q, pageParam, pageSize, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedItemPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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.
- result
- Type: ConnectApi.FeedItemPage
- The test feed item page.
Return Value
Type: Void
setTestSearchFeedItems(communityId, q, pageParam, pageSize, sortParam, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItems(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- pageParam
- Type: 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- The test feed item page.
Return Value
Type: Void
setTestSearchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)
API Version
29.0–31.0
Signature
public static Void setTestSearchFeedItems(String communityId, String q, Integer recentCommentCount, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedItemPage result)
Parameters
- communityId
- Type: String
- ID for an Experience Cloud site, internal, or null.
- q
- Type: String
- Required and can’t be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- result
- Type: ConnectApi.FeedItemPage
- The test feed item page.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, q, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String q, ConnectApi.FeedItemPage result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, q, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String q, ConnectApi.FeedItemPage result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItemsInFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, String q, ConnectApi.FeedItemPage result)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q, result)
API Version
28.0–31.0
Signature
public static Void setTestSearchFeedItemsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q, ConnectApi.FeedItemPage result)
Parameters
- 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.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFilterFeed(communityId, feedType, subjectId, keyPrefix, pageParam, pageSize, sortParam, q, result)
API Version
28.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void
setTestSearchFeedItemsInFilterFeed(communityId, feedType, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)
API Version
29.0–31.0
Signature
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)
Parameters
- 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 for DirectMessageModeration, Draft, Isolated, Moderation, and PendingReview feeds.
- 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 for Home feeds when the ConnectApi.FeedFilter is UnansweredQuestions.
- Relevance—Sorts by most relevant content. This sort order is available only for Company, Home, and Topics feeds.
- 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.
Return Value
Type: Void