Newer Version Available

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

Filter Feed Resources

The filter feed is the news feed filtered to contain feed elements whose parent is a specified object type.

Available resources are:

Resource Description
/chatter/feeds/filter/userId A collection of feed directory objects that contain information about filter feeds available to the context user. Each object contains a URL for the filter feed, a URL for feed items or feed elements in the filter feed, and a label describing the object used to filter the feed.
/chatter/feeds/filter/userId/idPrefix A feed object that contains information about a specific filter feed available to the context user.
/chatter/feeds/filter/userId/idPrefix​/feed-elements Feed elements from the context user’s news feed whose parent has the specified key prefix, such as the feed elements from all the groups the context user is a member of.

List of Filter Feed URLs

A collection of feed directory objects that contain information about filter feeds available to the context user. Each object contains a URL for the filter feed, a URL for feed items or feed elements in the filter feed, and a label describing the object used to filter the feed. Each URL contains the first three characters of the filter object, which is called a key prefix and specifies the object type. Use this resource to return a list of the possible key prefix filter feeds that the context user can apply to their news feed. See Filter Feed Items and Filter Feed Elements.

The collection of feed directory objects never contains User (005) and Group (0F9) object types. However, you can use those object types to filter the feed.

Note

Resource
1/chatter/feeds/filter/userId
1/connect/communities/communityId/chatter/feeds/filter/userId

userId must be the ID of the context user or the alias me.

Available since version
23.0
Requires Chatter
Yes
HTTP methods
GET or HEAD
Response body
Feed Directory
If the response body is empty, the user isn’t following any records.

Specific Filter Feed URL

A feed object that contains information about a specific filter feed available to the context user. The keyPrefix in the resource URL is the first three characters of the object ID and indicates the object type.

Resource
1/chatter/feeds/filter/userId/keyPrefix
1/connect/communities/communityId/chatter/feeds/filter/userId/keyPrefix

userId must be the ID of the context user or the alias me.

Available since version
23.0
Requires Chatter
Yes
HTTP methods
GET or HEAD
Request parameters
Parameter Name Type Description
sort String Specifies the order returned by the sort, such as by date created or last modified:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
The default value is CreatedDescDate.
Response body
Feed
Example response body
This request returns the URL for a filter feed items resource that’s filtered by the User object (key prefix 005).
1GET /chatter/feeds/filter/me/005

Filter Feed Items

Feed items from the context user’s news feed whose parent has the specified key prefix, such as the feed items from all the groups the context user is a member of. The key prefix specifies the object type and is the first three characters of an object ID.

To filter by feed items with a User parent object, use the key prefix 005.

To filter by feed items with a Group parent object, use the key prefix 0F9.

To filter by feed items with a parent object that the context user is following (for example, Account), use the List of Filter Feed URLs resource to return the parent objects.

Suppose the context user is a member of five groups. The following resource returns all of the feed items posted to all five of those groups:
1/chatter/feeds/filter/me/0F9/feed-items
Contrast that with a request to the Record Feed Items resource, which returns all of the feed items posted to a particular group:
1/chatter/feeds/record/0F9XXXXXXXXX/feed-items

The filter feed returns only the feed items that are visible to the context user. In the first example, the resource doesn’t return the feed items for groups the context user is not a member of. In the second example, if the group is public, even if the context user is not a member, the resource returns all the group’s feed items.

Resource
1/chatter/feeds/filter/me/keyPrefix/feed-items
or
1/chatter/feeds/filter/userId/keyPrefix/feed-items

userId must be the ID of the context user or the alias me.

Available versions
23.0–31.0

In version 32.0 and later, use Filter Feed Elements.

Important

Requires Chatter
Yes
HTTP methods
GET or HEAD
Request parameters
Parameter Name Type Description Required or Optional Available Version
density String The density of the feed. One of these values:
  • AllUpdates—Displays all updates from people and records the user follows and groups the user is a member of.
  • FewerUpdates—Displays all updates from people and records the user follows and groups the user is a member of, but hides some system-generated updates from records.

The default value is AllUpdates.

Optional 29.0–31.0
page String A generated token that indicates the view of feed elements in the feed.
Page tokens are returned as part of the response body, in one of the URL parameters, such as nextPageURL, for example:
1"nextPageUrl": 
2"/services/data/v34.0/
3chatter/feeds/news/
4005D0000001GLowIAN
5/feed-elements
6?page=2011-03-30T17:34:50Z,
70D5D0000000DSv4KAG"
Optional 23.0–31.0
pageSize Integer Specifies the number of items per page. Valid values are between 1 and 100. If you don't specify a size, the default is 25. Optional 23.0–31.0
q String One or more keywords to search for in the body and comments of feed elements in this feed.

The search string can contain wildcards and must contain at least two characters that aren’t wildcards. See Wildcards.

Optional 28.0–31.0
recentComment​Count Integer Maximum number of comments to include per feed item. The default value is 3. The maximum value is 25. Optional 29.0–31.0
sort String Specifies the order returned by the sort, such as by date created or last modified:
  • CreatedDateDesc—Sorts by most recent creation date.
  • LastModifiedDateDesc—Sorts by most recent activity.
The default value is CreatedDescDate.
Optional 23.0–31.0
updatedSince String An opaque token defining the modification time stamp of the feed and the sort order.

Do not construct this token. Retrieve this token from the updatesToken property of the Feed Element Page response body.

Optional 30.0–31.0
Response body
Feed Item Page
Example
This request gets all the feed items whose parent is the User object and that the context user can see.
1GET https://instance_name/services/data/v34.0/chatter/feeds/filter/me/005/feed-items

Filter Feed Items Flat

This resource is deprecated as of version 26.0.

Returns a flat feed, that is, a feed where there is no hierarchy between feed items and comments: Feed items and comments are at the same level. All items are returned in chronological order.

Resource
1/chatter/feeds/filter/me/feed-items/flat
or
1/chatter/feeds/filter/userId/feed-items/flat

userId must be the ID of the context user or the alias me.

Note

Available since version
25.0–26.0
Requires Chatter
Yes
HTTP methods
GET or HEAD
Request parameters
Parameter Name Type Description
numFeedItems Integer Specifies the number of feed items returned. Valid values are from 0 through 100. Default value is 25. Because feed items can include comments, specifying 25 flat feed items may actually return more. For example, if each feed item has one comment, and recentCommentCount is greater than 1, 50 flat feed items are returned.
page String A generated token that indicates the view of feed items in the feed. Page tokens are returned as part of the response body, in one of the URL parameters, such as nextPageURL.
recentComment​Count Integer Specifies the number of recent comments returned. Valid values are from 0 through 25. Default value is 3.
sort String. One of the following:
  • CreatedDateDesc
  • LastModifiedDateDesc
Sorts the returned feed either by created date in ascending order, or by last modified date, also in ascending order. The default is LastModifiedDateDesc
Response body
Flat Feed