Newer Version Available

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

Poll My News Feed for Updates

Resource
  1. Use either of the following resources to get the latest elements from a news feed or to get information about the feed: /chatter/feeds/news/me/feed-elements, /chatter/feeds/news/me.

    The response bodies for both resources contain the isModifiedUrl property. This property contains the URL to the Is-Modified resource, which includes a since request parameter that defines the last modified date of the feed. If the sort order of the request to the news feed changes, the news feed is modified.

  2. Issue a GET request to the URL in the isModifiedUrl property.
    The Feed Modified Info response contains the following properties:
    • isModified—a boolean indicating whether the feed has been updated since the last time you checked. Conditions under which this property is true depend on the sort order of the original request to the news feed. For example, if the feed is sorted by posts (CreatedDateDesc) and a comment was added, isModified is false.
    • nextPollUrl—a string containing the URL of the Is-Modified resource. This property contains a URL only if isModified is false. If isModified is true, nextPollUrl is null.
  3. If the isModified property is true, issue a GET request to the News Feed Elements resource to refresh the news feed.
  4. If the isModified property is false, issue a GET request to the URL in the nextPollUrl property. This request also returns a Feed Modified Info response body that contains the isModified and nextPollUrl properties.

We don’t recommend polling the news feed for updates more than once a minute.

Note

HTTP method
GET
Example
This News Feed URL resource:
1/chatter/feeds/news/me
Returns this for the Feed response body:
1{ 
2   "feedElementPostUrl": "/services/data/v32.0/chatter/feed-elements",
3   "feedElementsUrl": "/services/data/v32.0/chatter/feeds/news/005xx000001Sv1mAAB/feed-elements",
4   "isModifiedUrl": "/services/data/v32.0/chatter/feeds/news/005xx000001Sv1mAAB/is-modified?since=2%3A1344352279000" 
5}
The Is-Modified resource for polling this news feed is:
1/chatter/feeds/news/005xx000001Sv1mAAB/is-modified?since=2%3A1344352279000
Returns
Feed Modified Info