I've been building a webhook to create a new text-type chatter item in SFDC and it has worked perfectly when I manually specify the subjectID. However, If I attempt to replace this with a Marketo token, the webhook fails. Code and error messaging below.
Webhook template that works on my specified test record:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "New Auto-MQL Action taken! Please follow up. "
},
{
"type" : "Mention",
"id" : "0054u0000072xd5"
}]
},
"feedElementType" : "FeedItem",
"subjectId" : "00QTH000002tBpi2AE"
}
When I iterate and replace "subjectId" : "00QTH000002tBpi2AE" with "subjectId" : "{{lead.SFDC ID}}" so that:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "New Auto-MQL Action taken! Please follow up. "
},
{
"type" : "Mention",
"id" : "0054u0000072xd5"
}]
},
"feedElementType" : "FeedItem",
"subjectId" : "{{lead.SFDC ID}}"
}
I get error: Server Returned code 400 when run on the same person record.
[{"errorCode":"JSON_PARSER_ERROR","message":"Unexpected character ('\"' (code 34)): was expecting comma to separate OBJECT entries at [line:15, column:18]"}]
Solved! Go to Solution.
Thanks so much, Sanford, that's exactly what I was doing wrong. I appreciate your quick help.