Re: Webhook to Create a new Salesforce Lead.

SanfordWhiteman
Level 10 - Community Moderator

Re: Webhook to Create a new Salesforce Lead.

Can you link to your Web2Lead form? You can PM it to me in this case if you want to keep the URL private.
Jep_Castelein2
Level 10

Re: Webhook to Create a new Salesforce Lead.

The easiest way to do this without "coding" is to create the new "referred" Lead in Marketo, then sync it to SFDC. Submit the form to Marketo as seen above. The referred Lead's data is stored in the custom Fields. Now you have to use a Webhook in a creative way: use it to submit a Form on your own Marketo instance to create the new Lead. To do so, you need to pass in the "referred" email address in the normal Marketo email field, that will cause a new Lead to be created.

Details:

  • URL: http://localhost/index.php/leadCapture/save
  • Payload template: munchkinId=AAA-000-BBB&formid=000&Email={{lead.Referral Email Address}}&FirstName={{lead.Referral First Name}} etc.
    • Make sure to put in your own munchkinId, create a new Form and put in the right formid (look at the URL to find the ID)
  • Request Type: POST
  • Request Token Encoding: Form/Url
  • Response Type: none

Also make sure that you add a field that indicates the source of this Lead. You need to trigger a Smart Campaign that then syncs this new Lead to SFDC. If you want, you can also push in an SFDC Campaign ID or other information that you want to push to SFDC for this new Lead.

Nate_Oosterhous
Level 7

Re: Webhook to Create a new Salesforce Lead.

Thanks Jep!  I have it all working except one more thing I am trying to figure out.  In the webhook I am trying to set the Referral's lead owner the same as the Referrer's lead owner.  Is there anyway to accomplish this?  I have been trying multiple ways to get this to work but it hasn't been working.

Grégoire_Miche2
Level 10

Re: Webhook to Create a new Salesforce Lead.

Hi Jep Castelein​,

Is there anything to do to have this http://localhost/index.php.leadCapture/save to work ? What service is providing this URL?

-Greg

Jep_Castelein2
Level 10

Re: Webhook to Create a new Salesforce Lead.

your URL has a typo, it should be localhost with an 'o' instead of an 'a'. It should just work and - by definition- it points to the Marketo instance itself. I do want to mention that our support team considers this a "non supported use of Marketo", so you may not get support from them in implementing this method.

Grégoire_Miche2
Level 10

Re: Webhook to Create a new Salesforce Lead.

Hi Jep,

Thx for noting the typo. Fixed.

-Greg

Benjamin_Ortiz1
Level 4

Re: Webhook to Create a new Salesforce Lead.

Hi Jep,

I'm getting 'Failed. Server Returned code 307' Any idea what this error means? Thanks!

Kenny_Elkington
Marketo Employee

Re: Webhook to Create a new Salesforce Lead.

I would use this method instead: How to Use Marketo Forms to Register Multiple Event Attendees​ The server-side form post method isn't supported and is extremely error-prone.