I am using the workbench (https://workbench.developerforce.com/restExplorer.php) to create a request body example to post a feed element with a url link.
When using v29.0, the post address is: /services/data/v29.0/chatter/feeds/news/me/feed-items?text=New+status+post
and the request body is and this works:
{
"body":{
"messageSegments":[
{
"type":"Text",
"text":"BEER!! "
}
]
},
"attachment":{
"attachmentType" : "Link",
"url": "bbc.co.uk"
}
}
But when I am using v39.0. I understand the post address is different which I am using: /services/data/v39.0/chatter/feed-elements?feedElementType=FeedItem&text=New+post
and use the new attributes Link Capability as suggested by the chatter api documentation I am getting the error:
JSON_PARSER_ERROR errorCode: JSON_PARSER_ERROR message: Unrecognized field "linkCapability" at [line:-1, column:-1]
Request body:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "When should we meet for release planning? "
},
{
"type" : "Mention",
"id" : "005D00000016Qxp"
}]
},
"subjectId" : "0050Y000001RUZp",
"linkCapability": {
"url": "http://www.example.com",
"urlName": "Example"
}
}
Does anyone have any suggestions please?