Newer Version Available

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

Deciding When to Use Chatter REST API

Use Chatter REST API to:
  • Build a mobile client that displays a Chatter feed.
  • Integrate a third-party Web application with Chatter so it can notify groups of users about events.
  • Display the Chatter feed on an external system, such as an intranet site, after users are authenticated.
  • Make feeds actionable and integrated with third-party sites. For example, an app that posts a Chatter item to Twitter whenever the post includes #tweet hashtag.
  • Create simple games that interact with the feed for notifications. Games might include things like sales incentive competitions.
  • Creating a custom, branded skin for Chatter for your organization.

How is Chatter REST API Different from other APIs?

Chatter REST API complements the SOAP API and the REST API by making it easy to interact with Chatter data, such as feeds, group information, and Chatter user-profile details.

The following are some of the differences between Chatter REST API and the SOAP API and REST API:

  • Returned information is automatically localized to the user's time zone and language.
  • Feed items are structured in a way that makes it easy to render on Web sites and mobile devices.
  • Changed values that are tracked in a feed are returned as value-pair representations.
  • Relationships between objects can easily be traversed without having to resolve foreign keys. For example, using Chatter REST API you can get all of a user's followers or groups with one request per page.
  • Rate limiting for Chatter REST API is per user, per application, per hour. The rate limiting for SOAP API and REST API is by organization. For more information, see Understanding a Chatter REST API Request and Response.

Selecting the Right API for Your Application

Salesforce provides many types of APIs for various use cases, including both SOAP API and REST API. These APIs provide access to the majority of Salesforce data, including most of the Chatter data.

So when should you use which API?

Situations where you would want to use SOAP API or REST API include:

  • Migrating or synchronizing user profiles and their associated user photos from one system to another.
  • Creating analytic applications for Chatter.
  • Queries where you want to select specifically which records or fields are returned.

SOAP API and REST API’s rate limiting and powerful query language more suited to these use cases and contains most of the applicable Chatter data.

However, Chatter REST API is the only API that supports some of Chatter’s more complex data structures, for example posting photos or using @mention rich text in feed items. If necessary, you can use SOAP API or REST API for the bulk of your queries, then use the feed item or comment Ids you’ve extracted to selectively work with Chatter REST API.

Chatter in Apex

Many Chatter REST API resource actions are exposed as static methods on Apex classes in the ConnectApi namespace. This namespace is also referred to as Chatter in Apex. Use Chatter in Apex to develop Chatter applications on the Force.com platform without using HTTP callouts from Apex.

The documentation for Chatter in Apex is available in the Apex Code Developer’s Guide.