Templates for Using a webhook to post leads to a partner | Community
Skip to main content
Conor_McCormick
Level 2
June 22, 2017
Solved

Templates for Using a webhook to post leads to a partner

  • June 22, 2017
  • 2 replies
  • 8556 views

Hi All,

Is there any good documentation or templates for using Marketo webhooks to post leads to a partner's url? We want to take leads as they are incoming to our Marketo instance and then pass them along to a partner via HTTP Post. I can find ample documentation on GET in the Marketo documentation, but nothing on POST. Really just looking to get the standard contact fields over to the partner. The partner has requested the data to be sent in JSON format. Everything I've tried so far as returned a system error in the response.

Any templates or guides that anyone has for what to put in the payload template would be awesome.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Don't quote your tokens. By using JSON request encoding the tokens are already quoted.

2 replies

SanfordWhiteman
Level 10
June 22, 2017

This isn't something that can be concretely answered on the Marketo side. Every remote endpoint can require a different schema to represent a lead. The more info you provide here, including ​what you've tried, the more we'll be able to help.

If it's JSON they want, you'll set your request encoding to JSON (and should also add a custom header Content-Type: application/json) and then create a valid JSON object. Roughly like so, but I have no idea what their fields are:

{

  "First Name" : {{Lead.First Name}},

  "Last Name" : {{Lead.Last Name}},

  "Email" : {{Lead.Email Address}}

}

Conor_McCormick
Level 2
June 22, 2017

This is one of my attempts - I did not have the custom header set though:

{

"LeadID": "{{lead.SFDC Id:default=No SFDC ID}}",

"FirstName": "{{lead.First Name:default=Not Entered}}",
"Last Name": "{{lead.Last Name:default=Not Entered}}",

"Email": "{{lead.Email Address:default=Not Entered}}",

"State": "{{company.State:default=Not Entered}}",

"PrimaryPhone": {{lead.Phone Number:default=Not Entered}}

}

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
June 22, 2017

Don't quote your tokens. By using JSON request encoding the tokens are already quoted.

Colin_Campbel
Level 2
August 25, 2017

Hi Conor, would you be able to share that documentation you found for the GET webhook to provide leads to a partner?

Conor_McCormick
Level 2
August 25, 2017

This is a good starting point for webhooks. If you are providing leads to the partner, you'd use a POST webhook to send info. For the partner to send information back to you, they'll need token access to the REST API.​ For technical info on updating the leads via the API calls see here.

SanfordWhiteman
Level 10
August 25, 2017

Using a webhook to both post lead data and update to lead fields (webhooks do both) is preferable to using the REST API lead-by-lead.