API Documentation

Appointments

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)
user User The user making the request.
User
email String Email
nameFirst String First Name
nameLast String Last Name
phoneNumber String Phone Number
licenseNumber String License Number
username String Leap Username
identifier String Identifier
objectId String Leap unique id (read-only)

JSON example:

{
 "startDate": "2018-07-10T00:00:00.000",
 "endDate": "2018-07-17T23:59:59.000",
 "user": {
   "email": "info@leaptodigital.com",
   "nameFirst": "John",
   "nameLast": "Demo",
   "phoneNumber": " 444-444-4444",
   "licenseNumber": "123456",
   "username": "admin1",
   "identifier": "",
   "objectId": "abcCDe1f2g",
   "officeName": "Test Office"
  }
}

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> LThe 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.

JSON example:

[
        [
           {
               "display": false,
               "type": "string",
                "value": "abc123",
               "appKey": "identifier"
           },
           {
               "title": "Date",
               "display": true,
               "type": "appDate",
               "value": "2018-07-10T12:30:00",
               "dateFormat": "yyyy-MM-dd'T'HH:mm:ss"
           },
           {
               "title": "Contact",
               "display": true,
               "type": "string",
               "value": "John Doe",
               "appKey": "name"
           },
           {
               "title": "Street",
               "display": true,
               "type": "string",
               "value": "123 Main Street",
               "appKey": "addressStreet"
           },
           {
               "title": "City",
               "display": true,
               "type": "string",
               "value": "Baltimore",
               "appKey": "addressCity"
           },
           {
               "title": "State",
               "display": true,
               "type": "string",
               "value": "MD",
               "appKey": "addressState"
           },
           {
               "title": "Zip Code",
               "display": true,
               "type": "string",
               "value": "21122",
               "appKey": "addressZip"
           },
           {
               "title": "Notes",
               "display": true,
               "type": "string",
               "value": "Interested in Roofing and Windows"
           },
           {
               "display": false,
               "type": "string",
               "value": "443-555-5555",
               "appKey": "phone"
           },
           {
               "display": false,
               "type": "string",
               "value": "443-444-5555",
               "appKey": "phone"
           },
           {
               "display": false,
               "type": "string",
               "value": "info@leaptodigital.com",
               "appKey": "email"
           },
           {
               "display": false,
                "appKey": "apiSourceData",
               "value": {
                   "leadSource": "Trade Show",
                   "opportunityId": "as6d5f4a5s1f56",
                   "contactId": "e5wrt46w5189e4",
                   "marketId": "wrh51w6fd51fg6"
               }
           },
 
       ],
        [
           {
               "display": false,
               "type": "string",
               "value": "xyz789",
               "appKey": "identifier"
           },
           {
               "title": "Date",
               "display": true,
               "type": "appDate",
               "value": "2018-07-11T16:30:00",
               "dateFormat": "yyyy-MM-dd'T'HH:mm:ss"
           },
           {
               "title": "Contact",
               "display": true,
               "type": "string",
               "value": "Bob Smith",
               "appKey": "name"
           },
           {
               "title": "Street",
               "display": true,
               "type": "string",
               "value": "789 Marahall Ave",
               "appKey": "addressStreet"
           },
           {
               "title": "City",
               "display": true,
               "type": "string",
               "value": "Baltimore",
               "appKey": "addressCity"
            },
           {
               "title": "State",
               "display": true,
               "type": "string",
               "value": "MD",
               "appKey": "addressState"
           },
           {
               "title": "Zip Code",
               "display": true,
               "type": "string",
               "value": "21045",
               "appKey": "addressZip"
           },
           {
               "title": "Notes",
               "display": true,
               "type": "string",
               "value": "Roof replacement"
           },
           {
               "display": false,
               "type": "string",
               "value": "410-768-1688",
               "appKey": "phone"
           },
           {
               "display": false,
               "type": "string",
               "value": "410-654-3210",
               "appKey": "phone"
           },
           {
               "display": false,
               "type": "string",
               "value": "info@leaptodigital.com",
               "appKey": "email"
           },
           {
               "display": false,
                "appKey": "apiSourceData",
               "value": {
                    "leadSource": "Internet",
                   "opportunityId": "s6dry51s6dfg1",
                   "contactId": "gr5k5f4g2ds1a84",
                   "marketId": "wer54ysd51g56sd4fg5"
               }
           }
        ]
    ]

Authenticate

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.

Endpoint: https://api.leaptodigital.com/authenticate

Type: POST
Request:
username String Required Leap username
password String Required Leap password
apiKey String Required The API key generated from App Settings > API Access section of the Leap dashboard

JSON example:

{
 "username": "leapuser",
 "password": "abc123",
  "apiKey": "xyz789abc456QRS123HIJ567"
}
Response:
token String The token you should use for all other API requests. Use this returned value in the authorization header for subsequent requests.
created Date The date the token was created
expires Date The date the token will expire

JSON example:

{
   "token": "r:9ae18f72a65f5933r278e06dff68201g",
   "created": "2018-04-09T00:24:08.461Z",
   "expires": "2019-04-09T00:24:08.460Z"
}

Price Guide

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.

Endpoint: https://api.leaptodigital.com/priceguide

Type: POST
Headers:
authorization String Required key returned from authorization endpoint
Request:
limit Integer Optional The number of results to return (Default 100)
skip Integer Optional The number of results to skip (Default 0)

JSON example:

{
  "limit":  100,
  "skip":  10
}
Response:
offices Array<Office> The offices associated with a given company.
priceGuide Array<MeasureSheetItem> The Measure Sheet Item objects

JSON example:

{
 "offices": [
    {
     "id": "j37asii8Ta",
     "name": "Maryland"
    },
    {
     "id": "mVsI7Hn4hA",
     "name": "Virginia"
    }
  ],
 "priceGuide": [
    {
     "order": 1,
     "category": "Windows",
     "subCategory": "Picture Window",
     "name": "112-120 UI",
     "note": "[W 12-112] [H 12-96] [MAX UI 208]",
     "measureType": "Each",
     "thumbnail": "http://0.0.0.0:1337/leap/files/vsJUoMTVBxWim04bhb92eEHYlC7CF5TGGeV5zeTL/ed0dcb85501794775ca147513217087a_592c42064da9f.png",
     "offices": [
       "j37asii8Ta",
       "mVsI7Hn4hA"
      ],
     "options": [
        {
         "id": "oCHYuIGHB7",
         "brand": "Leap",
         "name": "1000 Series",
         "prices": [
           {
             "officeId": "j37asii8Ta",
             "total": 787.19
           },
           {
             "officeId": "mVsI7Hn4hA",
              "total": 670
           }
         ],
         "upCharges": [
           {
             "id": "TVCMYfCxq7",
             "name": "Colonial Countoured Grids",
             "note": "Up to 101 UI",
             "measurementType": "Each",
             "percentOfParent": false,
             "totals": [
               {
                  "officeId": "j37asii8Ta",
                  "total": 40
               },
               {
                  "officeId": "mVsI7Hn4hA",
                 "total": 40
               }
             ]
           },
           {
             "id": "i80tYLxyNY",
             "name": "Beige",
             "note": "[W 14-52] [H 20-96] [MAX UI 148]",
             "measurementType": "Each",
             "percentOfParent": true,
             "totals": [
               {
                  "officeId": "j37asii8Ta",
                  "total": 0.1
               },
               {
                  "officeId": "mVsI7Hn4hA",
                  "total": 0.1
                }
             ]
           }
         ]
       },
        {
         "id": "EJJlG2oMYK",
         "brand": "Leap",
         "name": "2000 Series",
         "prices": [
           {
             "officeId": "j37asii8Ta",
             "total": 902.95
           },
           {
             "officeId": "mVsI7Hn4hA",
             "total": 770
           }
         ]
         "additionalDetails": [
               {
                    "id": "1",
                    "title": "Size"
               },
               {
                    "id": "3",
                    "title": "Additional Details"
               },
               {
                    "id": "4",
                    "title": "Images"
               }
           ],
         "upCharges": [
           {
             "id": "TVCMYfCxq7",
             "name": "Colonial Countoured Grids",
             "note": "Up to 101 UI",
             "measurementType": "Each",
             "percentOfParent": false,
             "totals": [
               {
                  "officeId": "j37asii8Ta",
                  "total": 40
               },
               {
                  "officeId": "mVsI7Hn4hA",
                  "total": 40
               }
              ]
           },
           {
             "id": "i80tYLxyNY",
             "name": "Beige",
             "note": "[W 14-52] [H 20-96] [MAX UI 148]",
             "measurementType": "Each",
             "percentOfParent": true,
             "totals": [
               {
                  "officeId": "j37asii8Ta",
                  "total": 0.1
               },
               {
                  "officeId": "mVsI7Hn4hA",
                  "total": 0.1
               }
              ]
           }
         ]
        }
      ]
    }
  ]
}
Office
id String The unique identifier for the Office
name String The name of the Office
MeasureSheetItem
id String The unique identifier of the Measure Sheet Item
order Integer 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”)
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.

{
 "trigger": "results",
 "user": {
   "id": "ot5eQk489C",
   "firstName": "🥇Steve",
   "lastName": "Demo",
   "email": "info@leaptodigital.com",
    "phoneNumber": " 444-444-4444",
   "licenseNumber": "123456",
   "office": {
     "id": "Q07lZVju8i",
     "name": "Maryland"
    }
  },
 "customer": {
   "id": "012KCTaqmH",
   "apiSourceData": {},
   "firstName": "Jerry",
   "lastName": "Jones",
   "street": "587 Main St",
   "city": "Mason City",
   "state": "IA",
   "zipCode": "50401",
   "phoneNumbers": [
      {
       "number": "(465)465-4646",
       "note": ""
      }
    ],
   "emails": [
      {
       "email": "stevestencil@leaptodigital.com",
       "note": ""
      }
    ]
  },
 "estimate": {
   "id": "CkEze1iC1Q",
   "isSale": true,
   "saleAmount": 40000,
   "resultNote": "User - 🥇Steve Demo\nOffice - Maryland\nLead Result - Demo / Sold\nPayment - Finance Approved\nTotal Sale Amount - $40,000.00\nTotal Par - $38,825.32\nFinance Option - [3188] 18 Month No Interest No Pay \nCommission Estimate - $2,952.00\nNotes - This is a demo",
   "addedCategories": [
     "Windows",
     "Roofing"
    ],
   "addedItems": [
      {
       "category": "Windows",
       "quantity": 2,
       "tag": "Living Room",
       "isActive": true,
       "measureSheetItemId": "fcoT8lbT8H",
       "priceGuideOptionId": "XCd1qpT3rU",
       "additionalDetails": {
         "1": "33 5/8 x 33 1/2",
         "3": "Replace rotted window sill",
         "4": [
           {
             "imageTag": "Living Room 1.1",
             "imageAssetIdentifier": "AFDE43AD-C08B-413C-82A7-B62F2F247A0C/L0/001"
           }
         ]
        },
       "addedUpCharges": [
         {
           "quantity": 1,
           "id": "TVCMYfCxq7",
           "additionalDetails": {
             "1": "",
             "2": "White"
           }
         },
         {
           "quantity": 1,
           "id": "i80tYLxyNY",
           "additionalDetails": {
             "1": "",
             "3": ""
           }
         }
        ]
      },
      {
       "category": "Windows",
       "quantity": 5,
       "tag": "Sunroom",
       "isActive": true,
       "measureSheetItemId": "fcoT8lbT8H",
       "priceGuideOptionId": "XCd1qpT3rU",
       "additionalDetails": {
         "1": "35 3/4 x 32 3/4",
         "3": "",
         "4": [
           {
             "imageTag": "Sunroom 1.1",
             "imageAssetIdentifier": "174937EE-2B1A-4750-B792-E6DA0DC90D48/L0/001"
           },
           {
             "imageTag": "Sunroom 1.2",
             "imageAssetIdentifier": "FF872BAE-4B7E-447E-82E5-B135E547288B/L0/001"
           }
         ]
       },
       "addedUpCharges": [
         {
           "quantity": 1,
           "id": "TVCMYfCxq7",
           "additionalDetails": {
             "1": "",
             "2": "White"
           }
         },
         {
           "quantity": 1,
           "id": "i80tYLxyNY",
           "additionalDetails": {
             "1": "",
             "3": ""
           }
         }
        ]
      },
      {
       "category": "Roofing",
       "quantity": 250,
       "tag": "",
       "isActive": true,
       "measureSheetItemId": "9RDFyMDW9g",
       "priceGuideOptionId": "qmM6NYS8Nq",
       "additionalDetails": {
         "dXAjpwflXW": ""
       },
       "addedUpCharges": []
      },
      {
       "category": "Roofing",
       "quantity": 250,
       "tag": "",
       "isActive": true,
       "measureSheetItemId": "NLG5cODhhh",
       "priceGuideOptionId": "6Om7C5yMIT",
       "additionalDetails": {},
       "addedUpCharges": []
      }
    ],
   "office": {
     "id": "mVxyj5OdiA",
     "name": "Missouri - MS"
    }
  }
}