30.03.2014 Views

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

Database.com Chatter REST API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Chatter</strong> <strong>API</strong>: How do I. . .<br />

Request body example:<br />

{<br />

}<br />

"originalFeedItemId": "0D5D0000000DaZBKA0"<br />

Returns:<br />

Feed Item<br />

Poll news feed<br />

Resource: 1. Use either of the following resources to get the latest items from a news feed or to get<br />

information about the feed: /chatter/feeds/news/me/feed-items,<br />

/chatter/feeds/news/me.<br />

The response bodies for both resources contain the isModifiedUrl property. This<br />

property contains the URL to the Is-Modified resource, which includes a since request<br />

parameter that defines the last modified date of the feed. Note that if the sort order of<br />

the request to the news feed changes, the news feed is modified.<br />

2. Issue a GET request to the URL in the isModifiedUrl property.<br />

The Feed Modified Info response contains the following properties:<br />

• isModified—a boolean indicating whether the feed has been updated since the last<br />

time you checked. Note that conditions under which this property is true depend on<br />

the sort order of the original request to the news feed. For example, if the feed is sorted<br />

by posts (CreatedDateDesc) and a <strong>com</strong>ment was added, isModified is false.<br />

• nextPollUrl—a string containing the URL of the Is-Modified resource. This<br />

property contains a URL only if isModified is false. If isModified is true,<br />

nextPollUrl is null.<br />

3. If the isModified property is true, issue a GET request to the News Feed Items<br />

resource to refresh the news feed.<br />

4. If the isModified property is false, issue a GET request to the URL in the<br />

nextPollUrl property. This request also returns a Feed Modified Info response body<br />

that contains the isModified and nextPollUrl properties.<br />

Note: We don’t re<strong>com</strong>mend polling the news feed for updates more than once a<br />

minute.<br />

HTTP method:<br />

Request body:<br />

Request parameter:<br />

Request body example:<br />

GET<br />

NA<br />

NA<br />

The following News Feed URL resource:<br />

/chatter/feeds/news/005xx000001Sv1mAAB<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!