Error 400 via the leadCapture/save2

Highlighted

Error 400 via the leadCapture/save2

Hello,

I have a problem when I call my referral webhook. There is an error 400 with th leadCapture/save2. I have this message :

pastedImage_2.png

Do you have this problem?

Any ideas here?

Thanks

8 REPLIES 8
Highlighted
Level 10 - Community Moderator

Re: Error 400 via the leadCapture/save2

  formid

is all lower case.

Highlighted

Re: Error 400 via the leadCapture/save2

Thanks Sandford!

I tried in lower case and I've the same problem:

pastedImage_1.png

Here is my setting for the webhook:

pastedImage_2.png

Thanks

Highlighted
Level 10 - Community Moderator

Re:  Error 400 via the leadCapture/save2

Actually the whole approach is wrong, now that I'm more awake... /save2 is an x-www-form-urlencoded endpoint.

Highlighted
Marketo Employee

Re: Error 400 via the leadCapture/save2

I'd guess your {{my.referralFormID}} token is not resolving with a valid value.

Re: Error 400 via the leadCapture/save2

Thanks Sanford Whiteman‌, but actually what would be the right approach?

Thanks Steven Vanderberg‌. My referral form id works.

Highlighted
Level 10 - Community Moderator

Re:  Error 400 via the leadCapture/save2

Your POST should be a standard URL-encoded form payload. Not JSON. Just like the client library sends.

Highlighted

Re: Error 400 via the leadCapture/save2

Thanks Sanford Whiteman‌,

But I have already tested Request Token Encoding types and still doesn't work.

Highlighted
Level 10 - Community Moderator

Re:  Error 400 via the leadCapture/save2

It's not only about the encoding of individual fields.

The forms /save and /save2 endpoints accept form-like POST payloads (i.e. like a query string k=v&k2=v2&k3=v3). You're trying to send JSON. This is totally different.

Format your payload correctly and use Form/Url encoding.