Newer Version Available

This content describes an older version of this product. View Latest

ChatterFeeds Class

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

Namespace

ConnectApi

Usage

Feeds are made up of feed items. A feed item is a piece of information posted by a user (for example, a poll) or by an automated process (for example, when a tracked field is updated on a record). Because feeds and feed items are the core of Chatter, understanding them is crucial to developing applications with Chatter REST API and Chatter in Apex. For detailed information about the composition of feeds and feed items, see Working with Feeds and Feed Items.

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

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

Important

ChatterFeeds Methods

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

deleteComment(String, String)

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

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

deleteFeedItem(String, String)

Deletes the specified feed item.

API Version

28.0

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(String, String)

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

API Version

28.0

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(String, String)

Returns the specified comment.

API Version

28.0

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 Class

getCommentsForFeedItem(String, String)

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

API Version

28.0

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.

getCommentsForFeedItem(String, String, String, Integer)

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

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.

getFeed(String, ConnectApi.FeedType)

Returns information about the feed for the specified feed type.

API Version

28.0

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. The only valid value is Company.

Return Value

Type: ConnectApi.Feed Class

getFeed(String, ConnectApi.FeedType, ConnectApi.FeedSortOrder)

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

API Version

28.0

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. The only valid value is Company.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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 Class

getFeed(String, ConnectApi.FeedType, String)

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

API Version

28.0

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

Return Value

Type: ConnectApi.Feed Class

getFeed(String, ConnectApi.FeedType, String, ConnectApi.FeedSortOrder)

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

API Version

28.0

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 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.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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 Class

getFeedDirectory(String)

Returns a list of all feeds available to the logged-in user.

API Version

30.0

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

getFeedItem(String, String)

Returns a rich description of the specified feed item.

API Version

28.0

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 Class

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

Note

getFeedItemsFromFeed(String, ConnectApi.FeedType)

Returns the first page of feed items for the Company feed type. The page contains the default number of items.

API Version

28.0

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. The only valid value is Company.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedSortOrder)

Returns the feed items for the specified page for the Company feed type, in the specified order.

API Version

28.0

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. The only valid value 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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

29.0

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. The only valid value is Company.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, String)

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

API Version

28.0

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

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, String, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

28.0

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 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
The page contains the default number of items.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

29.0

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 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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, Boolean)

Returns the feed items on the specified page for the specified user, for the specified 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.

API Version

30.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching setTest​​GetFeedItems​FromFeed method, returns the feed item page passed in with that method. You must use the test method with the same parameters, or you receive an exception.

getFeedItemsFromFilterFeed(String, String, String)

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

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.

Usage

When invoked during a test with the matching set test method, returns the feed item page that was passed in with that method, filtered by the key prefix: only the feed items associated with the specified type are returned. You must use the test method with the exact same parameters, or you receive an exception.

getFeedItemsFromFilterFeed(String, String, String, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching set test method, returns the feed item page that was passed in with that method, filtered by the key prefix: only the feed items associated with the specified type are returned. You must use the test method with the exact same parameters, or you receive an exception.

getFeedItemsFromFilterFeed(String, String, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder)

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.

API Version

29.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

When invoked during a test with the matching set test method, returns the feed item page that was passed in with that method, filtered by the key prefix: only the feed items associated with the specified type are returned. You must use the test method with the exact same parameters, or you receive an exception.

getFeedItemsFromFilterFeedUpdatedSince(String, String, String, Integer, ConnectApi.FeedDensity, String, Integer, String)

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.

API Version

30.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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 this method, use the matching set test method. When invoked during a test with the matching set test method, returns the feed item page that was passed in with that method, filtered by the key prefix: only the feed items associated with the specified type are returned. You must use the test method with the exact same parameters, or you receive an exception.

getFeedItemsUpdatedSince(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, String)

Returns the specified page of feed items for the Company feed type. 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.

API Version

30.0

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. The only valid value is Company.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class

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.

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:

getFeedItemsUpdatedSince(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, String)

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.

API Version

30.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class

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.

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:

getFeedItemsUpdatedSince(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, String, Boolean)

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.

API Version

30.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class

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.

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:

getFeedPoll(String, String)

Returns the poll associated with the specified feed item.

API Version

28.0

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 Class

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

Note

getFilterFeed(String, String, String)

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

API Version

28.0

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 Class

getFilterFeed(String, String, String, ConnectApi.FeedType)

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

API Version

28.0

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 the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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 Class

getFilterFeedDirectory(String, String)

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

API Version

30.0

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 logged-in 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 logged-in 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.

getLike(String, String)

Returns the specified like.

API Version

28.0

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.

getLikesForComment(String, String)

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

API Version

28.0

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(String, String, Integer, Integer)

Returns the specified page of likes for the specified comment.

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.

getLikesForFeedItem(String, String)

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

API Version

28.0

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(String, String, Integer, Integer)

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

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.

isModified(String, ConnectApi.FeedType, String, String)

Returns information about whether a news feed has been updated or changed. Use this method to poll a news feed for updates.

API Version

28.0

Signature

public static ConnectApi.FeedModifiedInfo isModified(String communityId, ConnectApi.FeedType feedType, String subjectId, String since)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
feedType
Type: ConnectApi.FeedType
Specifies the type of feed. The only supported type is News
subjectId
Type: String
The ID of the context user or the alias me.
since
Type: String
an opaque token containing information about the last modified date of the feed. Retrieve this token from Feed.isModifiedToken or FeedItemPage.isModifiedToken.

Usage

For more information, see News Feed Is-Modified in Chatter REST API Developer’s Guide.

likeComment(String, String)

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

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.

likeFeedItem(String, String)

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

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.

postComment(String, String, String)

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

API Version

28.0

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
Specify the text of the post.

Return Value

Type: ConnectApi.​Comment Class

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 5000 characters.

postComment(String, String, ConnectApi.CommentInput, ConnectApi.BinaryInput)

Adds a comment to the specified 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

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 Class
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 Class
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 Class

Usage

Feed items and comments can contain up to 5000 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.

postFeedItem(String, ConnectApi.FeedType, String, String)

Adds a feed item to the specified feed from the context user.

API Version

28.0

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 comment. Mentions and hashtags are removed.

Return Value

Type: ConnectApi.FeedItem Class

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

Note

Usage

Feed items and comments can contain up to 5000 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 1000 characters.

postFeedItem(String, ConnectApi.FeedType, String, ConnectApi.FeedItemInput, ConnectApi.BinaryInput)

Adds a feed item to the specified feed from the context user Use this method to post rich text, including @mentions and hashtags, 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

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 Class
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 Class
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 Class

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

Note

Usage

Feed items and comments can contain up to 5000 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 1000 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.

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.

searchFeedItems(String, String)

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

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.

searchFeedItems(String, String, ConnectApi.FeedSortOrder)

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

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 the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

searchFeedItems(String, String, String, Integer)

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

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.

searchFeedItems(String, String, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

searchFeedItems(String, String, Integer, String, Integer, ConnectApi.FeedSortOrder)

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

API Version

29.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

searchFeedItemsInFeed(String, ConnectApi.FeedType, String)

Searches the feed items for the Company feed type.

API Version

28.0

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. The only valid value is Company.
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.

Usage

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

searchFeedItemsInFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedSortOrder, String)

Searches the feed items for the Company feed type and returns a specified page and page size in a specified sort order.

API Version

28.0

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. The only valid value 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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

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

searchFeedItemsInFeed(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String)

Searches the feed items for the Company 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.

API Version

29.0

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. The only valid value is Company.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

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

searchFeedItemsInFeed(String, ConnectApi.FeedType, String, String)

Searches the feed items for a specified feed type.

API Version

28.0

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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feed type is UserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the alias me.
q
Type: String
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.

Usage

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

searchFeedItemsInFeed(String, ConnectApi.FeedType, String, String, Integer, ConnectApi.FeedSortOrder, String)

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

API Version

28.0

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
The type of the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
feedType
Type: ConnectApi.​​​FeedType
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the alias me.
subjectId
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.
pageParam
Type: String
Specifies the number of items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
pageSize
Type: Integer
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Required and cannot be null. Specifies the string to search. The search string must contain at least two characters, not including wildcards. See Wildcards.
q
Type: String
Search term. Searches keywords in the user or group name. A minimum of 1 character is required. This parameter does not support wildcards. This parameter is required.

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). You must 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)

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.

API Version

29.0

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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If feedType is any other value, subjectId must be the ID of the context user or the alias me.
recentCommentCount
Type: Integer
Specify the amount of content in a feed.
  • AllUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
density
Type: ConnectApi.FeedDensity
Specify the amount of content in a feed.
  • AllUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

To test code that uses this method, use the matching set test method (prefix the method name with setTest). You must 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 context user, 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.

API Version

30.0

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
The type of the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

To test code that uses this method, use the matching set test method.

searchFeedItemsInFilterFeed(String, String, String, String)

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

API Version

28.0

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.

Usage

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

searchFeedItemsInFilterFeed(String, String, String, String, Integer, ConnectApi.FeedSortOrder, String)

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

28.0

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

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

searchFeedItemsInFilterFeed(String, String, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String)

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.

API Version

29.0

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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.

Usage

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

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, ConnectApi.FeedItemPage)

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

API Version

28.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. The only valid value is Company.
result
Type: ConnectApi.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

28.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. The only valid value 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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

29.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. The only valid value is Company.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, String, ConnectApi.FeedItemPage)

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

API Version

28.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 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.
result
Type: ConnectApi.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, String, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

28.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 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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

29.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 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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, Boolean, ConnectApi.FeedItemPage)

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

API Version

30.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 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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(String, String, String, ConnectApi.FeedItemPage)

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

API Version

28.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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(String, String, String, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

28.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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeed(String, String, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

29.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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsFromFilterFeedUpdatedSince(String, String, String, Integer, ConnectApi.FeedDensity, String, Integer, String, ConnectApi.FeedItemPage)

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

API Version

30.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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, String, ConnectApi.FeedItemPage)

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

API Version

30.0

Signature

public static Void setTestGetFeedItemsUpdatedSince(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. The only valid value is Company.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, String, ConnectApi.FeedItemPage)

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

API Version

30.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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestGetFeedItemsUpdatedSince(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, String, Boolean, ConnectApi.FeedItemPage)

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

API Version

30.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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItems(String, String, ConnectApi.FeedItemPage)

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

API Version

28.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(String, String, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

28.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 the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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(String, String, String, Integer, ConnectApi.FeedItemPage)

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

API Version

28.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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
result
Type: ConnectApi.FeedItem​Page Class
The test feed item page.

Return Value

Type: Void

setTestSearchFeedItems(String, String, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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(String, String, Integer, String, Integer, ConnectApi.FeedSortOrder, ConnectApi.FeedItemPage)

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

API Version

29.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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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(String, ConnectApi.FeedType, String, ConnectApi.FeedItemPage)

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

API Version

28.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. The only valid value is Company.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

28.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 and Filter.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

29.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 and Filter.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, String, String, ConnectApi.FeedItemPage)

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

API Version

28.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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If 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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, String, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

28.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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If 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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

29.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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If 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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFeed(String, ConnectApi.FeedType, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String, Boolean, ConnectApi.FeedItemPage)

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

API Version

29.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 the feed. Valid values include every ConnectApi.FeedType except Company, Filter, and Topics.
subjectId
Type: String
If feedType is Record, subjectId can be any record ID, including a group ID. If feedType is UserProfile, subjectId can be any user ID. If 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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
The object containing test data.

Return Value

Type: Void

setTestSearchFeedItemsInFilterFeed(String, String, String, String, ConnectApi.FeedItemPage)

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

API Version

s

28.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.FeedItem​Page Class
Specify the test feed item page.

Return Value

Type: Void

setTestSearchFeedItemsInFilterFeed(String, ConnectApi.FeedType, String, String, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

28.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 and Filter.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.​​​FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
Specify the test feed item page.

Return Value

Type: Void

setTestSearchFeedItemsInFilterFeed(String, ConnectApi.FeedType, String, String, Integer, ConnectApi.FeedDensity, String, Integer, ConnectApi.FeedSortOrder, String, ConnectApi.FeedItemPage)

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

API Version

29.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 and Filter.
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 posts and comments from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all posts and comments from people and records the user follows and groups the user is a member of, but hides system-generated posts from records that nobody commented on.
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 items per page. Valid values are between 1 and 100. If you pass in null, the default size is 25.
sortParam
Type: ConnectApi.FeedSortOrder
Values are:
  • CreatedDateDesc—Sorts the feed items by most recent post date.
  • LastModifiedDateDesc—Sorts the feed items by most recent activity, which includes new feed items and comments.
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.FeedItem​Page Class
Specify the test feed item page.

Return Value

Type: Void

shareFeedItem(String, ConnectApi.FeedType, String, String)

Share the originalFeedItemId to the feed specified by the feedType.

API Version

28.0

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 Class

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

Note

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.

updateBookmark(String, String, Boolean)

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

API Version

28.0

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 Class

voteOnFeedPoll(String, String, String)

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

API Version

28.0

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 Class

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

Note