Is it possible to POST form submission to Marketo endpoint directly from HTML form without loading Marketo's forms2.min.js? | Adobe Higher Education
Skip to main content
Doug_Flowers
Level 2
May 29, 2019
Répondu

Is it possible to POST form submission to Marketo endpoint directly from HTML form without loading Marketo's forms2.min.js?

I have seen a few old threads suggesting this endpoint still exists but the only method of lead creation that Marketo seems to support in the docs is using the javascript library.  We have a version of that working if we have to, but we are hoping that it is still possible to simply post directly to a Marketo endpoint from the HTML form without loading Marketo's javascript library. Does such an endpoint still exist?

An older thread led me to believe that a path like: {our-instance}.marketo.com/index.php/leadCapture/save2&formid={our-form-id}&munchkinId={our-munchkin-id}  would be the endpoint we are looking for, but when we try to post a form submission to this endpoint from a form on our site, the request fails and we get this error in console:

"Mixed Content: The page was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Open+Sans:300'. This request has been blocked; the content must be served over HTTPS."

That leads me to believe we are either hitting the wrong endpoint or not properly authenticated to make this request. But is there a way to do so that doesn't involve loading the javascript? For the record as far as the post-submission redirect page goes, we are using our own hosted on our site and it does not use this font. 

 

Thanks in advance to any insight!

Meilleure réponse par SanfordWhiteman

Not /save2, /save. You will not be able to make use of the /save2 endpoint outside of the Forms 2.0 JS library.

Search my many old posts on the legacy (scriptless) /save endpoint.

1 commentaire

SanfordWhiteman
Level 10
May 29, 2019

Not /save2, /save. You will not be able to make use of the /save2 endpoint outside of the Forms 2.0 JS library.

Search my many old posts on the legacy (scriptless) /save endpoint.

Doug_Flowers
Level 2
May 29, 2019

Sanford, thank you for the quick reply!  

I just had a chance to tinker with that.  I am still getting the same 404 error about mixed content, request blocked. Any familiarity with that particular error in this context?   Pretty straightforward what I'm doing with the form but just for reference, this is how I have my form set up:

<form action="https://app-ourPodId.marketo.com/index.php/leadCapture/save&formid=XXX&munchkinId=XXX-XXX-XXX" method="post" role="form" class="form-with-phone" >

// fields here

</form>

Anything noticeable off there? Same issue whether I send to save or save2.  I read some of your previous posts explaining the benefits of the forms 2.0 api and using the js library but would like to have this scriptless option if at all possible. Reading your posts, it does sound like it is! But I can't quite figure out what we're doing wrong here and what this error is telling us.  No issues 301 redirecting to our page using the 2.0 api and forms library for the record, so I don't think it's actually an issue with content on that page. (It also doesn't use the font referenced in the error, further confirming this.)

Thank you again for taking the time to assist this!

SanfordWhiteman
Level 10
May 29, 2019

You don't want the query string in the action.

<form action="https://example.com" method="post">
<input type="hidden" name="munchkinId" value="123-aaa-456">
<input type="hidden" name="formid" value="666">
<!-- etc. -->
</form>