What are "Web Hook" lead notifications?

Every Lead Manager account has the option to communicate lead notifications with a web server whenever a new lead is received. These "Web Hooks" can be used to update external customer relationship management software (CRM), trigger custom notifications, or update an external database.

The payload

When a new lead is matched to your account, we'll POST to your URL with a payload of XML-formatted data about the lead and their request. Here is a sample payload:
<?xml version="1.0" encoding="utf-8"?>
  <Address>3462 Rivendell Drive</Address>
  <ServiceName>Install or Replace Asphalt Roof</ServiceName>
  <Notes>This is a test webhook notification.</Notes>
	<Detail question="Did you request a test webhook notification?">Yes</Detail>
This is sent as a POST with the Content-Type set to " application/xml".
  • The PhoneNumber field will contain the Speed-To-Call phone number if you are signed up to receive the Speed-To-Call Discount.  The DirectLeadPhoneNumber field will always contain the lead's actual phone number.  
  • The DiscountedPrice will only reflect promotions on your account, not our Speed-To-Call Discount because that discount can only be applied after the webhook is sent.


When you set up your webhook notification, you can send yourself a test from LeadManager.  If you do not receive anything, there is likely a problem with how your webhook endpoint is set up.  Postman is a very useful tool for troubleshooting these sorts of problems.  It can be obtained here for free:  https://www.getpostman.com/
All you need to do to send yourself a test in Postman after downloading it is create a new POST request, put your webhook url in the url field, and paste the above sample in the body of the request.  Ensure that it is being sent as " application/xml", and click "Send" when you want to receive the request:

Customizing the WebHook Payload

The webhook payload can be customized if you prefer not to accept the default xml payload.
To customize, choose your preferred content type and add your custom payload template. The lead fields will be inserted where you specify them using the {{fieldName}} syntax. Here is an example application/json template:
	"firstName": "{{FirstName}}",
	"lastName": "{{LastName}}",
	"address": "{{Address}}",
	"city": "{{City}}",
	"state": "{{State}}",
	"zip": "{{ZipCode}}",
	"phone": "{{PhoneNumber}}",
	"directPhone": "{{DirectLeadPhoneNumber}}",
	"email": "{{EmailAddress}}",
	"serviceID": {{ServiceId}},
	"craftjackLeadID": {{LeadId}},
	"created": "{{ReceivedOn}}",
	"serviceName": "{{ServiceName}}",
	"serviceCategory": "{{Service}}",
	"timeframe": "{{TimeFrame}}",
	"customerType": "{{CustomerType}}",
	"notes": "{{Notes}}",
	"additionalDetails": "{{AdditionalDetails}}",
	"price": {{OriginalPrice}},
	"discountedPrice": {{DiscountedPrice}},
	"trustedForm": "{{TrustedForm}}",
	"ipAddress": "{{IpAddress}}"

The resulting payload with fields inserted would look like:

	"firstName": "John",
	"lastName": "Doe",
	"address": "123 Test Street",
	"city": "Test City",
	"state": "IL",
	"zip": "00801",
	"phone": "(555) 555-5556 PIN: 0001",
	"directPhone": "5555555555",
	"email": "john.doe@test.com",
	"serviceID": 25,
	"craftjackLeadID": 111111,
	"created": "9/20/2017 12:00:00 AM +00:00",
	"serviceName": "Plumbing - Repair or Replace Faucets, Fixtures and Pipes",
	"serviceCategory": "Plumbing",
	"timeframe": "Within 2 weeks",
	"customerType": "Residential",
	"notes": "I am looking for someone to replace my faucets.",
	"additionalDetails": "Question: Is this an emergency? - Answer: No",
	"price": 25.0,
	"discountedPrice": 25.0,
	"trustedForm": "https://cert.trustedform.com/4eace04f",
	"ipAddress": ""

Fields Recognized In the Custom Payload

Field Insertion Syntax Description Type
FirstName {{FirstName}} The lead's first name string
LastName {{LastName}} The lead's last name string
{{Address}} The lead's street address string
{{City}} The lead's city string
{{State}} The lead's state abbreviation string
{{ZipCode}} The lead's zip code string
{{PhoneNumber}} The call tracking number for the lead, 
or direct phone number if call tracking is not enabled
{{DirectLeadPhoneNumber}} The direct phone number for the lead string
{{EmailAddress}} The lead's email address string
{{LeadId}} CraftJack's unique lead ID number
{{ServiceId}} CraftJacks lead service ID number
{{ServiceName}} Descriptive name of the service string
{{Service}} General service category string
{{TimeFrame}} Timeframe or urgency of the lead string
{{Notes}} Any custom notes the lead provided string
{{CustomerType}} Residential or Commercial string
{{ReceivedOn}} The timestamp when the lead was received string
{{AdditionalDetails}} Additional details about the lead string
The original price of the lead number
The price after any promotional discounts have been applied number
TrustedForm {{TrustedForm}} The URL supplied by trusted form for tracking this lead string
IpAddress {{IpAddress}} The IP Address that the lead was submitted from string
*Note, if you choose the content type of application/x-www-formurlencoded, all fields will be url encoded.

Still need help? Contact Us Contact Us