The short explanation is: use Chatter in Apex. Many Chatter REST API resource actions are exposed as static methods on Apex classes in the ConnectApi namespace. These classes are called “Chatter in Apex.”

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

Watch the Chatter in Apex Video Tutorial

The team working on Chatter in Apex has created a video that walks you through creating an Apex controller, a Visualforce component, and a Visualforce page that displays two Chatter feeds side by side. It’s a very simple example to get you up and running as quickly as possible.

Do the Chatter in Apex Quick Start

The Quick Start in the Apex Developer’s Guide also builds a page with side by side Chatter feeds. The difference between the quick start and the video tutorial is that the quick start displays feeds from Chatter groups while the video displays the news feeds from Salesforce Communities.

Here’s a screenshot of the Chatter Groups page you’ll create in the Quick Start:

Two Chatter group feeds on one page

 

Use Chatter in Apex to Build Custom UI in Salesforce

If you want to create a custom Chatter experience in Salesforce, check the Chatter in Apex documentation—the functionality you’re looking for exists and is awesome!

Related Resources 

Chatter in Apex Documentation

Getting Started with Chatter in Apex

tagged , , , , Bookmark the permalink. Trackbacks are closed, but you can post a comment.
  • Mitesh Sura

    is this true for “chatteranswers:allfeeds” community tag as well?

  • calvin noronha

    Hi, we would like to displayed a customixzed chatter feed in a Visualforce page which will be used in a force.com site page in our Salesforce community. Can we use this method. I think I read somewhere that chatter tags in Visual force do not work when used with force.com sites. Is that correct? Thank you.

    • Jody Bleyle

      Chatter components aren’t available for Visualforce pages on Force.com sites, but Chatter in Apex is available. It sounds like Chatter in Apex is perfect for your use case.

      • calvin noronha

        Hi Jody but we would like to use this in a VF page which will used in a force.com site as part of our Salesforce community. Therefore could I used the methods outlined above?

        • Jody Bleyle

          Yes. Chatter in Apex consists of Apex classes in the ConnectApi namespace. It’s different than Chatter Visualforce components. Try the quick start!

          • calvin noronha

            hey Jodi I began looking into this. But it appears I need to enable this API for my org or something? I am in my Sandbox which is summer 13. My Force.com IDE is on the latest v27.0. When I try to create a class with some of these methods, I get errors like “Method not added until version 26.0: getFeedItemsFromFeed”.
            It tells me that the FeedItemInfo class does not exist…So can you please tell me if there is something I need to do in order to be able to use the ConnectAPI?

          • Jody Bleyle

            It sounds like Force.com IDE hasn’t been updated for Summer 13. Summer 13 is API version 28.0. Try using the Developer Console in an org.

          • calvin noronha

            Jody thank you so much for your patience and help. My problem was that I had created my Controller before upgrading my IDE so I had to change its version and the IDE was able to suggest methods from the Connect API. I also created a VF page which displays the chatter feed from the record. It worked fine when accessed directly. I wanted it to be part of a Force.com site and to be accessed by the site guest user who has full read permissions on the data but I was getting an error. Using debug logs I found the actual error is “Insufficient Privileges: The Connect API is not enabled for this user type.” This profile has the “Enable API” permission. What else must I do to allow my site user access to this? Thank you once again!

          • calvin noronha

            Jody thank you so much for your patience and help. My problem was that I
            had created my Controller before upgrading my IDE so I had to change
            its version and the IDE was able to suggest methods from the Connect
            API. I also created a VF page which displays the chatter feed from the
            record. It worked fine when accessed directly. I wanted it to be part of
            a Force.com site and to
            be accessed by the site guest user who has full read permissions on the
            data but I was getting an error. Using debug logs I found the actual
            error is “Insufficient Privileges: The Connect API is not enabled for
            this user type.” This profile has the “Enable API” permission. What else
            must I do to allow my site user access to this? Thank you once again!