You can configure Leap to fetch appointments via a webhook. When configured this way the Leap app will send a POST request to a URL you specify when a user opens the calendar view inside of the app. To enable this functionality navigate to App Settings > Appointments and select Webhook from the API drop down. You can then specify a URL and Auth Header that will be used for the POST request. Leap will send the following parameters in the body of the request.
Type: POST
Request
startDate
Date
Selected start date from app (yyyy-MM-dd’T’HH:mm:ss)
endDate
Date
Selected end date from app (yyyy-MM-dd’T’HH:mm:ss)
The above response should send an array of appointments that should be displayed in the Leap app. The appointments will consist of arrays of objects that map to fields inside of Leap. The objects should be structured as follows:
Appointment Item
title
String
The title of this field as it should appear in the app
display
Boolean
Determines if this value should be displayed in the app
type
String<Type>
The data type of value being sent
value
any
The value being sent
dateFormat
String
The date format of the value (if type = date)
appKey
String<App Key>
The field the value will be mapped to inside of Leap
Type
string
number
appDate
When mapping the date/time of an appointment, use this key
date
Always specify a dateFormat value so Leap can parse this date string
App Key
email
Maps to an email address inside of Leap
name
Maps to the name fields (first name is mapped to first word, remaining text will map to the last name field)
addressStreet
Maps to the street address
addressCity
Maps to the city
addressState
Maps to the state
addressZip
Maps to the zip code
notes
Maps to the notes field
searchEstimates
Creates a search button that will allow users to search if other estimates exist based on the identifier below
identifier
A unique identifier for the appointment
apiSourceData
Any JSON data type that will be saved with the created estimate. This data will be returned when using other webhooks to receive contracts, proposals, results, etc.
All API calls will require a session token to be passed in the authorization header. You can generate a session token by first calling the authenticate endpoint.
Downloading and storing the price guide is necessary in order to make sense of the data sent via the webhooks. Every item in the price guide contains an ID that will be referenced in the webhook data. Storing the price guide is necessary so that you can match the ID’s added in each estimate (returned from the webhook) with the IDs in the price guide.
Order number of the price guide object. Note: The order is descending
category
String
The category of the Measure Sheet Item
subCategory
String
The sub category of the Measure Sheet Item
name
String
The name of the Measure Sheet Item
note
String
The note of the Measure Sheet Item
measureType
String
The measure type of the Measure Sheet Item
thumbnail
String
URL to the thumbnail image
offices
Array<String>
The offices this Measure Sheet Item is assigned to
options
Array<PriceGuideOption>
The Price Guide Options
additionalDetails
Array<AdditionalDetail>
The additional details
AdditionalDetail
id
String
The unique identifier
title
String
The title of the Additional detail that appears to the user in the app
PriceGuideOption
id
String
The unique identifier of the Price Guide Option
brand
String
The brand name of the Price Guide Option
name
String
The name of the Price Guide Option
prices
Array<PriceObject>
The prices for each office
upCharges
Array<UpCharge>
The upcharges associated with the Price Guide Option
UpCharge
id
String
The unique identifier of the Upcharge
name
String
The name of the Upcharge
note
String
The note associated with the Upcharge
measureType
String
The Measurement Type of the Upcharge
percentOfParent
Boolean
Indicates weather this Upcharge should be calculated as a percentage of its parent PriceGuideOption. If true, you must multiply the “total” of the Upcharge by the “total” of the parent Price Guide Option’s “total” to get the actual price.
totals
Array<PriceObject>
The prices for each office
PriceObject
officeId
String
The id of the Office the price is for
total
Float
The price of the Price Guide Option
Webhooks
You can set Leap to send a webhook to a specific URL through the Leap admin dashboard. Webhooks can be triggered when a Contract, Proposal, Contract Verification, Proposal Verification, Credit App, Results, or Measurement Report are sent. The following data will be included in the body of the webhook POST.
Parameters
trigger
String
This string will tell you which action caused the trigger. Options include contract, proposal, contract_verify, proposal_verify, credit_app, results.
user
User
The user that triggered the webhook
customer
Customer
The customer that the user triggered the webhook for
estimate
Estimate
The estimate that was resulted. Note: This parameter is only sent when a lead is resulted (the trigger will be “results”)
fileURL
String
The url to the PDF file created within the app
fileData
String
The base64 data of the PDF file created within the app. Note: This field will only be included if “Include PDF” is turned on in App Settings
User
id
String
The unique identifier for the user
firstName
String
The name of the user
lastName
String
email
String
The email address of the user
phoneNumber
String
The phone number of the user
licenseNumber
String
The license number of the user
office
Office
The office the user is currently logged into
Customer
Id
String
The unique identifier of the customer
apiSourceData
apiSourceData
The data downloaded from the API Source. This value will be null if the customer was created manually.
firstName
String
The customer’s name
lastName
String
street
String
The customer’s address
city
String
state
String
zipCode
String
phoneNumbers
Array<PhoneNumber>
The customer’s phone numbers
emails
Array<Email>
The customer’s email addresses
APISourceData
apiSource
String
The source of the data used to create the customer. Options include Marketsharp, Salesforce, LeadPerfection, and JobNimbus
data
???
The JSON data that is returned from the apiSource that Leap used to create the customer
PhoneNumber
number
String
The Phone number for the customer
note
???
A note added to the phone number
Email
email
String
The email for the customer
note
???
A note added to the email
Estimate
id
String
The unique identifier for the estimate
isSale
Boolean
Determines if the estimate was resulted as a Sale or No-Sale
saleAmount
Float
The amount entered in the “Total Sale Amount” result field
resultNote
String
All Sale/No-Sale results combined in one paragraph
addedCategories
Array<String>
The unique categories of all added items to the estimate
activeCategories
Array<String>
The categories that are marked as active in the estimate. Note: All values will be lowercased.
addedItems
Array<AddedItem>
The added items that make up the estimate
office
OfficeObject
The office the user was logged into when they created the estimate.
AddedItem
category
String
The category of the added item
quantity
Float
The quantity of the added item
tag
String
The value the user entered for the “Tag”
isActive
boolean
Determines if the user had the item active or not
measureSheetItemId
String
The id of the Measure Sheet Item
priceGuideOptionId
String
The id of the selected Price Guide Option
additionalDetails
EnteredAdditionalDetail
The values entered for additional detail fields
addedUpCharges
Array<AddedUpCharge>
The Upcharges that were added with this item
AddedUpCharge
upChargeId
String
The id of the Upcharge
quantity
Float
The quantity of the added Upcharge
additionalDetails
EnteredAdditionalDetail
The values entered for additional detail fields
EnteredAdditionalDetail
This object is created with keys from the id of the AdditionalDetail object from the Measure Sheet or Upcharge Item. The value for that key is a String value that is entered by the user in the app. If no value was entered by the user, no key or value will be present. Note: if the Additional Detail item is a Photo Selector, the value will be an array of objects with 2 keys (imageTag and imageAssetIdentifier). These values are device specific and point to an image that is stored on the device it was created with. There is no way to retrieve these images.