Form submission using POST menthod

Amit_Jain
Level 8 - Community Advisor

Is it possible to hit an form endpoint to submit the form? I was trying to do that using following URL:

https://xxxx.marketo.com/index.php/leadCapture/save2?formid=1234&munchkinId=xxx-xxx-xxx

but I'm getting error that form is not found? I also checked the documentation and found that it's not allowed to server side positing the data to a form.

pastedImage_1.png

Is there any other way to achieve this?

We are trying to integrate ManyChat.com with marketo and there is an option to post the data to en external system directly like a Marketo webhook. I can use the /lead REST API to creaeteOrUpdate but there will be an issue with the token since it's work just like Marketo webhook.

Thanks in advance for your input on this.

Regards,
Amit

37 REPLIES 37
SanfordWhiteman
Level 10 - Community Moderator

You can POST to /save (not /save2).

Use the case-sensitive core fields:

   munchkinId
   formid
   retURL (Thank You URL)
   _mkt_trk (Munchkin cookie)
_mktoReferrer (URL of the page w/form)‍‍‍‍‍

/save is the same endpoint used by <noscript> form posts from Marketo LPs, so it's not really exotic in any way. While you can't open a Support case about it (like other advanced and/or experimental tactics) it's a reliable part of the Marketo ecosystem, up to its rate limit (30 form posts per second minute per IP).

Jep_Castelein2
Level 10

Small correction: "30 form posts per minute per IP", not per second

SanfordWhiteman
Level 10 - Community Moderator

Sorry, yeah, meant that. Fixed.

Amit_Jain
Level 8 - Community Advisor

Thanks Sanford. I tried but it didn't work either in my case.

SanfordWhiteman
Level 10 - Community Moderator

Without seeing your code I can't tell you what's wrong. But it's a basic URL-encoded form POST.

Amit_Jain
Level 8 - Community Advisor

I understand that but there is no code involved here. I have an option on UI in ManyChat like we do in Postman to just select "GET" OR "POST" method and put the endpoint URL. Pretty similar to Marketo's webhook UI.

SanfordWhiteman
Level 10 - Community Moderator

So if you put a test URL (i.e. your testing server) what is it POSTing?

Set the server to https://2f6eb214.ngrok.io/  temporarily and then run a couple of tests, I'll tell you what it's sending.

Amit_Jain
Level 8 - Community Advisor

Thank you Sanford Whiteman‌! But it's working fine now at my end. I'm using following URL:

https://xxx.marketo.com/index.php/leadCapture/save2?formid=36496&formVid=36496&munchkinId=xxx-xxx-xxx&FirstName=Amit&LastName=Jain&Email=amitjain@ntest.com
SanfordWhiteman
Level 10 - Community Moderator

And in addition, I can see that it isn't URL-encoding, which is bad.

Amit_Jain
Level 8 - Community Advisor

I'm not sure how can I encode the URL here from the UI (see above screenshot). If you have any thoughts on that, please let me know. I'm just trying to see if it's possible to integrate ManyChat with marketo directly but if you think this is not going to work like this, I have Zapier subscription and can use that to pass the data from ManyChat to Marketo.

Thanks again for your help on this.

Best,

Amit

SanfordWhiteman
Level 10 - Community Moderator

That's a GET, not a POST (like Jay said).

Please send a POST to my test endpoint, I'll tell you what it was actually sending.

SanfordWhiteman
Level 10 - Community Moderator

OK, I stopped my test server for now as you seem to be busy. But you need to make sure you're using POST. GET support could be discontinued at any time; there's no supported Marketo feature that uses it.

Amit_Jain
Level 8 - Community Advisor

Sorry for delayed response Sanford Whiteman‌.

Please see below screenshot from ManyChat. If you can turn on the server again, that would be really helpful.

pastedImage_1.png

Amit_Jain
Level 8 - Community Advisor

Hi Sanford Whiteman‌, please let me know when you will be available to take a look on this? I'll be online the same time.

Regards,

Amit

Amit_Jain
Level 8 - Community Advisor

I got it now. Sorry I just started learning the API stuff. So I'm using this now:

Endpoint URL with POST method:

https://app-sxxx.marketo.com/index.php/leadCapture/save2?formVid=36496&munchkinId=xxx-xxx-xxx

Body:

{
   "FirstName ":"First Name",
   "LastName ":"Last Name",
   "Email ":"Email Address",
   "Dummy_Text_Area_1 ":"Preferred Meeting time",
   "cellPhoneNumber ":"Phone"
}

Is this looks OK now? Please let me know. Sanford WhitemanJay Jiang

Edited: When I'm trying this, its making the call in Marketo but it's creating a lead record without any data in it.

pastedImage_1.png

But if I pass these in URL parameter instead of Body, it creates lead record with all the details.

Jay_Jiang
Level 10

a serialized POST payload is formatted exactly the same as a query string:

param1=value1&param2=value2&paramN=valueN

You're trying to send an object and marketo doesn't recognize it.

I'm actually confused what you're trying to do/achieve.

Amit_Jain
Level 8 - Community Advisor

Sanford Whiteman‌ probably you can help me out here.