function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BenedictBenedict 

How can I get "@"(mention) information from Chatter using SOQL or REST?

Hi, I am a new Chatter App developer and I am trying to extract interactions between Chatter users in my organization.

The "@" or mention information is very important for my App, but it seems there is no documentation about how to get "@" information neither in SOQL nor in REST.

Can anybody tell me how to access "@" information? Many thanks in advance!

Best Answer chosen by Admin (Salesforce Developers) 
ChrisOctagonChrisOctagon

Hi Benedict,

 

The Chatter REST API ( http://www.salesforce.com/us/developer/docs/chatterapi/index.htm ) returns full information on the message "segments" in a feed item. This includes information on mention segments.

 

From the help page on the response payloads here: http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_returns.htm you can see that the "Feed Body" payload which is contained in returned feed items and comments includes segment information. A mention segment has a "type" property of "mention" and contains a summary of the mentioned user.

 

You can also post feed items and comments that include mentions using the Chatter REST API. Provide a json or XML payload (using content-type application/json or application/xml) following the structures outlined here http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resources_input.htm

 

Cheers,

- Chris

All Answers

ChrisOctagonChrisOctagon

Hi Benedict,

 

The Chatter REST API ( http://www.salesforce.com/us/developer/docs/chatterapi/index.htm ) returns full information on the message "segments" in a feed item. This includes information on mention segments.

 

From the help page on the response payloads here: http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_returns.htm you can see that the "Feed Body" payload which is contained in returned feed items and comments includes segment information. A mention segment has a "type" property of "mention" and contains a summary of the mentioned user.

 

You can also post feed items and comments that include mentions using the Chatter REST API. Provide a json or XML payload (using content-type application/json or application/xml) following the structures outlined here http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resources_input.htm

 

Cheers,

- Chris

This was selected as the best answer
vijaysingh109vijaysingh109

Hi .. ,

Chatter Rest API retrun MessageSegment where we can get the every type of body text . Because of the API limiation I am just working with SOQL .

I am querying on FeedItem and lets say if FeedItem type='TrackedChange' then we can get the text body which is a track change like if some body has created an account then this feed text would be like ....

 

Record Name — User Name created this account.

 

How would I get this text from SOQL ?

 

Thanks