29 Replies Latest reply on Oct 23, 2017 12:07 PM by Monica Koran

    HTTP Post

      I have a request from a third-party vendor to do a HTTP Post to Marketo. I've read through some of the past discussions, but I'm not clear on exactly what I need to provide to this vendor. I've put together a landing page/form for this project, but I'm not sure what we need to pull off of that for the vendor.

      Thanks
        • Re: HTTP Post
          Jep Castelein

               Hi Phil, here is an internal document that may be useful: 
               
               1.  Create a Form (If Needed)

          The first step is to create a form in Marketo or to use an existing form that you want to submit. The name of the form needs to be descriptive, but it does not actually need any form fields. If you create a new form, simply enter a name, uncheck the “Open form editor” box and you’re done.

               2. Find a Form ID

          In the Marketo UI, select the form and look at the URL: it should be of the format https://app-x.marketo.com/#FO8B2ZN12. Behind the # sign, look at the number immediately following “FO” to find the Form ID. In this case, the Form ID is 8. In some cases, your first form may be numbered 1001 and count up from there. The Form ID is a variable, so that you can trigger the submission of different forms.

               3. Get Your Marketo Account ID

          Go to Admin > Munchkin and copy the Munchkin Account ID, which has the format of 000-AAA-000:

          You’ll need this so that the form is submitted into the correct Marketo instance.

               4. Determine the POST URL

          When in the Marketo user interface, note the domain in the location bar, usually of the format http://app-x.marketo.com/. Discard anything after the slash, then append “index.php/leadCapture/save” to get the full form POST URL. Note 1: this is case sensitive. Note 2: Marketo Sandboxes may have a different domain than your Production Marketo system. So an example URL would be:
          http://app-x.marketo.com/index.php/leadCapture/save
          You can also use HTTPS instead of HTTP (do not use your CNAME as it will give a security exception).

               5. Find the Form Field Names

          Go to Admin > Field Management and click the “Export Field Names” button to download a spreadsheet with the API field names. Use the API name as the name in your name-value pairs.

               6. Decide Which Fields to POST

          You can include any Marketo Lead field in your form submission. Please note that field names are case sensitive. In addition to the fields you want to submit there are two mandatory fields and two recommended fields:

               Mandatory fields on the form:

          ·         munchkinId - enter your Munchkin Account ID as the value
          ·         formid - indicates which form in Marketo has been submitted

               Recommended fields on the form:

          ·         Email - this is used as the primary key for deduplication; if it finds a matching email address in the Marketo database, it will update the existing record, otherwise it will create a new record; if multiple matches, it will update the most recently updated record
          ·         _mkt_trk - this carries the cookie information, so you’ll be able to track the individual’s web page visits; if you have Munchkin on your form page, the Munchkin will automatically enter a value in this (hidden) form field. If no, read it from the cookie with the same name and pass it to Marketo in this field

               7. See the Response

          The response to the form post will be an HTTP 302 code (redirect), which in some systems will appear as an error, however, it means that the Lead is successfully created or updated. If there is a real error, you could receive a 404 or 50x error code. 
          2 of 3 people found this helpful
          • Re: HTTP Post
            That should be exactly what I need. Thanks

            Phil
            • Re: HTTP Post
              I'm getting a 404 error when I use this method to determine the POST url.  Is there any other place we should be posting this data?
              • Re: HTTP Post
                Jep Castelein
                If you get a 404, that usually means the munchkinId is not correctly specified. Please check spelling and case

                Hope that helps, 
                Jep
                • Re: HTTP Post
                  Thanks Jep, but the munchkinId is correct.  I'm sending it as part of the post data though, was it supposed to be appended to the URL as well?
                  • Re: HTTP Post
                    Jep Castelein
                    You may want to open a support ticket and specify the exact URL and all the parameters you're passing. If some of the required parameters are missing or incorrect it will give a 404. So a 404 error is not necessarily a sign that the URL is incorrect. 
                    • Re: HTTP Post
                      Add a few things--a correct submission return code we see is 200 and not 302. In addition, if passing multipe-value (from a multi-select picklist), do not pass a multiple key/value pairs, instead pass them as as a single key and the values as a semi-colon delimited list.

                      Things we learned the hard way
                      •           Make sure your firewall isn't blocking your posts (took a while for us to figure out in the test environment).
                      •           Firefox add-on called Poster is your testing friend
                      •           404 is always returned if there's anything wrong with the post
                      •           Fields are supposedly case sensitive
                      • Re: HTTP Post
                        Jep Castelein
                        Thanks for your feedback Mark! We'll update the article. 

                        Best, 
                        Jep
                        • Re: HTTP Post
                          Came by this post - great article Jep. Btw, now the form endpoints now use your CNAME subdomain instead of POST URL

                          • Re: HTTP Post
                            Edward Masson
                            Hi Jep,
                            This is a great article, learned quickly to set this up. I've manged to POST successfully with Email, formid, munchkinId.

                            What I'm not understanding is the '_mkt_trk'. above in the article you state "if you have Munchkin on your form page" does this mean to place my marketo form onto a marketo landing page for the Munchkin to work?
                            I thought by your article that I dont need a landing page just a blank form to POST to.

                            Also, "If no, read it from the cookie with the same name and pass it to Marketo in this field" How do I set up to read it from the cookie?

                            Best,
                            Ed.

                            • Re: HTTP Post
                              Jep Castelein
                              _mkt_trk is optional and allows you to "cookie" the lead. You can read the value of the cookie via JavaScript or server-side scripting languages. However, if you simply add the munchkin tracking code your page and make sure there is a hidden field _mkt_trk, the munchkin code will put the Cookie ID in this field dynamically. 
                              • Re: HTTP Post
                                Thanks for responding quickly Jep.

                                I'm a little confused when you mention 'form'. Marketo form or something else?

                                Our 3rd-Party profider is going to POST leads to our form which is not being used on a landing page. I can't find '_mkt_trk' in Field Management to use on my form to make hidden.

                                I added '_mkt_trk' to my HTTP test plug in for Google Chrome. All works well, lead got created with 'filled out form' activities.

                                As you can tell I'm new to playing with HTTP POST.


                                • Re: HTTP Post
                                  Jep Castelein
                                  Edward, your 3rd party provider will not have access to your tracking cookie, so you can't pass on the Cookie ID
                                  • Re: HTTP Post
                                    Jep, thank you so much for spelling that out. You should transform this into an official knowledge base article!
                                    • Re: HTTP Post
                                      Thanks Delinda, I've been trying that for 7 months, I will submit it again
                                      • Re: HTTP Post
                                        Kenneth Elkington
                                        Since this method has become quite a bit more popular, I just wanted to add a little extra information to the method that Jep provided.  There are three required parameters in the POST made to the Marketo Leadcapture URL.  These are case sensitive: 'formid' the ID of the form you want to appear in the activity log, 'returnLPId' should equal -1, and 'munchkinId' which is your Munchkin ID.
                                        • Re: HTTP Post
                                          Jep Castelein
                                          This article now has a permanent location here: 
                                          http://community.marketo.com/MarketoResource?id=kA650000000GsXXCA0 


                                          • Re: HTTP Post
                                            We've been successfully using this method to post leads into Marketo for about 1 year and we noticed over the last couple of weeks, that we've been receiving a HTTP 429 response ( Too Many Requests) after ~10 consecutive form posts from some of our external vendors.  Has something changed that would cause the server to timeout after multiple requests?  Maybe something in a recent release?  If there's a new timeout limit, how much time should we wait between posts?  Thanks, Brian.
                                            • Re: HTTP Post
                                              We are experiencing the same behavior (HTTP 429) when sending multiple posts in a row. Is there some kind of governor limits being put into place?
                                              • Re: HTTP Post
                                                Jep Castelein
                                                I'm checking to see whether anything has changed. I'll let you know as soon as I find out. Also feel free to open a support ticket. 
                                                • Re: HTTP Post
                                                  Thanks Jep.  I did open a support case yesterday and received this response. which helped explain the reason for the new HTTP response.

                                                  There has been enhanced security on that issue with the last release. 

                                                  A)What is the rate limit, in terms of the max no. of HTTP POST requests, per second? 
                                                  Answer: 10 requests / 60 sec. 

                                                  B)If a customer does go over(receive a 429) is there any back-off period we need to wait before attempting to resend? 

                                                  Answer: Yes, 60 sec after the last request. 


                                                  The above is on a per ip basis. In terms of suggestions to avoid this, you'd need to adhere to the above; or have you looked into using something like SOAP API to sync the leads? 

                                                  That would get around the security measures that were put in due to http posting (I believe if I remember correctly the changes were made to have adherence to newer EMEA based laws). 
                                                  • Re: HTTP Post
                                                    Jep Castelein
                                                    Yes, that's the same info that I got. So you either need a limiter or use the SOAP API or future REST API. 
                                                    • Re: HTTP Post
                                                      Jep Castelein
                                                      The limit has been increased to 30 form submissions per minute as of tonight. 
                                                      • Re: HTTP Post
                                                        I am very new to Marketo and server side requests to Marketo

                                                        I am trying to make POST leads to Marketo DB from 3rd party vendors side
                                                        I am passing to dataload  URL ('http://app-abj.marketo.com/index.php/leadCapture/save'),  munchkinId, formid, and only field I created in that form called 'Email'
                                                        As response, I get 200 and this page in it 'https://app-abj.marketo.com/homepage/login'
                                                        No lead is created. 
                                                        What am i missing?

                                                        Thanks!!

                                                        • Re: HTTP Post
                                                          It sounds like you're passing the minimum information you need.  Have you tried using http://www.hurl.it/ or similar tool to simulate an HTTP POST and confirm the request and response is correct.  This helps me confirm I've got all of my parameters and values correct before I start building it into my production process.
                                                          • Re: HTTP Post
                                                            Thanks Brian, it worked for me!
                                                            • Re: HTTP Post
                                                              Works great! I used this with a ShortStack webhook for one of our facebook contests.
                                                              • Re: HTTP Post

                                                                Anyone willing to share real life working examples (URLs) of the server side post in action? We might need to use this for a current project and I'm curious how others are implementing it.

                                                                 

                                                                Thanks!