Is there a way to map the entire webhook response?
I gather you want to add fields to the response without changing the definition... don't believe that's possible.
Webhook response mapping GUI in Marketo enables us to specify the jSON / XML field and does the parsing for us automatically.
But there is no way to specify it to get the entire JSON / XML response and store it in a field.
If you have access to the web hook server, you can encapsulate the entire JSON / XML you see now in another JSON / XML as a node. And then you can get that value.
How are you going to use that JSON / XML in Marketo though? What is the business case?
Rajesh
We're making a call using a webhook and the response is a snippet of html code, it's not XML or JSON. I need to map this to a marketo field. How can I define the "Response Attribute" as the whole response?
The webhook response we are given is a snippet of code, not an array. I want to map this snippet, which is the whole response, to a marketo field. Is this possible? How can I define the "Response Attribute" as the whole response?
If the response is HTML, then it's (probably) not well-formed XML nor JSON.
I would do what Rajesh suggested, which is encapsulate the HTML block as a property of a simple JSON object.
{
html : "your \"escaped\" <html> here"
}
Unfortunately, I do not think so.
You will have to 'bring in' the current 'entire response' into an 'attribute' by modifying the web hook server response. You will have to modify the server code for this.
So right now if you have,
<response>
this is the code snippet.
</response>
modify it to,
<response>
<my_response>this is the code snippet. <my_response>
</response>
And then in Marketo web hook definition, use attribute 'my_response' to map.
This is just an example, not any code syntax.
Rajesh