Re: Webhook Mapping

Jason_Scott
Level 4

Webhook Mapping

Is there a way to map the entire webhook response?

Tags (3)
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook Mapping

I gather you want to add fields to the response without changing the definition... don't believe that's possible.

Anonymous
Not applicable

Re: Webhook Mapping

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

Jason_Scott
Level 4

Re: Webhook Mapping

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?

Jason_Scott
Level 4

Re: Webhook Mapping

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?

SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook Mapping

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"

}

Anonymous
Not applicable

Re: Webhook Mapping

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