Templates for Using a webhook to post leads to a partner | Community
Skip to main content
Conor_McCormick
Level 2
Jun 22, 2017 8:04 PM UTC
Solved

Templates for Using a webhook to post leads to a partner

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.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jun 22, 2017 8:22 PM UTC

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

8 replies

Colin_Campbel
Level 2
Aug 25, 2017 1:00 PM UTC

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

Translate
Conor_McCormick
Level 2
Aug 25, 2017 5:02 PM UTC

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.

Translate
SanfordWhiteman
Level 10
Aug 25, 2017 5:44 PM UTC

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.

Translate
SanfordWhiteman
Level 10
Jun 22, 2017 8:10 PM UTC

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}}

}

Translate
Conor_McCormick
Level 2
Jun 22, 2017 8:20 PM UTC

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}}

}

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jun 22, 2017 8:22 PM UTC

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

Translate