Newer Version Available
Post Multiple @Mentions
- Resource
- To post a feed item with up to 25 mentions, use /chatter/feed-elements.
- To post a comment with up to 25 mentions, use /chatter/feed-elements/feedElementId/capabilities/comments/items.
- HTTP method
- POST
- Request body
- For a feed item, use Feed Item Input
For a comment, use Comment Input
Both of these input request bodies include a body property that is a Message Body Input request body. In these examples, the Message Body Input request body includes a messageSegments property that has two Message Segment Input: Text request bodies and two Message Segment Input: Mention request bodies.
- Request body example
- This example is for a feed item:
1{ 2 "body" : { 3 "messageSegments" : [ 4 { 5 "type" : "Text", 6 "text" : "When should we meet for release planning? " 7 }, 8 { 9 "type" : "Mention", 10 "id" : "005T0000000mzCy" 11 }, 12 { 13 "type" : "Text", 14 "text" : " " 15 }, 16 { 17 "type" : "Mention", 18 "id" : "005B0000000Ek1S" 19 } 20 ] 21 }, 22 "feedElementType" : "FeedItem", 23 "subjectId" : "005D00000016Qxp" 24} - This example is for a comment:
1{ "body" : 2 { 3 "messageSegments" : [ 4 { 5 "type": "mention", 6 "id":"005D0000001LL8YIAW" 7 }, 8 { 9 "type" : "Text", 10 "text" : " " 11 }, 12 { 13 "type": "mention", 14 "id":"005D0000001LL8sIAG" 15 }, 16 { 17 "type": "text", 18 "text":" Did you see the new plans?" 19 } 20 ] 21 } 22} - Returns
- Feed Item
- Comment