6 Replies Latest reply on Apr 7, 2016 11:22 AM by Rajesh Talele

    Webhook Mapping

    Jason Scott

      Is there a way to map the entire webhook response?

        • Re: Webhook Mapping
          Sanford Whiteman

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

          1 of 1 people found this helpful
          • Re: Webhook Mapping
            Rajesh Talele

            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

            • Re: Webhook Mapping
              Jason Scott

              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?

                • Re: Webhook Mapping
                  Sanford Whiteman

                  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"

                  }

                  1 of 1 people found this helpful
                  • Re: Webhook Mapping
                    Rajesh Talele

                    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