Search, Read & Delete API Documentation

Modified on Fri, 21 Aug at 12:36 PM

Lead API Guide  •  Version 1.50  •  Prepared by John Jackson  •  25 January 2018

Introduction

This API allows the reading or deletion of leads. The request is made by making an HTTP POST of an XML message containing an access key, request type and other elements.

To create or update leads, please see the ‘Lead Create & Update API Guide’ instead.

The Request

To use this API, an access key is required. Provide the key in a key element within the request. Access keys can be created in ‘Settings > Access Keys’.

For each request, a request element must also be given containing either search, read or delete. Details of how to make each request type are given below.

If the main service is accessed at the address domain.example.com, then a POST request should be made to the corresponding API URL:

https://domain.example.com/api/APILead.php

An XML message should be sent as the POST data:

<?xml version="1.0" encoding="ISO-8859-1"?>
<data>
  <key>Yrg32FoiRdSriLYEbLrzSvFmurBGsPiz</key>
  <request>create</request>
  ...
</data>

The Response

The server will respond with XML data. The response will always contain Code (error code) and Message (response message) elements. If there are several messages, there may be multiple Message elements. If successful, other response elements will also be returned.

A successful response may look like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<result>
  <code>0</code>
  <message>OK</message>
  ...
</result>

Search

<request>search</request>

Parameters

ParameterRequiredDescription
startdateRequiredThe start date for the search period. e.g. 01/01/2014.
enddateRequiredThe end date for the search period. e.g. 31/01/2014.
pageOptionalPage number (starts at 1).
perpageOptionalNumber of results per page — 10 25 50 100 1000.
searchOptionalKeyword search term to filter on.
leadtypeidOptionalThe lead group or lead type to filter on.

To filter by lead group, use only the lead group ID. For example, to filter on lead group ID 15263, use 15263.

To filter by lead type, use the group and type IDs concatenated with a hyphen. For example, to filter on lead type ID 9263 in group 15263, use 15263-9263.

useridOptionalThe user or user group to filter on.

To filter by user ID, prefix the user’s ID with u-. For example, to search for user ID 2536, use u-2536.

To filter by user group ID, prefix the user group’s ID with g-. For example, to search for user group ID 81526, use g-81526.

To filter for all unassigned leads, simply use Unassigned.

statusOptionalThe status or progress point to filter on.

To filter on a status, prefix the exact string representation of the status with s-. For example, to search for the status ‘Validated’, use s-Validated.

To filter for leads with no status set, use the value n.

To filter on the progress point, use the progress point from the table below prefixed with p-. For example, to search for progress point 1 (All New), use p-1.

Progress Point IDMeaning
1All New
2All Validated
6All Contacted
8All Qualified
9All Converted
oAll Open
ocAll Open/Closed
10All Closed
cAll Closed/Invalidated
3All Invalidated

Response

A collection of leads that match the search criteria. Each lead returned includes the following data:

FieldDescription
idID of the lead.
subidSub ID of the lead.
receivedDate/time that the lead was received. e.g. 2011-01-01 12:00:00.
leadgroupidID of the lead group that the lead belongs to.
leadgroupnameName of the lead group that the lead belongs to.
leadtypeLead’s type.
statusLead’s status.
userName of the lead’s assigned user.
buyerName of the partner who has been referred the lead.
introducerName of the partner who introduced the lead.
fullnameThe full name on the lead.
companyCompany name.
phone1Phone number.
phone2Alternative phone number.
emailEmail address.
addressAddress line 1.
towncityTown or city.
postcodePostcode.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Read

<request>read</request>

Parameters

ParameterRequiredDescription
idRequiredThe ID of the lead to read.
subidOptionalThe sub ID of the lead to read.

Response

FieldDescription
idID of the lead.
subidSub ID of the lead.
ipaddressOriginating IP address.
receivedDate/time that the lead was received. e.g. 2011-01-01 12:00:00.
leadgroupidID of the lead group that the lead belongs to.
leadgroupnameName of the lead group that the lead belongs to.
leadtypeLead’s type.
statusLead’s status.
progressBilling point. e.g. Converted.
siteidID of the site that the lead belongs to.
sitenameName of the site that the lead belongs to.
useridID of the lead’s assigned user.
usernameName of the lead’s assigned user.
buyeridID of the partner who has been referred the lead.
buyerName of the partner who has been referred the lead.
buyerreferenceReference supplied by the partner who has been referred the lead.
introduceridID of the partner who introduced the lead.
introducernameName of the partner who introduced the lead.
referenceSource/introducer reference.
sourceMarketing source.
mediumMarketing medium.
termMarketing term.
costLead cost.
valueLead value.
transferdatetimeDate/time that the lead was referred. e.g. 2011-01-01 12:00:00.
transfersuccessfulSuccessful telephone transfer — Yes No.
xmldatetimeDate/time of internet delivery. e.g. 2011-01-01 12:00:00.
xmlfailsNumber of failed internet delivery attempts.
xmlresultInternet delivery result.
xmlreferenceInternet delivery return reference.
appointmentdatetimeDate/time of appointment. e.g. 2011-01-01 12:00:00.
appointmentnotesAppointment notes.
lastnotedatetimeDate/time of last note/call. e.g. 2011-01-01 12:00:00.
lastnoteDetails of last note/call.
taskexistsDoes the lead have an outstanding task? — Yes No.
workflowexistsDoes the lead have a workflow? — Yes No.
dropboxThe lead’s email dropbox address.
fullnameThe full name on the lead.
titlePerson’s title — Mr. Mrs. Ms. Miss Dr. Rev..
firstnameFirst name.
lastnameLast name.
companyCompany name.
jobtitleJob title.
phone1Phone number.
phone2Alternative phone number.
faxFax number.
emailEmail address.
addressAddress line 1.
address2Address line 2.
address3Address line 3.
towncityTown or city.
postcodePostcode.
dobFull date of birth. e.g. 1990-01-01.
dobdayDay of birth. e.g. 01.
dobmonthMonth of birth. e.g. 01.
dobyearYear of birth. e.g. 1990.
contacttimePreferred contact time — Anytime Morning Afternoon Evening.
contactphonePhone contact permission — Yes No Unknown.
contactsmsText message contact permission — Yes No Unknown.
contactemailEmail contact permission — Yes No Unknown.
contactmailMail contact permission — Yes No Unknown.
contactfaxFax contact permission — Yes No Unknown.
data1 – data50Additional information fields.
type1 – type50Descriptions of additional information fields.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Delete

<request>delete</request>

Parameters

ParameterRequiredDescription
idRequiredThe ID of the lead to delete.

Response

If the delete succeeds, the code will be 0 with the message OK.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article