3

Is there a way to specify a particular community when creating a Chatter post in the Connect API using Apex? EntitySubscription etc. have a NetworkIdfield for connecting things to particular communities, but the only methods I can see that are community related are for reading some basic information about the communities available.

1 Answer 1

2

Yes, almost every Connect API (Chatter REST API) endpoint supports communities. For posting a feed item to your news feed, the URL has this form:

/connect/communities/<communityId>/chatter/feeds/news/me/feed-items

See http://www.salesforce.com/us/developer/docs/chatterapi/Content/intro_building_url.htm for more information.

Using the ConnectApi namespace in Apex, almost all of the methods include the network/community ID as the first parameter. For the posting example, one of the methods you could use is ConnectApi.ChatterFeeds.postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text)

3
  • Ah, I should have been more specific. I meant using the Connect API from Apex, not REST.
    – Matt Lacey
    Commented Dec 8, 2013 at 3:25
  • Using the ConnectApi namespace in Apex, almost all of the methods include the network/community ID as the first parameter. For the posting example, one of the methods you could use is ConnectApi.ChatterFeeds.postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text).
    – alouie
    Commented Dec 10, 2013 at 7:26
  • Hmmm, maybe I was looking at older docs!
    – Matt Lacey
    Commented Dec 11, 2013 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .