ChatterFeeds Class

Get, post, and delete feed elements, likes, comments, and bookmarks. You can also search feed elements, share feed elements, and vote on polls.

Namespace

ConnectApi

Usage

In API versions 30.0 and earlier, a Chatter feed was a container of feed items. In API version 31.0, the definition of a feed expanded to include new objects that didn’t entirely fit the feed item model. The Chatter feed became a container of feed elements. The abstract class ConnectApi.FeedElement was introduced as a parent class to the existing ConnectApi.FeedItem class. The subset of properties that feed elements share was moved into the ConnectApi.FeedElement class. Because feeds and feed elements are the core of Chatter, understanding them is crucial to developing applications with Chatter in Apex. For detailed information, see Working with Feeds and Feed Elements.

Important

Important

Feed item methods aren’t available in version 32.0. In version 32.0 and later, use feed element methods.

Message segments in a feed item are typed as ConnectApi.MessageSegment. Feed item capabilities are typed as ConnectApi.FeedItemCapability. Record fields are typed as ConnectApi.AbstractRecordField. These classes are all abstract and have several concrete subclasses. At runtime you can use instanceof to check the concrete types of these objects and then safely proceed with the corresponding downcast. When you downcast, you must have a default case that handles unknown subclasses.

Important

Important

The composition of a feed may change between releases. Your code should always be prepared to handle instances of unknown subclasses.

ChatterFeeds Methods

The following are methods for ChatterFeeds. All methods are static.

deleteComment(communityId, commentId)

Deletes the specified comment. You can find a comment ID in any feed, such as a news feed or a record feed.

API Version

28.0

Requires Chatter

Yes

Signature

public static Void deleteComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

Return Value

Type: Void

deleteFeedElement(communityId, feedElementId)

Deletes the specified feed element.

API Version

31.0

Requires Chatter

Yes

Signature

public static deleteFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

Return Value

Type: Void

deleteFeedItem(communityId, feedItemId)

Deletes the specified feed item.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use deleteFeedElement(communityId, feedElementId).

Requires Chatter

Yes

Signature

public static Void deleteFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: Void

deleteLike(communityId, likeId)

Deletes the specified like. This can be a like on a comment or a feed item.

API Version

28.0

Requires Chatter

Yes

Signature

public static Void deleteLike(String communityId, String likeId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
likeId
Type: String
The ID for a like.

Return Value

Type: Void

getComment(communityId, commentId)

Returns the specified comment.

API Version

28.0

Available to Guest Users

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.Comment getComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

Return Value

Type: ConnectApi.​Comment

getCommentsForFeedElement(communityId, feedElementId)

Get the comments for a specified feed element.

API Version

32.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.CommentPage getCommentsForFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

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)

Returns the specified page of comments for the specified feed element.

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
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
pageParam
Type: String
The 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 comments per page. Valid values are between 1 and 100. If you pass null, the default size is 25.

Return Value

Type: ConnectApi.​Comment​Page Class

If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.

getCommentsForFeedItem(communityId, feedItemId)

Returns the first page of comments for the feed item. The page contains the default number of items.

API Version

28.0–31.0

Important

Important

In version 32.0 and later, use getCommentsForFeedElement(communityId, feedElementId).

Available to Guest Users

31.0 only

Requires Chatter

Yes

Signature

public static ConnectApi.CommentPage getCommentsForFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.​Comment​​Page

getCommentsForFeedItem(communityId, feedItemId, pageParam, pageSize)

Returns the specified page of comments for the specified feed item.

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
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
pageParam
Type: String
The 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 items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

Return Value

Type: ConnectApi.​Comment​​Page

getFeed(communityId, feedType)

Returns information about the feed for the specified feed type.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.

Return Value

Type: ConnectApi.Feed

getFeed(communityId, feedType, sortParam)

Returns the feed for the specified feed type in the specified order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
sortParam
Type: ConnectApi.​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.Feed

getFeed(communityId, feedType, subjectId)

Returns the feed for the specified feed type for the specified user.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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)

Returns the feed for the specified feed type for the specified user, in the specified order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.Feed

getFeedDirectory(String)

Returns a list of all feeds available to the context user.

API Version

30.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedDirectory getFeedDirectory(String communityId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.

Return Value

Type: ConnectApi.FeedDirectory

getFeedElement(communityId, feedElementId)

Returns information about the specified feed element.

API Version

31.0

Available to Guest Users

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElement getFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

Return Value

Type: ConnectApi.FeedElement

getFeedElement(communityId, feedElementId, recentCommentCount, elementsPerBundle)

Returns information about the specified feed element with the specified number of elements per bundle including no more than the specified number of comments per feed element.

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
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.

Return Value

Type: ConnectApi.FeedElement

getFeedElementBatch(communityId, feedElementIds)

Get information about the specified list of feed elements. Returns errors embedded in the results for feed elements that couldn’t be loaded.

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

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementIds
Type: String
A list of up to 500 feed element IDs.

Return Value

Type: BatchResult[]

The BatchResult getResults() method returns a ConnectApi.FeedElement object.

getFeedElementPoll(communityId, feedElementId)

Returns the poll associated with the feed element.

API Version

32.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.PollCapability getFeedElementPoll(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

Return Value

Type: ConnectApi.PollCapability

Note

Note

Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.

getFeedElementsFromBundle(communityId, feedElementId)

Returns the first page of feed-elements from a bundle.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElementPage getFeedElementsFromBundle(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

getFeedElementsFromBundle(communityId, feedElementId, pageParam, pageSize, elementsPerBundle, recentCommentCount)

Returns the feed elements on the specified page for the bundle. Each feed element includes no more than the specified number of comments. Specify the maximum number of feed elements in a bundle.

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
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
pageParam
Type: String
Specifies the page token to be used 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
The maximum number of feed elements per bundle. The default and maximum value is 10.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.

getFeedElementsFromFeed(communityId, feedType)

Returns the first page of feed elements from the Company, Home, and Moderation feed types. The page contains the default number of items.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. Valid values are Company, Home, and Moderation.

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, pageParam, pageSize, sortParam)

Returns the feed items for the specified page for the Company, Home, and Moderation feed types, in the specified order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

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, recentCommentCount, density, pageParam, pageSize, sortParam)

Returns the feed elements for the specified page for the Company, Home, and Moderation feed types, in the specified order. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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, recentCommentCount, density, pageParam, pageSize, sortParam, filter)

Returns the feed elements for the specified page for the Home feed type, with the specified filter in the specified order. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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)

Returns the first page of feed elements for any feed type other than Company, Filter, Home, and Moderation, for the specified user or record. The page contains the default number of elements.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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.FeedElementPage

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, pageParam, pageSize, sortParam)

Returns the feed elements on the specified page for any feed type other than Company, Filter, Home, and Moderation, in the specified order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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)

Returns the feed elements on the specified page for any feed type other than Company, Filter, Home, and Moderation, in the specified order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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, showInternalOnly)

Returns the feed elements on the specified page for the specified record feed (including groups) in the specified order. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedElementPage

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, filter)

Returns the specified page of feed elements for the UserProfile feed. Use this method to filter the UserProfile feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

Return Value

Type: ConnectApi.FeedElementPage

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)

Returns the feed elements on the specified page for the specified record feed (including groups) in the specified order. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-community) users only. Specify the maximum number of feed elements in a bundle.

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
Use either the ID for a community, 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
The maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedElementPage

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, filter)

Returns the feed elements on the specified page for the specified record feed (including groups) in the specified order. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-community) users only. Specify the maximum number of feed elements in a bundle and the feed 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
Use either the ID for a community, 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
The maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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)

Returns the first page of feed elements for the specified user and the specified key prefix.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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.FeedElementPage

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)

Returns the specified page of feed elements for the specified user and the specified key prefix, in the specified order.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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)

Returns the specified page of feed elements for the specified user and the specified key prefix, in the specified order. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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, elementsPerClump, density, pageParam, pageSize, updatedSince)

Returns the specified page of feed elements for the specified user and the specified key prefix. Includes only feed elements that have been updated since the time specified in the updatedSince parameter.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElementPage getFeedElementsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 defining the modification time stamp 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

Type: ConnectApi.FeedElementPage

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)

Returns the specified page of feed elements for the Company, Home, and Moderation feed types. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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

Type: ConnectApi.FeedElementPage

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, filter)

Returns the specified page of feed elements for the Home feed type with the specified feed filter. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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, density, pageParam, pageSize, updatedSince)

Returns the specified page of feed elements for the Files, Groups, News, People, and Record feed types. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Each feed element contains no more than the specified number of comments.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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

Type: ConnectApi.FeedElementPage

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, density, pageParam, pageSize, updatedSince, showInternalOnly)

Returns the specified page of feed elements for the Record feed type. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed elements posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedElementPage

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, filter)

Returns the specified page of feed elements for the UserProfile feed. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Use this method to filter the UserProfile feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 defining the modification time stamp 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 communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

Return Value

Type: ConnectApi.FeedElementPage

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, elementsPerClump, density, pageParam, pageSize, updatedSince, showInternalOnly)

Returns the specified page of feed elements for the Record feed type. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed elements posted by internal (non-community) users only. Specify the maximum number of feed elements in a bundle.

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 elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedElementPage

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, elementsPerClump, density, pageParam, pageSize, updatedSince, showInternalOnly, filter)

Returns the specified page of feed elements for the Record feed type. Includes only feed elements that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed elements posted by internal (non-community) users only. Specify the maximum number of feed elements in a bundle and the feed 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 elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedFilter filter)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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.

getFeedItem(communityId, feedItemId)

Returns a rich description of the specified feed item.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use getFeedElement(communityId, feedElementId).

Available to Guest Users

31.0 only

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItem getFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.FeedItem

Note

Note

Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.

getFeedItemBatch(communityId, feedItemIds)

Returns information about the specified list of feed items. Returns a list of BatchResult objects containing ConnectApi.FeedItem objects. Errors for feed items that can't be loaded are returned in the results.

API Version

31.0–31.0
Important

Important

In version 32.0 and later, use getFeedElementBatch(communityId, feedElementIds).

Requires Chatter

Yes

Signature

public static ConnectApi.BatchResult[] getFeedItemBatch(String communityId, List<String> feedItemIds)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemIds
Type: List<String>
A list of up to 500 feed item IDs.

Return Value

Type: ConnectApi.BatchResult[]

The ConnectApi.BatchResult.getResult() method returns a ConnectApi.FeedItem object.

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)

Returns the first page of feed items for the Company, Home, and Moderation feed types. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType).

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.

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.

getFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam)

Returns the feed items for the specified page for the Company, Home, and Moderation feed types, in the specified order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam)

Returns the feed items for the specified page for the Company, Home, and Moderation feed types, in the specified order. Each feed item contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFeed(communityId, feedType, subjectId)

Returns the first page of feed items for the specified feed type, for the specified user or record. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use getFeedElementsFromFeed(communityId, feedType, subjectId).

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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

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.

getFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam)

Returns the feed items on the specified page for the specified user or record, for the specified feed type in the specified order.

API Version

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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 page contains the default number of items.
sortParam
Type: ConnectApi.​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam)

Returns the feed items on the specified page for the specified user or record, for the specified feed type in the specified order. Each feed item includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly)

Returns the feed items on the specified page for the specified user or record, for the Record feed type in the specified order. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.

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.

getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix)

Returns the first page of feed items for the specified user and the specified key prefix. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use getFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix).

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItemPage getFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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

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.

getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam)

Returns the specified page of feed items for the specified user and the specified key prefix, in the specified order.

API Version

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam)

Returns the specified page of feed items for the specified user and the specified key prefix, in the specified order. Each feed item contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

getFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, updatedSince)

Returns the specified page of feed items for the specified user and the specified key prefix. Includes only feed items that have been updated since the time specified in the updatedSince parameter.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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. 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

A paged collection of ConnectApi.FeedItem objects.

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)

Returns the specified page of feed items for the Company, Home, and Moderation feed types. Includes only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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

A paged collection of ConnectApi.FeedItem objects.

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

This example gets the feed items in the company feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
// 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)

Returns the specified page of feed items for the Files, Groups, News, People, and Record feed types. Includes only feed items that have been updated since the time specified in the updatedSince parameter. Each feed item contains no more than the specified number of comments.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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

A paged collection of ConnectApi.FeedItem objects.

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

This example gets the feed items in the news feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
// 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)

Returns the specified page of feed items for the Record feed type. Includes only feed items that have been updated since the time specified in the updatedSince parameter. Specify whether to return feed items posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedItemPage

A paged collection of ConnectApi.FeedItem objects.

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 Communities is enabled, feed items from communities are included. Otherwise, only feed items from the internal community 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

This example gets the feed items in the news feed and grabs the updatesToken property from the returned object. It then passes the value of updatesToken to the getFeedItemsUpdatedSince method to get the feed items updated since the first call:
// 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)

Returns the poll associated with the feed item.

API Version

28.0–31.0

Important

Important

In version 32.0 and later, use getFeedElementPoll(communityId, feedElementId).

Requires Chatter

Yes

Signature

public static ConnectApi.FeedPoll getFeedPoll(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.FeedPoll

Note

Note

Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.

getFilterFeed(communityId, subjectId, keyPrefix)

Returns the first page of a feed for the specified user and the given key prefix.

API Version

28.0

Requires Chatter

Yes

Signature

public static ConnectApi.Feed getFilterFeed(String communityId, String subjectId, String keyPrefix)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The ID of the context user or the alias me.
keyPrefix
Type: String
A key prefix is the first three characters of a record ID, which specifies the entity type.

Return Value

Type: ConnectApi.Feed

getFilterFeed(communityId, subjectId, keyPrefix, sortParam)

Returns the first page of a feed in the specified order for the specified user and the given key prefix.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.Feed

getFilterFeedDirectory(communityId, subjectId)

Gets a feed directory object that contains a list of filter feeds available to the context user. A filter feed is the news feed filtered to include feed items whose parent is a specific entity type.

API Version

30.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedDirectory getFilterFeedDirectory(String communityId, String subjectId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The ID of the context user or the alias me.

Return Value

Type: ConnectApi.FeedDirectory

A directory containing a list of filter feeds.

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 entity type.

Use the 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 the User (005) or Group (0F9) entity types, 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)

Returns the specified like.

API Version

28.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLike getLike(String communityId, String likeId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
likeId
Type: String
The ID for a like.

Return Value

Type: ConnectApi.​Chatter​Like

getLikesForComment(communityId, commentId)

Returns the first page of likes for the specified comment. The page contains the default number of items.

API Version

28.0

Available to Guest Users

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLikePage getLikesForComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

getLikesForComment(communityId, commentId, pageParam, pageSize)

Returns the specified page of likes for the specified comment.

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
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.
pageParam
Type: Integer
Specifies the 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 items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

getLikesForFeedElement(communityId, feedElementId)

Get the first page of likes for a feed element.

API Version

32.0

Available to Guest Users

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLikePage getLikesForFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.

Return Value

Type: ConnectApi.​Chatter​Like​Page Class

If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.

getLikesForFeedElement(communityId, feedElementId, pageParam, pageSize)

Returns the specified page of likes for a feed element.

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
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
pageParam
Type: String
The 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

Type: ConnectApi.​Chatter​Like​Page Class

If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.

getLikesForFeedItem(communityId, feedItemId)

Returns the first page of likes for the specified feed item. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use getLikesForFeedElement(communityId, feedElementId).

Available to Guest Users

31.0 only

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLikePage getLikesForFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

getLikesForFeedItem(communityId, feedItemId, pageParam, pageSize)

Returns the specified page of likes for the specified feed item.

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
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
pageParam
Type: Integer
Specifies the 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 items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.

isCommentEditableByMe(communityId, commentId)

Indicates whether the context user can edit a comment.

API Version

34.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedEntityIsEditable isCommentEditableByMe(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
ID of the comment.

Return Value

Type: ConnectApi.FeedEntityIsEditable

isFeedElementEditableByMe(communityId, feedElementId)

Indicates whether the context user can edit a feed element. Feed items are the only type of feed element that can be edited.

API Version

34.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedEntityIsEditable isFeedElementEditableByMe(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element. Feed items are the only type of feed element that can be edited.

Return Value

Type: ConnectApi.FeedEntityIsEditable

likeComment(communityId, commentId)

Adds a like to the specified comment for the context user. If the user has already liked this comment, this is a non-operation and returns the existing like.

API Version

28.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLike likeComment(String communityId, String commentId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
commentId
Type: String
The ID for a comment.

Return Value

Type: ConnectApi.​Chatter​Like

likeFeedElement(communityId, feedElementId)

Like a feed element.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLike likeFeedElement(String communityId, String feedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.

Return Value

Type: ConnectApi.ChatterLike

If the feed element doesn’t support the ChatterLikes capability, the return value is ConnectApi.NotFoundException.

likeFeedItem(communityId, feedItemId)

Adds a like to the specified feed item for the context user. If the user has already liked this feed item, this is a non-operation and returns the existing like.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use likeFeedElement(communityId, feedElementId).

Requires Chatter

Yes

Signature

public static ConnectApi.ChatterLike likeFeedItem(String communityId, String feedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.

Return Value

Type: ConnectApi.​Chatter​Like

postComment(communityId, feedItemId, text)

Adds the specified text as a comment to the feed item, for the context user.

API Version

28.0–31.0

Important

Important

In version 32.0 and later, use postCommentToFeedElement(communityId, feedElementId, text).

Requires Chatter

Yes

Signature

public static ConnectApi.Comment postComment(String communityId, String feedItemId, String text)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The 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

If hashtags or links are detected in text, they are included in the comment as hashtag and link segments. Mentions are not detected in text and are not separated out of the text.

Feed items and comments can contain up to 10,000 characters.

postComment(communityId, feedItemId, comment, feedItemFileUpload)

Adds a comment to the feed item from the context user. Use this method to use rich text, including mentions, and to attach a file to a comment.

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
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
comment
Type: ConnectApi.Comment​​Input
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.Binary​​Input
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);

postCommentToFeedElement(communityId, feedElementId, text)

Post a plain text comment to a feed element.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.Comment postCommentToFeedElement(String communityId, String feedElementId, String text)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
text
Type: String
Text of the comment. A comment can contain up to 10,000 characters.

Return Value

Type: ConnectApi.Comment

If the feed element doesn’t support the Comments capability, the return value is ConnectApi.NotFoundException.

postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload)

Post a comment to a feed element. Use this method to post rich text, including mentions, and to attach a file. A comment can contain up to 10,000 characters.

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
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
comment
Type: ConnectApi.CommentInput
The comment body, including text and mentions, and capabilities, such as information about an attached file.
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.

postFeedElement(communityId, subjectId, feedElementType, text)

Posts a feed element with plain text from the context user.

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
Use either the ID for a community, 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.​FeedElement​Type
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

postFeedElement(communityId, feedElement, feedElementFileUpload)

Posts a feed element from the context user. Use this method to post rich text, including mentions and hashtag topics, to attach a file to a feed element, and to associate action link groups with a feed element. You can also use this method to share a feed element and add a comment.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElement postFeedElement(String communityId, ConnectApi.FeedElementInput feedElement, ConnectApi.BinaryInput feedElementFileUpload)

Parameters

communityId
Type: String
Use either the ID for a community, 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.Binary​​Input
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

postFeedElementBatch(communityId, feedElements)

Posts a batch of up to 500 feed elements for the cost of one DML statement.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.BatchResult[] postFeedElementBatch(String communityId, List<ConnectApi.BatchInput> feedElements)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElements
Type: List<ConnectApi.BatchInput Class>
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.

The ConnectApi.BatchInput Class class has three constructors, but the postFeedElementBatch method only supports the two listed here. It doesn’t support multiple binary inputs.

In each constructor, the input object must be an instance of ConnectApi.FeedElementInput. Pick a constructor based on whether or not you want to pass a binary input.
  • ConnectApi.BatchInput(Object input)—No binary input
  • ConnectApi.BatchInput(Object input, ConnectApi.BinaryInput binary)—One binary input.

postFeedItem(communityId, feedType, subjectId, text)

Posts a feed item with plain text from the context user.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use postFeedElement(communityId, subjectId, feedElementType, text).

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItem postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
One of the following:
  • News
  • Record
  • UserProfile
Use Record to post to a group.
subjectId
Type: String
The value depends on the feedType:
  • NewssubjectId must be the ID of the context user or the keyword me.
  • Record—The ID of any record with a feed, including groups.
  • UserProfile—The ID of any user.
text
Type: String
The 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

Note

Note

Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.

Usage

Feed items and comments can contain up to 10,000 characters.

Posts to ConnectApi.FeedType.UserProfile in API versions 23.0 and 24.0 created user status updates, not feed items. For posts to the User Profile Feed in those API versions, the character limit is 1,000 characters.

postFeedItem(communityId, feedType, subjectId, feedItemInput, feedItemFileUpload)

Posts a feed item to the specified feed from the context user. Use this method to post rich text, including mentions and hashtag topics, and to attach a file to a feed item. You can also use this method to share a feed item and add a comment.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use postFeedElement(communityId, feedElement, feedElementFileUpload).

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
One of the following:
  • News
  • Record
  • UserProfile
To post a feed item to a group, use Record and use a group ID as the subjectId.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType 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.FeedItem​​Input
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.Binary​​Input
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

Note

Note

Triggers on FeedItem objects run before their attachment and capabilities information is saved, which means that ConnectApi.FeedItem.attachment information and ConnectApi.FeedElement.capabilities information may not be available in the trigger.

Usage

Feed items and comments can contain up to 10,000 characters. Posts to ConnectApi.FeedType.UserProfile in API versions 23.0 and 24.0 created user status updates, not feed items. For posts to the User Profile Feed in those API versions, the character limit is 1,000 characters.

Sample: 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, and 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);

Sample: Posting an @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);

searchFeedElements(communityId, q)

Returns the first page of all the feed elements that match the specified search criteria.

API Version

31.0

Available to Guest Users

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElementPage searchFeedElements(String communityId, String q)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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.FeedElementPage

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)

Returns the first page of all the feed elements that match the specified search criteria in the specified order.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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)

Searches feed elements and returns a specified page and page size of search results.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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

Type: ConnectApi.FeedElementPage

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)

Searches feed elements and returns a specified page and page size in a specified order.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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)

Searches feed elements and returns a specified page and page size in a specified order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.

Return Value

Type: ConnectApi.FeedElementPage

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)

Searches the feed elements for the Company, Home, and Moderation feed types.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
q
Type: String
Required and cannot 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.FeedElementPage

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, pageParam, pageSize, sortParam, q)

Searches the feed elements for the Company, Home, and Moderation feed types and returns a specified page and page size in a specified sort order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.FeedElementPage

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, recentCommentCount, density, pageParam, pageSize, sortParam, q)

Searches the feed elements for the Company, Home, and Moderation feed types and returns a specified page and page size in a specified sort order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.FeedElementPage

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, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter)

Searches the feed elements for the Home feed type and returns a specified page and page size with the specified feed filter in a specified sort order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. The only valid value is Home.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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, q)

Searches the feed items for a specified feed type.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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 cannot 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.FeedElementPage

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, pageParam, pageSize, sortParam, q)

Searches the feed elements for a specified feed type and context user, and returns a specified page and page size in a specified sort order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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
Specifies the order returned by the sort, such as by date created or last modified:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter does not support wildcards. This parameter is required.

Return Value

Type: ConnectApi.FeedElementPage

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)

Searches the feed elements for a specified feed type and returns a specified page and page size in a specified sort order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.FeedElementPage

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, filter)

Searches the feed elements of the UserProfile feed. Use this method to filter the UserProfile feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.

Return Value

Type: ConnectApi.FeedElementPage

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)

Searches the feed elements for a specified feed type and context user, and returns a specified page and page size in a specified sort order. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.

Return Value

Type: ConnectApi.FeedElementPage

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, filter)

Searches the feed elements for a specified feed type and context user, and returns a specified page and page size in a specified sort order. Each feed element includes no more than the specified number of comments. Specify whether to return feed elements posted by internal (non-community) users only. Specify feed 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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.

Return Value

Type: ConnectApi.FeedElementPage

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, q)

Searches the feed elements of a feed filtered by key prefix.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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 cannot 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.FeedElementPage

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)

Searches the feed elements of a feed filtered by key prefix, and returns a specified page and page size in a specified sort order.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.FeedElementPage

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)

Searches the feed elements of a feed filtered by key prefix, and returns a specified page and page size in a specified sort order. Each feed element includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.FeedElementPage

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.

searchFeedItems(communityId, q)

Returns the first page of all the feed items that match the specified search criteria. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElements(communityId, q).

Available to Guest Users

31.0 only

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItemPage searchFeedItems(String communityId, String q)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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.

searchFeedItems(communityId, q, sortParam)

Returns the first page of all the feed items that match the specified search criteria. The page contains the default number of items.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElements(communityId, q, sortParam).

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

searchFeedItems(communityId, q, pageParam, pageSize)

Returns a list of all the feed items viewable by the context user that match the specified search criteria.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElements(communityId, q, pageParam, pageSize).

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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 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

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.

searchFeedItems(communityId, q, pageParam, pageSize, sortParam)

Returns a list of all the feed items viewable by the context user that match the specified search criteria.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElements(communityId, q, pageParam, pageSize, sortParam).

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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.

searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam)

Returns a list of all the feed items viewable by the context user that match the specified search criteria.

API Version

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed item. The default value is 3.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.

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, q)

Searches the feed items for the Company, Home, and Moderation feed types.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, q).

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
q
Type: String
Required and cannot 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)

Searches the feed items for the Company, Home, and Moderation feed types and returns a specified page and page size in a specified sort order.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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)

Searches the feed items for the Company, Home, and Moderation feed types and returns a specified page and page size in a specified sort order. Each feed item includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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)

Searches the feed items for a specified feed type.

API Version

28.0–31.0
Important

Important

In version 32.0 and later, use searchFeedElementsInFeed(communityId, feedType, subjectId, q).

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
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 cannot 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)

Searches the feed items for a specified feed type and user or record, and returns a specified page and page size in a specified sort order.

API Version

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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 items per page. Valid values are from 1 through 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​FeedSortOrder
Specifies the order returned by the sort, such as by date created or last modified:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter does not 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)

Searches the feed items for a specified feed type and returns a specified page and page size in a specified sort order. Each feed item includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String, Boolean)

Searches the feed items for a specified feed type and user or record, and returns a specified page and page size in a specified sort order. Each feed item includes no more than the specified number of comments. Specify whether to return feed items posted by internal (non-community) users only.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.

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.

searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q)

Searches the feed items of a feed filtered by key prefix.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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 cannot 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.

searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q)

Searches the feed items of a feed filtered by key prefix, and returns a specified page and page size in a specified sort order.

API Version

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.

searchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q)

Searches the feed items of a feed filtered by key prefix, and returns a specified page and page size in a specified sort order. Each feed item includes no more than the specified number of comments.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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.

setIsMutedByMe(communityId, feedElementId, isMutedByMe)

Mute or unmute a feed element.

API Version

35.0

Requires Chatter

Yes

Signature

public static ConnectApi.MuteCapability setIsMutedByMe(String communityId, String feedElementId, Boolean isMutedByMe)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
ID of the feed element.
isMutedByMe
Type: Boolean
Indicates whether the feed element is muted for the context user. Default value is false.

Return Value

Type: ConnectApi.MuteCapability

shareFeedElement(communityId, subjectId, feedElementType, originalFeedElementId)

Share a feed element to a feed element type.

API Version

31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElement shareFeedElement(String communityId, String subjectId, ConnectApi.FeedElementType feedElementType, String originalFeedElementId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The ID of the user or group with whom to share the feed element.
feedElementType
Type: ConnectApi.​FeedElement​Type
Values are:
  • Bundle—A container of feed elements. A bundle also has a body made up of message segments that can always be gracefully degraded to text-only values.
  • FeedItem—A feed item has a single parent and is scoped to one community or across all communities. A feed item can have capabilities such as bookmarks, canvas, content, comment, link, poll. Feed items have a body made up of message segments that can always be gracefully degraded to text-only values.
  • Recommendation—A recommendation is a feed element with a recommendations capability. A recommendation suggests records to follow, groups to join, or applications that are helpful to the context user.
originalFeedElementId
Type: String
The ID of the feed element to share.

Return Value

Type: ConnectApi.FeedElement

shareFeedItem(communityId, feedType, subjectId, originalFeedItemId)

Share the originalFeedItemId to the feed specified by the feedType.

API Version

28.0–31.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItem shareFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String originalFeedItemId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
One of the following:
  • News
  • Record
  • UserProfile
To share a feed item with a group, use Record and use a group ID as the subjectId.
subjectId
Type: String
The value depends on the value of feedType:
  • NewssubjectId must be the ID of the context user or the keyword me.
  • RecordsubjectId can be a group ID or the ID of the context user (or me).
  • UserProfilesubjectId can be any user ID.
originalFeedItemId
Type: String
The ID of the feed item to share.

Return Value

Type: ConnectApi.FeedItem

Sample: Sharing a Feed Item with a Group

To share a feed item with a group, call ConnectApi.ChatterFeeds.shareFeedItem and pass it the community ID (or null), the feed type Record, the group ID, and the ID of the feed item to share.

ConnectApi.ChatterFeeds.shareFeedItem(null, ConnectApi.FeedType.Record, '0F9D00000000izf', '0D5D0000000JuAG');

updateBookmark(communityId, feedItemId, isBookmarkedByCurrentUser)

Bookmarks the specified feed item or removes a bookmark from the specified feed item.

Requires Chatter

Yes

Signature

public static ConnectApi.FeedItem updateBookmark(String communityId, String feedItemId, Boolean isBookmarkedByCurrentUser)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
The ID for a feed item.
isBookmarkedByCurrentUser
Type: Boolean
—Specifying true adds the feed item to the list of bookmarks for the current user. Specify false to remove a bookmark.

Return Value

Type: ConnectApi.FeedItem

updateComment(communityId, commentId, comment)

Edits a 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
Use either the ID for a community, 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

updateFeedElement(communityId, feedElementId, feedElement)

Edits a feed element. Feed items are the only type of feed element that can be edited.

API Version

34.0

Requires Chatter

Yes

Signature

public static ConnectApi.FeedElement updateFeedElement(String communityId, String feedElementId, ConnectApi.FeedElementInput feedElement)

Parameters

communityId
Type: String
Use either the ID for a community, 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 element to be edited. Feed items are the only type of feed element that can be edited.

Return Value

Type: ConnectApi.FeedElement

updateFeedElementBookmarks(communityId, feedElementId, bookmarks)

Bookmark or unbookmark a feed element by passing a ConnectApi.BookmarksCapabilityInput object.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, ConnectApi.BookmarksCapabilityInput bookmarks)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a 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)

Bookmark or unbookmark a feed element by passing a boolean value.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.BookmarksCapability updateFeedElementBookmarks(String communityId, String feedElementId, Boolean isBookmarkedByCurrentUser)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
isBookmarkedByCurrentUser
Type: Boolean
Specify whether to bookmark the feed element (true) or not (false).

Return Value

Type: ConnectApi.BookmarksCapability

If the feed element doesn’t support this capability, the return value is ConnectApi.NotFoundException.

voteOnFeedElementPoll(communityId, feedElementId, myChoiceId)

Vote on a poll or change your vote on a poll.

API Version

32.0

Requires Chatter

Yes

Signature

public static ConnectApi.PollCapability voteOnFeedElementPoll(String communityId, String feedElementId, String myChoiceId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedElementId
Type: String
The ID for a feed element.
myChoiceId
Type: String
The ID of the poll item to vote for. The key prefix for poll items is 09A.

Return Value

Type: ConnectApi.​PollCapability Class

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');

voteOnFeedPoll(communityId, feedItemId, myChoiceId)

Used to vote or to change your vote on an existing feed poll.

API Version

28.0–31.0

Important

Important

In version 32.0 and later, use voteOnFeedElementPoll(communityId, feedElementId, myChoiceId).

Requires Chatter

Yes

Signature

public static ConnectApi.FeedPoll voteOnFeedPoll(String communityId, String feedItemId, String myChoiceId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedItemId
Type: String
Specify the feed item that is associated with the poll.
myChoiceId
Type: String
Specify the ID of the item in the poll to vote for.

Return Value

Type: ConnectApi.FeedPoll

ChatterFeeds Test Methods

The following are the test methods for ChatterFeeds. All methods are static.

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

setTestGetFeedElementsFromFeed(communityId, feedType, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
The only valid value for this parameter is Company.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
The feed type.
subjectId
Type: String
The ID of the context user or the alias me.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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 page contains the default number of items.
sortParam
Type: ConnectApi.​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerClump, density, pageParam, pageSize, sortParam, showInternalOnly, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFeed(communityId, feedType, subjectId, recentCommentCount, elementsPerClump, density, pageParam, pageSize, sortParam, showInternalOnly, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsFromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

API Version

32.0

Signature

public static Void setTestGetFeedElementsFromFeed(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, Boolean showInternalOnly, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed item. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, result)

Registers a ConnectApi.FeedElementPage object to be returned when the matching getFeedElements​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when the matching getFeedElements​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerClump, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedElementPage object to be returned when the matching getFeedElements​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFilterFeed(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, elementsPerClump, density, pageParam, pageSize, updatedSince, result)

Registers a ConnectApi.FeedElementPage object to be returned when the getFeedElementsFromFilterFeedUpdatedSince method is called in a test context.

API Version

31.0

Signature

public static Void setTestGetFeedElementsFromFilterFeedUpdatedSince(String communityId, String subjectId, String keyPrefix, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 defining the modification time stamp 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerBundle, density, pageParam, pageSize, updatedSince, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 defining the modification time stamp 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 communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerClump, density, pageParam, pageSize, updatedSince, showInternalOnly, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

API Version

31.0

Signature

public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedElementsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, elementsPerClump, density, pageParam, pageSize, updatedSince, showInternalOnly, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when getFeedElementsUpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

API Version

32.0

Signature

public static Void setTestGetFeedElementsUpdatedSince(String communityId, ConnectApi.FeedType feedType, String subjectId, Integer recentCommentCount, Integer elementsPerClump, ConnectApi.FeedDensity density, String pageParam, Integer pageSize, String updatedSince, Boolean showInternalOnly, ConnectApi.FeedFilter filter, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, 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
The maximum number of comments to return with each feed element. The default value is 3.
elementsPerBundle
Type: Integer
The maximum number of feed elements per bundle. The default and maximum value is 10.
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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

API Version

28.0–31.0

Signature

public static Void setTestGetFeedItemsFromFeed(String communityId, ConnectApi.FeedType feedType, ConnectApi.FeedItemPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, showInternalOnly, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​FromFeed is called with matching parameters in a test context. Use the get feed method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
showInternalOnly
Type: Boolean
Specifies whether to show only feed items from internal (non-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, result)

Registers a ConnectApi.FeedItemPage object to be returned when the matching getFeedItems​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

API Version

28.0–31.0

Signature

public static Void setTestGetFeedItemsFromFilterFeed(String communityId, String subjectId, String keyPrefix, ConnectApi.FeedItemPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when the matching getFeedItems​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, result)

Registers a ConnectApi.FeedItemPage object to be returned when the matching getFeedItems​​FromFilterFeed method is called in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeedUpdatedSince(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, updatedSince, result)

Registers a ConnectApi.FeedItemPage object to be returned when the getFeedItemsFromFilterFeedUpdatedSince method is called in a test context.

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
updatedSince
Type: String
An 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(communityId, feedType, recentCommentCount, density, pageParam, pageSize, updatedSince, ConnectApi.FeedItemPage, results)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​UpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​UpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, updatedSince, showInternalOnly, result)

Registers a ConnectApi.FeedItemPage object to be returned when getFeedItems​UpdatedSince is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElements(communityId, q, result)

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

API Version

31.0

Signature

public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElements(communityId, q, sortParam, result)

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

API Version

31.0

Signature

public static Void setTestSearchFeedElements(String communityId, String q, ConnectApi.FeedSortOrder sortParam, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElements(communityId, q, pageParam, pageSize, result)

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

API Version

31.0

Signature

public static Void setTestSearchFeedElements(String communityId, String q, String pageParam, Integer pageSize, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.D
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElements(communityId, q, pageParam, pageSize, sortParam, result)

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

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElements(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)

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

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed element. The default value is 3.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, q, result)

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

API Version

31.0

Signature

public static Void setTestSearchFeedElementsInFeed(String communityId, ConnectApi.FeedType feedType, String q, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
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 cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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
Specifies the order returned by the sort, such as by date created or last modified:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of one character is required. This parameter does not support wildcards. This parameter is required.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, filter, result)

Registers a ConnectApi.FeedElementPage object to be returned when searchFeedElementsInFeed is called with matching parameters in a test context. Use the method with the same parameters or the code throws an exception.

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Value must be ConnectApi.FeedType.UserProfile.
subjectId
Type: String
The ID of any user. To specify the context user, use the user ID or the alias me.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
Specifies the page token to be used 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
One or more keywords to search for in the feed elements visible to the context user. The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.
filter
Type: ConnectApi.FeedFilter
Value must be ConnectApi.FeedFilter.CommunityScoped. Filters the feed to include only feed elements that are scoped to communities. Feed elements that are always visible in all communities are filtered out. Currently, feed elements scoped to communities have a User or a Group parent record. However, other parent record types could be scoped to communities in the future.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)

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

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, filter, result)

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

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
Use either the ID for a community, 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.
filter
Type: ConnectApi.​FeedFilter
Specifies the feed filters.
  • AllQuestions—Only feed elements that are questions.
  • CommunityScoped—Only feed elements that are scoped to communities. Currently, these feed elements have a User or a Group parent record. However, other parent record types could be scoped to communities in the future. Feed elements that are always visible in all communities are filtered out. This value is valid only for the UserProfile feed.
  • SolvedQuestions—Only feed elements that are questions and that have a best answer.
  • UnansweredQuestions—Only feed elements that are questions and that don’t have any answers.
  • UnsolvedQuestions—Only feed elements that are questions and that don’t have a best answer.
result
Type: ConnectApi.FeedElementPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, q, result)

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

API Version

31.0

Signature

public static Void setTestSearchFeedElementsInFilterFeed(String communityId, String subjectId, String keyPrefix, String q, ConnectApi.FeedElementPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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 cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedElementsInFilterFeed(communityId, subjectId, keyPrefix, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed element, or by the most recently modified feed element. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItems(communityId, q, result)

Registers a test feed item page to be returned when searchFeedItems(communityId, q) is called during a test.

API Version

28.0–31.0

Signature

public static Void searchFeedItems(String communityId, String q, ConnectApi.FeedItemPage result)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItems(communityId, q, sortParam, result)

Registers a test feed item page to be returned when searchFeedItems(String, String, ConnectApi.FeedSortOrder) is called during a test.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The feed item test page.

Return Value

Type: Void

setTestSearchFeedItems(communityId, q, pageParam, pageSize, result)

Registers a test feed item page to be returned when searchFeedItems(String, String, String, Integer) is called during a test.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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 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)

Registers a test feed item page to be returned when searchFeedItems(String, String, String, Integer, ConnectApi.FeedSortOrder) is called during a test.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The test feed item page.

Return Value

Type: Void

setTestSearchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam, result)

Registers a test feed item page to be returned when searchFeedItems(communityId, q, recentCommentCount, pageParam, pageSize, sortParam) is called during a test.

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
Use either the ID for a community, internal, or null.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
recentCommentCount
Type: Integer
The maximum number of comments to return with each feed item. The default value is 3.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
result
Type: ConnectApi.FeedItemPage
The test feed item page.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values are Company, Home, and Moderation.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
recentCommentCount
Type: Integer
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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 cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(communityId, feedType, subjectId, recentCommentCount, density, pageParam, pageSize, sortParam, q, showInternalOnly, result)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company and Filter.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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-community) users (true), or not (false). The default value is false.
result
Type: ConnectApi.FeedItemPage
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFilterFeed(communityId, subjectId, keyPrefix, q, result)

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

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
Use either the ID for a community, internal, or null.
subjectId
Type: String
The 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 cannot 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)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
The 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
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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)

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

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
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.​​​FeedType
The type of feed. Valid values include every ConnectApi.FeedType except Company, Filter, Home, and Moderation.
subjectId
Type: String
The 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
The 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.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.
pageParam
Type: String
The 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 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:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
Sorts the returned feed by the most recently created feed item, or by the most recently modified feed item. If you pass in null, the default value CreatedDateDesc is used.
q
Type: String
Required and cannot 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