Documentation
API
The Lead Zeppelin API allows you access to your lead data from your website or application. Authentication and currently available methods are described below, with examples given in PHP. Responses can be returned as JSON or XML.
Authentication
Connecting and authentication require your Lead Zeppelin username, password and API key. The following example shows a basic method that can be used to test your credentials as well as a base for all other API calls.
<?php $username = "{username}"; $password = "{password}"; $data = "api_key={api_key}"; $url = "https://www.leadzep.com/api/test"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password); $result = curl_exec($curl); curl_close($curl); print $result; ?>
Be sure to replace values in curly brackets {} with your credentials.
A successful XML response will return:
<xml>
<status>success</status>
</xml>
or formatted as JSON:
{
"status" : "success"
}
Invalid API requests will be returned with an error status along with a contextual message. For example:
{
"status" : "error",
"message" : "No match was found for the provided API key."
}
Response Format
Responses are returned as XML by default. To change the format, simply append /format/{format} to any request URL. So to return JSON in the first example, the request would be sent as https://www.leadzep.com/api/test/format/json
Methods
A description of currently available methods
Leads » Get All
Use to retrieve all lead data (returns both “contacts” & “leads”).
- URL
https://www.leadzep.com/api/leads/format/{format}- Required POST data
api_key
Leads » Get Single
Use to retrieve data associated to a single contact or lead.
- URL
https://www.leadzep.com/api/leads/id/{id}/format/{format}- Required POST data
api_key
Leads » Insert
Use to add a lead to your account. Append lead data (as defined in the web-to-lead documentation) to the $data variable passed via POST. For example:
<?php $data = "api_key={api_key}"; $data .= "&lead[firstname]=Joe"; $data .= "&lead[lastname]=User"; $data .= "&lead[company]=ACME Blimp Supply"; $data .= "&lead[title]=Pilot"; ?>
- URL
https://www.leadzep.com/api/leads/add/1/format/{format}- Required POST data
api_key,lead[]