How can I use the ConnectAPI to like a chatter comment? I'm looking at the likeFeedItem method in the ChatterFeeds class. How do I get the FeedItemId? I'm not seeing a method to get the FeedItemId?

How can I accomplish this?



A feed contains a collection of feed elements. If you get a feed with something like ConnectApi.ChatterFeeds.getFeedElementsFromFeed(communityId, ConnectApi.FeedType.News, 'me'), the result have a collection of feed elements, and each feed element will have an "id" property -- that's the ID to use in the likeFeedItem or likeFeedElement method call.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.