Skip to main content
May 22, 2013
Question

webhook does not permit the json type in template - body of post

  • May 22, 2013
  • 8 replies
  • 2470 views
when i use webhook and i try to define the type json for the body of the psot request - it will send type
"application/x-www-form-urlencoded" in any case.

Any ideas why?
thanks
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

8 replies

May 22, 2013
Hi Amnon,
webhooks currently does not support changing the request headers. All webhooks call-outs are done as form POST

The Drop down that you are using is for response parsing. i.e. parse the response as JSON/XML and then use it to map values to lead fields.

regards
May 22, 2013
Amnon,
We plan to allow custom headers in the June release and this will enable you to change the mime-type

Raj
May 23, 2013
Thanks for the reply.
So to be sure - what you are saying is that the "Request Token Encoding" does not work?
Thanks, Michal
May 23, 2013
not quite - token encoding is handled properly, but mime-type is not set to match the request template.  
November 4, 2013
@Raj  Thanks for the responses.  May I check on the status of this?  For my POST webhooks Marketo always seems to set the content-type header to "application/x-www-form-urlencoded", even when posting json.

But third party site requires it to be set to "application/json" when POSTing json.
 
I don't see any way to set custom headers. Changing "Response type" doesn't seem to do it.
 
November 4, 2013
Richard,
You can set the content-type header to application/json


November 6, 2013
Thank you Raj!  I never would have found that; I was looking in the "Edit webhook" dialog.

Now working.  Incidentally, the third party I am using returns status code 201 ("CREATED") which is perfectly legitimate.  Marketo sees this as an error.  It probably shouldn't.  Anyway, the data get across so I can now start to see what I can make with this!


November 6, 2013
Richard,
We will fix the webhook infrastructure to treat all 2xx responses as success in a near future release.

Raj