Overview
The Lead Import API lets you send lead data directly to your Buying Buddy CRM database.
Use your personal Lead Import API Key to ensure leads are imported and get added to your account.
Authentication
- Requires your Lead Import API Key. Find it at (or My Integrations (Beta) in the menu under your name), on the API Keys tab. In the box for your account, the field labelled API Key is your Lead Import API Key. It is personal to you for that account - every user has their own key in each account they belong to, so it is not an account-wide key.
Leads are assigned to the user whose Lead Import API Key you use - an Account Admin's key included. To send imported leads to Round Robin distribution instead, include round_robin with the value 1 in the request.
API Endpoint
POST https://www.leadsandcontacts.com/clientapi/lead-import
Available Fields
See the Lead Import-API Field Reference for all available fields
Example Fields:
| Field | Description |
|---|---|
| api_key | Your Lead Import API Key |
| Lead's email address | |
| fname | First name |
| lname | Last name |
| phone | Phone number |
| request_subject | Lead's inquiry subject |
| request_details | Detailed message |
| notes | Internal notes |
| campaign_id | Associated campaign |
| rating | Lead rating |
| buyer_status | Timeframe/Status |
| tags | Lead tags |
| welcome_email | Send welcome email (0/1) |
| round_robin | Set to 1 to distribute the lead by Round Robin |
Code Examples
PHP Example
$postFields = array(
"api_key" => $lead_import_id,
"email" => $email,
"fname" => $firstname,
"lname" => $lastname,
"phone" => $phone,
"request_subject" => $request,
"request_details" => $message,
"notes" => 'some notes',
"campaign_id" => $campaign,
"rating" => $lead_rating,
"buyer_status" => $timeframe,
"tags" => $tags,
"welcome_email" => "0"
);
$url = 'https://www.leadsandcontacts.com/clientapi/lead-import';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
curl_close($ch);
cURL Example
To send the fields as a JSON body, add ?method=json to the endpoint URL. Without it, the fields in a JSON body are ignored and the lead is created empty.
curl -X POST "https://www.leadsandcontacts.com/clientapi/lead-import?method=json" \
-H "Content-Type: application/json" \
-d '{
"api_key": "your-lead-import-id",
"email": "john@example.com",
"fname": "John",
"lname": "Smith",
"phone": "555-0123",
"request_subject": "Property Inquiry",
"welcome_email": "0"
}'
Response
Returns JSON. success is the string "true" or "false", not a boolean. On success, code is "new" for a new lead or "exists" when the lead was already in your account, and id is the lead's ID. On failure, msg says what went wrong, and a missing or invalid API key is refused with HTTP status 401.
{
"success": "true",
"code": "new",
"id": 123456,
"msg": "Lead Successfully Imported"
}