Creating Your Own Webhook

This document covers some fundamental areas and provides sample code to help you create your own endpoint to receive a Lead Liaison webhook. In this guide we show you two parts:

  1. how to build a webhook call within Lead Liaison
  2. how to receive a webhook call (build an endpoint)

Building a Webhook Call within Lead Liaison

  • Go to Settings > App Setup > Webhooks > Add Webhook
  • In the Add New Webhook screen:
    • Add the name of the Webhook
    • Tag/Description: Optional
    • URL: This is the URL of your endpoint script. In this case, we'll use the test script: https://staging.leadliaison.com/test-scripts/webhook-sample.php
    • Select the Request Type (options are GET and POST). 
      • GET request type means the Webhook accepts the parameters concatenated in the URL, i.e: https://staging.leadliaison.com/test-scripts/webhook-sample.php?firstName=%%FirstName%%&lastName=%%LastName%%
      • POST request type means the Webhook accepts the parameters in the request body, so put your parameters in the "Template" field. The Template field accepts 2 formats:
        • FORM/URL: firstName=%%FirstName%%&lastName=%%LastName%%
        • JSON: it needs to be a valid JSON. i.e: {"first_name": "%%FirstName%%", "lastName" : "%%LastName%%"}
    • If you set the template as the FORM/URL format then you have to select 'FORM/URL' as the Request Token Encoding. 
    • If you set the template as the JSON format then you have to select 'JSON' as the Request Token Encoding.
    • You can specify how to receive the data from your Webhook. Lead Liaison supports JSON and XML.

Example

  • Our test Webhook URL is: https://staging.leadliaison.com/test-scripts/webhook-sample.php
  • This script returns the data you will specify in the Template field. i.e: first_name=%%FirstName%%&last_name=%%LastName%%&company=%%Company%%&email=%%Email%%
  • Testing this Webhook will return the firstname, lastname, company and email of the Prospect used in the test.

Here's how the Webhook is configured:

Top PortionBottom Portion