Newer Version Available

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

Working with Chatter in Apex

Many Chatter REST API resource actions are exposed as static methods on Apex classes in the ConnectApi namespace. These methods use other ConnectApi classes to input and return information. The ConnectApi namespace is referred to as Chatter in Apex.

Use Chatter in Apex to develop native, social Force.com applications. Create Visualforce pages that display feeds, post feed items with mentions and topics, and update user and group photos. Create triggers that update Chatter feeds. Use ConnectApi classes to do just about anything you can do in the Chatter Web user interface.

In Apex, it is possible to access some Chatter data using SOQL queries and objects. However, ConnectApi classes expose Chatter data in a much simpler way. Data is localized and structured for display. For example, instead of making many calls to access and assemble a feed, you can do it with a single call.

Chatter in Apex methods execute in the context of the logged-in user, who is also referred to as the context user. The code has access to whatever the context user has access to. It doesn’t run in system mode like other Apex code.

For Chatter in Apex reference information, see ConnectApi Namespace.