LeadExec Data Interface

LeadExec's data interface is built to allow you to connect to your LeadExec database through other software.


Request Parameters

This API receives the following parameters:

Name Type Description
key String API Key
lid Int64 Unique identifier for the lead type being accessed
Query json The query to apply to the dataset being accessed (optional)
SortFields Array (String pipe delimited) The fields to sort the collection by (DateAdded by default) (optional)
SortOrder ASC or DESC Direction to apply the sort on the collection (optional)
Fields Array (String pipe delimited) List of fields to return in the collection (optional)
StartDate DateTime The start date of the data download
EndDate DateTime The end date of the data download
skip int The amount of leads you want to skip before download
take int The amount of leads to take after the skip

Request Example

The following example pulls all leads between 1/1/2010 and 2/1/2010 with a loan amount between 150000 and 200000. This example pulls only the first name, last name, and loan amount fields. The example also sorts by first name then last name. Note: For the example values are not URL encoded. Be sure to properly URL encode any values that require it.

https://apidata.leadexec.net/?key=[API_KEY]&lid=0&query={ "LoanAmount" : { $gte : 150000, $lte : 200000 } }&sortfields=FirstName|LastName&sortorder=ASC&fields=FirstName|LastName|LoanAmount&startdate=1/1/2010&enddate=2/1/2010&skip=100&take=1000

Response Information

This API will return an XML containing the leads as well as the sends for each lead.

Below is an example of the XML (Lead fields will depend on the configuration of your lead type):

<Leads querytotal="3088" takecount="1" sentcount="1">
	<Lead>
		<UID>22363629</UID>
		<LeadSource>Bills wholesale leads</LeadSource>
		<DateAdded>1/5/2014 10:50:54 AM</DateAdded>
		<FileUID>0</FileUID>
		<Campaign>Default MLM</Campaign>
		<IsValid>true</IsValid>
		<MaxSell>10</MaxSell>
		<Price>25</Price>
		<Category>No Category</Category>
		<DateVerified>1/5/2014 10:50:54 AM</DateVerified>
		<VerifiedBy>Automation</VerifiedBy>
		<VerifyResponse>Call Received</VerifyResponse>
		<VerifyAction>true</VerifyAction>
		<CallVerified>true</CallVerified>
		<LastReturnAction>Not Returned</LastReturnAction>
		<LastReturnActionDate>1/5/2014 10:50:54 AM</LastReturnActionDate>
		<Flagged>false</Flagged>
		<CallDuration>143</CallDuration>
		<CallResult>Transferred</CallResult>
		<IVRNumber>8885552547</IVRNumber>
		<RecordID>2b9739a1-e083-4d3f-9e73-72983f3766e9</RecordID>
		<AnalyticProfile>No Profile</AnalyticProfile>
		<UserAssigned>0</UserAssigned>
		<FirstName>John</FirstName>
		<LastName>Doe</LastName>
		<State>Nevada</State>
		<Zip>64086</Zip>
		<PrimaryPhone>2485553393</PrimaryPhone>
		<SendInformation>
			<Send>
				<SendID>22458301</SendID>
				<DateSent>1/5/2014 10:51:34 AM</DateSent>
				<ClientUID>6</ClientUID>
				<ClientName>ClickPoint Software</ClientName>
				<Valid>true</Valid>
				<Price>75</Price>
				<ReturnStatus>Not Returned</ReturnStatus>
				<ReturnDate/>
				<ReturnReason/>
				<Request>[request information]</Request>
				<Response>[response information]</Response>
			</Send>
		</SendInformation>
		<Revenue>75</Revenue>
		<SendCount>1</SendCount>
		<Duration>143</Duration>
	</Lead>
</Leads>

Query Information

LeadExec's data API uses a json format to query the lead documents information.

Example query to find leads sent to a specific client:

{
	"SendInformation.ClientUID" : 6
}
This example looks in the SendInformation object and only returns lead documents that contain a client ID of 6 (for a list of IDs for your clients, please refer to the LeadExec API for more information).
Example query to find leads with a loan amount between 150,000 and 200,000:
{
	"LoanAmount" : {
		$gte : 150000,
		$lte : 200000
	}
}
This example looks at the LoanAmount and only returns lead documents between 150000 and 200000.


Example pulls a single document for the UID specified:

{
	"UID" : 1234567
}
This example looks at the UID and only returns the lead document for the UID.

For more information on advanced search operators visit Query and Projection Operators

Note: If you are looking for an API that provides administrative operations, please refer to LeadExec's API for more information.