Getting Started
The below documentation illustrates how to use the LeadExec query API
Note: For account API, please visit the Account API for documentation.
Request
Parameter | Type | Position | Required | Description |
---|---|---|---|---|
access_token | string |
header |
required |
Authentication token (See Authentication) |
LeadTypeUID | integer |
url_segment |
required |
The identifier of the lead type to query against. |
Query | object |
body |
optional | Filter query to apply to your search. For information on how to format your query, please contact support. Example request shows how to query for a loan amount greater or equal to 150000 |
SortFields | array |
body |
optional | Which fields do you want to order the results by |
Fields | array |
body |
optional | Which fields do you want to return |
StartDate | date |
body |
required |
Start date of the search (UTC) |
EndDate | date |
body |
required |
End date of the search (UTC) |
Skip | integer |
body |
optional | Number of records to skip before returning |
Take | integer |
body |
Number of records to take in the return |
POST /v1/leads/query/[LeadTypeUID] HTTP/1.1
host: apidata.leadexec.net
content-type: application/json
Authorization: Bearer [access_token]
{
"Query": {
"LoanAmount": {
"$gte": 150000
}
...
},
"SortFields": [
"",
],
"SortOrder": 0,
"Fields": [
""
],
"StartDate": "2020-10-23T12:24:36-07:00",
"EndDate": "2020-10-23T12:24:36-07:00",
"Skip": 0,
"Take": 0
}
Response
Due to the dynamic nature of LeadExec, each lead type's response will be different.
Leads are broken up into the following sections (not all sections will apply to every lead)
-
UID
The main identifeir of the lead throughout the system.
-
Properties
General properties of the lead, this will include were the lead came from, the current state of the lead, as well as when it was processed.
-
Fields
Field information is dynamic depending on the lead type. Fields also may not exist on every lead. If you would like to generate a list of possible field, use the account API located at https://api.leadexec.net
-
TCPAInformation
If your account is signed up to use the LeadExec TCPA Consent System, this section will contain TCPA information regarding consent request and validation.
-
SendInformation
This section will display revenue, send count, as well as each location the lead was sent to.
-
LastUpdated
This value displays the last time this lead was updated.
{
"QueryTotal": 0,
"SentCount": 0,
"Skip": 0,
"Take": 0,
"Leads": [
{
"UID": 0,
"Properties": {
"Channel": "",
"TeamAssigned": "",
"LeadSourceUID": 0,
"LeadSource": "",
"DateAdded": "2019-09-08T07:25:49.87Z",
"FileUID": 0,
"AccountUID": 0,
"Account": "",
"LeadSourceSubID": "",
"IsValid": true,
"InvalidReason": "",
"MaxSell": 1,
"Price": 0.0,
"Category": "N/A",
"Lat": 30.00,
"Long": -75.00,
"Timezone": "",
"QualityControlledOn": "2019-09-08T07:25:52.9Z",
"InQualityControl": false,
"QualityControlledBy": "Automation",
"QualityControlResponse": "Bypass QC",
"QualityControlResult": true,
"CallVerified": false,
"ReturnStatus": "Not Returned",
"LeadGrade": "",
"Flagged": false,
"CallDuration": 0,
"CallResult": "",
"IVRNumber": 0,
"RecordID": "",
"AnalyticsUID": 0,
"VisitID": "",
"SearchEngine": "",
"Keyword": "",
"UserAssigned": "Not Assigned",
"TCPACompliant": true
},
"Fields": {
"FirstName": "",
"LastName": "",
"StreetAddress": "",
"City": "",
"State": "",
"PostalCode": "",
"Country": "",
"IPAddress": "",
"EmailAddress": "",
"Phone": 0,
...
},
"TCPAInformation": {
"RequestDate": "2019-09-08T07:24:52.957Z",
"IPAddress": "192.168.1.1",
"ReferrerURL": "",
"ConsentText": "",
"RequestID": 0,
"VisitID": "",
"Received": "2019-09-08T07:25:49.87Z",
"FirstName": "",
"LastName": "",
"Address": "",
"City": "",
"State": "",
"PostalCode": "",
"Country": "UA",
"PhoneNumber": "0",
"IPLat": 0.0,
"IPLong": 0.0,
"IsMobile": "True",
"ConsentGiven": true,
"ConsentTextRequested": true,
"Browser": "",
"OS": "",
"Referrer": "",
"SearchTerm": "N/A",
"FormURL": "",
"TimeOnSite": 0,
"TimeOnForm": 0,
"DateConsentTextRequested": "2019-09-08T07:24:52.957Z"
},
"SendInformation": {
"Revenue": 0.0,
"SendCount": 1,
"Sends": [
{
"SendUID": 0,
"ClientUID": 0,
"Client": "",
"ClientGroup": "",
"DateSent": "2019-09-08T07:26:05.967Z",
"Valid": true,
"Price": 0.0,
"PostData": "",
"Response": "",
"Location": 0,
"Emailed": false,
"Forwarded": false,
"RecordID": "",
"DeliveryDuration": 0,
"ClientAccountUID": 0,
"ClientAccount": "",
"ClientOrderUID": 0,
"InvoiceUID": 0,
"RevShare": 0.0,
"Automated": true,
"LeadNotes": "",
"LastReadDate": "2019-09-08T07:26:07.11Z",
"FirstReadDate": "2019-09-08T07:26:07.11Z",
"ReadCount": 1,
"LastReturnAction": 0,
"LastActionDate": "2019-09-08T07:25:49.87Z",
"LastReturnActionReason": "",
"AssignedReadDate": null,
"NextAppointmentDate": "0001-01-01T00:00:00Z",
"EmailReads": [
{
"DateOpened": "2019-09-08T07:26:07.11Z",
"IPAddress": ""
}
],
"Appointments": []
}]
},
"LastUpdated": "2020-09-29T18:17:00.832Z"
}]
}
Request
Parameter | Type | Position | Required | Description |
---|---|---|---|---|
access_token | string |
header |
required |
Authentication token (See Authentication) |
LeadTypeUID | integer |
url_segment |
required |
The identifier of the lead type to query against. |
StartDate | date |
body |
required |
Start date of the search (UTC) |
EndDate | date |
body |
required |
End date of the search (UTC) |
SortOrder | string |
body |
optional |
The sort order of the date created ASC DESC |
Skip | integer |
body |
optional | Number of records to skip before returning |
Take | integer |
body |
Number of records to take in the return |
POST /v1/pings/inbound/query/[LeadTypeUID] HTTP/1.1
host: apidata.leadexec.net
content-type: application/json
Authorization: Bearer [access_token]
{
"StartDate": "2020-10-23T12:24:36Z",
"EndDate": "2020-10-23T12:24:36Z",
"SortOrder": "ASC",
"Skip": 0,
"Take": 100
}
Response
{
"Total": 0,
"Sent": 0,
"Skip": 0,
"Take": 100,
"QueryTime": 0,
"Pings": [
{
"Id": "63c8b0a03314ce0624637a41",
"Accepted": true,
"OrderID": "ea8fa160-f51f-4086-ad2c-45eb2081d552",
"CreatedOn": "2023-01-19T02:53:19.993Z",
"ExpiresOn": "2023-01-19T02:58:19.962Z",
"LeadSourceUID": 0,
"LeadSource": "",
"CampaignUID": 0,
"Campaign": "",
"Received": true,
"LeadUID": 0,
"PotentialClients": 0,
"PotentialRevenue": 0.0,
"DeliveredClients": 0,
"ActualRevenue": 0.0,
"Result": "",
"ScanLog": "",
"MatchedClients": [
"",
""
],
"RequestID": "",
"Response": null,
"Request": null,
"Fields": null
},
{
"Id": "63c8b0a03314ce0624637a41",
"Accepted": true,
"OrderID": "ea8fa160-f51f-4086-ad2c-45eb2081d552",
"CreatedOn": "2023-01-19T02:53:19.993Z",
"ExpiresOn": "2023-01-19T02:58:19.962Z",
"LeadSourceUID": 0,
"LeadSource": "",
"CampaignUID": 0,
"Campaign": "",
"Received": true,
"LeadUID": 0,
"PotentialClients": 0,
"PotentialRevenue": 0.0,
"DeliveredClients": 0,
"ActualRevenue": 0.0,
"Result": "",
"ScanLog": "",
"MatchedClients": [
"",
""
],
"RequestID": "",
"Response": null,
"Request": null,
"Fields": null
}
]
}
Request
Parameter | Type | Position | Required | Description |
---|---|---|---|---|
access_token | string |
header |
required |
Authentication token (See Authentication) |
LeadTypeUID | integer |
url_segment |
required |
The identifier of the lead type to query against. |
StartDate | date |
body |
required |
Start date of the search (UTC) |
EndDate | date |
body |
required |
End date of the search (UTC) |
SortOrder | string |
body |
optional |
The sort order of the date created ASC DESC |
Skip | integer |
body |
optional | Number of records to skip before returning |
Take | integer |
body |
Number of records to take in the return |
POST /v1/pings/outbound/query/[LeadTypeUID] HTTP/1.1
host: apidata.leadexec.net
content-type: application/json
Authorization: Bearer [access_token]
{
"StartDate": "2020-10-23T12:24:36Z",
"EndDate": "2020-10-23T12:24:36Z",
"SortOrder": "ASC",
"Skip": 0,
"Take": 100
}
Response
{
"Total": 0,
"Sent": 0,
"Skip": 0,
"Take": 100,
"QueryTime": 0,
"Pings": [
{
"Id": "650b4e6e66024a3c705b1403",
"Accepted": true,
"ClientUID": 0,
"Client": "",
"DeliveryMethodUID": 0,
"DeliveryMethod": "",
"DeliveryAccountUID": 0,
"DeliveryAccount": "",
"PostSent": true,
"LeadUID": 0,
"Price": 0.0,
"Revenue": 0.0,
"Response": null,
"Request": null,
"LeadSourceUID": 0,
"CampaignName": "",
"SentOn": "2023-09-20T19:56:30.018Z",
"Fields": null
},
{
"Id": "650b4e6e66024a3c705b1403",
"Accepted": true,
"ClientUID": 0,
"Client": "",
"DeliveryMethodUID": 0,
"DeliveryMethod": "",
"DeliveryAccountUID": 0,
"DeliveryAccount": "",
"PostSent": true,
"LeadUID": 0,
"Price": 0.0,
"Revenue": 0.0,
"Response": null,
"Request": null,
"LeadSourceUID": 0,
"CampaignName": "",
"SentOn": "2023-09-20T19:56:30.018Z",
"Fields": null
}
]
}