How to submit custom form data using REST API

Vipin_Mp
Level 2

How to submit custom form data using REST API

Can anyone have a suggestion to submit custom form data using REST API to the Marketo form fields ?

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: How to submit custom form data using REST API

Please be more specific about why you're not using the Forms 2.0 JS API (on the client side) to submit form data to Marketo. This is by far the recommended approach to enable scale and functionality without opening a DoS vulnerability.

Avtar_Singh1
Level 2

Re: How to submit custom form data using REST API

Hi Vipin, You can use Marketo Lead's REST API endpoints to create leads in the Marketo. Following are the endpoints: http://developers.marketo.com/rest-api/lead-database/leads/#create_and_update First, you need to get authentication using method mentioned here ( http://developers.marketo.com/rest-api/lead-database/leads/#create_and_update ) then you can get custom form data and post that data on the endpoints mentioned above. Best Regards, Avtar Singh

SanfordWhiteman
Level 10 - Community Moderator

Re: How to submit custom form data using REST API

That endpoint really doesn't have anything to do with "form data," though.  You can't use the /lead.json endpoint alone for form data: you always need to hit either /lead.json and Associate Lead, or /push.json and Associate Lead.

You therefore must use 2 API calls for something that still falls short -- far short -- of the features of a real Filled Out Form activity within Marketo. So we discourage this approach in a professional environment. You shouldn't be using the REST API to process individual end-user form posts because you open a DoS vulnerability (an amateur can easily consume all your API calls in a half-hour if you expose them this way) and gain nothing in return.   Rather, you should be using the Forms 2.0 JS API on the client side to submit forms, and it can be integrated with any bespoke form.

Vipin_Mp
Level 2

Re: How to submit custom form data using REST API

Thanks for your suggestion.. San..

majestic_aprico
Level 1

Re: How to submit custom form data using REST API

I have the same problem.

Feeling like Marketo is very limited.

1. There is no client NPM library that integrates with modern JS Frameworks

2. The client library that sideloads with script tag is missing a lot. E.g. I would want access to field descriptors and submitting form fields manually. Having NPM library would enable us to do SSR form rendering with our custom design system.