Pilot Solution ®

How to integrate your Leads with Pilot?

We show you in a very simple way how you can send a lead to our platform. If you want to have access to all the documentation of our API for other types of integrations, request it on our support page.

Pilot CRM allows integration in two simple ways:

Webhook Integration

Best choice! Easy programmatic way. Online integration.

Documentation

Email Integration

Recommended for people with
no programming skills. skill. Async integration.

Documentation

Lead structure

Each "lead" entered in pilot have to comply with a particular parameters structure, which not all are required:
Name Is obtained from the account which send the email if it is possible.
Surname Lead Surname.
Second surname Suitable to second surnames or mother surname.
Phone number Lead phone number
Mobile phone Lead mobile phone.
Contact type It is the channel whereby the person is contacted and it could be : can be for example: 1- Electronic | 2- Telephone | 3- Interview. (They vary according to the configuration of the instance).
Business Type Code to identify the type of business the Lead comes from. For example: (1) New Vehicle | (2) Used Vehicle | (3) After Sale. (They vary according to the configuration of the instance).
Notes  Comments or observations left by the lead on the pages where it gets. In case of e-commerce sites like Autotrader, cars.com, craiglist, etc. they send in this parameter the interest of the person (vehicle, finnancing, etc.)
 Origin It is a identifier grouper from where the lead is obtained. It is only used on the graphic interface of Pilot, and its use is deprecated in the automatic interfaces.
Subsource  Identify the lead primary source. It is obtain from subsources list of each client instance. It can be looked up in the system tables report called “data source”.
Assigned seller  Indicate the seller to whom the lead will be assigned directly. For now, this parameter is only used in the graphic interface of Pilot.
Brand  Vehicle Brand.
Model  Vehicle Model.
Service provider  Service name which provides the lead. It is a description of the source. It allows you to identify the service provider or the routing pattern in case you need dynamics assignements to different catch groups.
Vehicle of interest  Vehicle from which the lead sent the query. In case this field is empty, it will be completed with the brand and the model of the indicated vehicle.
Notifications Opt in  Indicate if the Lead agrees to receive notifications through any means of contact.
Advertising Opt in  Indicate if the Lead agrees to receive advertising material through any means of contact.
Address  Lead address street name.
Number  Lead street numbering.
Floor  Lead apartment floor.
Apartment  Lead apartment.
Zip code  Lead zip code.
Birth date  Lead date of birth.
Gender  Lead gender code.
mandatory parameters

First Steps

Our documentation explains the basic use of Web/HTTP and Pilot® calls. If you are not familiar with these techniques or you did not work with Web/HTTP before, please take a moment to do it before starting the job.

API Restful starting point

https://api.pilotsolution.net/webhooks/welcome.php

IMPORTANT: any answer that is not status 200 HTTP is an error.

Parameters Description

Lead webhook interface parameters description, all required:
Action Fixed value "create"
appkey is an alphanumeric value ex: 9715fc4b-17a8-4e56-ac7a-6deb5fd46u71.
Can be submitted as a requested to Pilot support account or can be obtained from admin backend.
debug Numerical code, flag, allows testing the service without saving the lead into the crm.
0 = no debug, executes service in normal mode. 1 = in debug mode. Ex: 0 (no debug)
notification_email The email account to receive a copy of the sent lead.
pilot_firstname Lead’s name
pilot_lastname Lead’s last name
pilot_phone Lead’s telephone
pilot_cellphone mobile number
pilot_email Lead’s email
pilot_contact_type_id It is the channel whereby the person is contacted and it could be : can be for example:
1- Electronic | 2- Telephone | 3- Interview.
pilot_business_type_id Code to identify the type of business the Lead comes from. For example: (1) New Vehicle | (2) Used Vehicle | (3) After Sale.
pilot_notes Comments, interesting observations that the “actor” add when entes the lead. In case of a e-commerce site as Autotrader, cars.com, Cargurus, and so on, it is suggested to fulfill it with the person information of interest (ex: vehicle, finnancing, ...)
pilot_origin_id Grouper which identify from where the lead is obtained. It is only used in Pilot Solution graphic interface, and its use is deprecated in the automatic interfaces.
pilot_suborigin_id It is a code which identify the primary source of the lead.
It is obtained by the subsource list of each client instance and can be looked up in the system tables report called “Leads Source” on the administration module. Ex: 1 (landing).
pilot_assigned_user Pilot user account to which you want to assign the lead.
In this case, the manual assignment of the lead takes precedence over the lead capture groups. E.g., cuentausuario@dominio.com
pilot_car_brand Brand of the vehicle of interest. E.g., Ford
pilot_car_modelo Model of the vehicle of interest. E.g., Fiesta
pilot_city City of location. E.g., Capital Federal
pilot_province Province of location. E.g., Buenos Aires
pilot_country Country of location E.g., Argentina
pilot_vendor_name Name of the lead vendor or provider
pilot_vendor_email Email of the lead vendor or provider
pilot_vendor_phone Phone of the lead vendor or provider
pilot_provider_service Name of the service which provide the lead. It is a description of the source. It allows you to identify the service provider or the routing pattern in case you need dynamics assignements to different catch groups.
pilot_provider_url URL of service who collect the lead.
Pilot_client_company Company name.
pilot_client_identity_document Lead identity document.
pilot_tracking_id Unique GUID or ID which identify the lead in the source.
pilot_client_ip Lead IP at the moment of the catch.
pilot_best_contact_time Best lead contact time.
pilot_product_code Product code according to Pilot’s price list. This causes the system to automatically generate
a quotation for the lead.

Products list can be obtained from the backend

Products and codes may vary from month to month as brands and agencies are added or removed.
pilot_product_of_interest Make and Model of the vehicle of interest to the Lead.
pilot_notificacions_opt_in_consent_flag Indicates if the Lead accepts to receive notifications through any means of contact. (1) Agree (0) Disagree
pilot_publicity_opt_in_consent_flag Indicates whether the Lead agrees to receive advertising material through any means of contact. (1) Agree (0) Disagree
N pilot_address_street Street name of the lead address.
N pilot_addresss_number Lead street numbering.
N pilot_address_floor Lead apartment floor.
N pilot_address_department Lead apartment.
N pilot_address_postal_code Lead zip code.
N pilot_birth_date Lead date of birth. It have to be expresed in this way: DD/MM/YY.
N pilot_gender_code Lead gender code. This value is entered in the gender master.
MANDATORY
N New

Output format

Each API invocation returns a message in JSON format with information about the API execution. Returning Values:

{
	"success": Indicates if the integration was successful. Its possible values are: True - False,
	"message": Text message which indicates if the lead was added successfully or not. Ex.: upload success: 'The data loading service was successfully executed' / wrong upload:'The required parameter appkey was not seted' ,
	"data": Successfull integration: Displays each of the integrated data / Wrong integration; Describe error.
}
Example:   
{
	"success":false,
	"message":"Error",
	"data":"The appkey required parameter was not configured"
}

Example of a correct execution message return:

										
{
	"success":boolean value - true o false,
	"message":result message,
	"data":{
		"message": result message,
		"assigned_user_id": id of the assigned Pilot user. If it is not assigned tag is not sent.
		"success":boolean value - true o false indicates that it was inserted in the base correctl,
		"id": Identifier of the registered lead. It is a numerical data.
	}
}
Example: 
{
	"success":true,
	"message":"Success",
	"data":{
		"message":"(3.2) The data upload service ran successfully.",
		"assigned_user_id":80,
		"success":true,
		"id":8855
	}
}
									
									

PHP Code example

Copy and paste the following code in a PHP file.
Then modify the configuration parameters and test with a form that has this page as an action.
You can also download an example of form code to add creativity here.

Download Code
<?php
//CONFIGURATION VARIABLES
$serviceURL = "https://api.pilotsolution.com.ar/webhooks/welcome.php";
$appKey = "here the key of the corresponding instance"; 
$tipoNegocio = "1";  
$origendeldato = "7A2E4184"; 
$landing_link = "Landing Promo Mes"; 
//CAPTURE OF PARAMETERS that can come from a form
$encoded = "";
$encoded .= urlencode('action').'=create&';
$encoded .= urlencode('appkey').'='.urlencode($appKey).'&';
$encoded .= urlencode('pilot_firstname').'='.urlencode(request("nombre",false,"n/a")).'&';
$encoded .= urlencode('pilot_lastname').'='.urlencode(request("apellido",false,"")).'&';$encoded .= urlencode('pilot_phone').'='.urlencode(request("telefono",false,"n/a")).'&';
$encoded .= urlencode('pilot_cellphone').'='.urlencode(request("celular",false,"")).'&';
$encoded .= urlencode('pilot_email').'='.urlencode(request("email",false,"")).'&';
$encoded .= urlencode('pilot_contact_type_id').'='.urlencode('1').'&'; //electronico
$encoded .= urlencode('pilot_business_type_id').'='.urlencode($tipoNegocio).'&'; 
$encoded .= urlencode('pilot_notes').'='.urlencode(request("comentarios",false,"Sin comentarios");).'&';
$encoded .= urlencode('pilot_suborigin_id').'='.urlencode($origendeldato).'&';
$encoded .= urlencode('pilot_provider_url').'='.urlencode($landing_link).'&';
$ch = curl_init($serviceURL);
curl_setopt($ch, CURLOPT_FAILONERROR, true); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,  $encoded);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);       
curl_close($ch);
echo $output;
die() ;
// Take the parameters by post or get
function request($param, $required=true, $default="") {
$result = $default;
//check POST configuration parameter
if (isset($_POST[$param])) {
if($_POST[$param]!="") {
$result = $_POST[$param]; } else {
if ($required) {
throw new Exception("Required parameter ".$param." was not set ");
			}
		
		}
	}
	else if(isset($_GET[$param])) {
		if($_GET[$param]!="") {
			$result = $_GET[$param];
		} else {
			if ($required) {
				throw new Exception("Required parameter ".$param." was not set ");
			}
		
		}
	}
	else {
		if ($required) {
			throw new Exception("Required parameter  ".$param." was not set ");
		} 
	}
	
	return $result;
}
?>

Download example code

Download code

Format

The format of the email is an ADF (xml information) that has the following content. In this case, the information that can be sent in the mail is more extensive and with more information.

Email format: preferably plain text.

Parameters

The lead provided is by way of example so that the content is understood.
													
<?xml version="1.0" encoding="UTF-8"?>
    <?adf version="1.0"?>
    <adf>
    <prospect>
       <requestdate>2013-06-27 11:26:24</requestdate>
       <vehicle>
            <brand>PEUGEOT</brand>
            <model>207</model>
        </vehicle>
        <customer>
            <contact>
                <name part="full">complete name of the prospect</name>
                <name part="first">name</name>
                <name part="last">lastname</name>
                <email>mail@dominio.com</email>
                <phone>1147899000</phone>
                <cellphone>1160403456</cellphone>
                <address>
                    <city>Cuidad Autónoma de Buenos Aires</city>
                    <province>Buenos Aires</province>
                    <country>Argentina</country>
                    
                </address>
            </contact>
            
            <comments>
                <![CDATA["I’m interest in buying a Ford Fiesta"]]>
            </comments>
            
        </customer>
        <vendor>
            <contact>
                <name part="full"></name>
                <email></email>
                <phone></phone>
            </contact>
        </vendor>
        <provider>
            <name>Lead provider</name>
            <service>Landing Sale Ford Fiesta</service>
            <notification_email></notification_email >
            <debug>0</debug>
        </provider>
    </prospect>
    <format>
        <formtype>pilot</formtype>
        <formversion>1</formversion>
        <key></key>
    </format>
</adf>
											

Parameters shown in blue are constant and should not be changed.

Parameters shown in green are optional and serve to expand the information for the salesmen.

Parameters shown in red are the basics are the basics of the message and required.

If any data is not sent, the tag must be reported blank. So, the message must be complete.

Eg:

 <make> </make>

PHP example code

 
                                        <?php

 enviar_a_Pilot();
 die(); 
 function enviar_a_Pilot()
 {
     $REQUERIDO  = true; 
     $NO_REQUERIDO = false; 
     
     $nombre         = request("nombre",$REQUERIDO);
     $apellido       = request("apellido", $NO_REQUERIDO);
     $telefono       = request("telefono", $NO_REQUERIDO);
     $celular        = request("celular", $NO_REQUERIDO);
     $email          = request("email",$REQUERIDO);
     $modeloAuto     = request("modelo",$NO_REQUERIDO);
     $comentarios    = "Comment:".request("comentarios", $NO_REQUERIDO);
     $provider       = "Name of lead provider"; 
     $landing        = "Contact Form Type";
     $linkLanding    = "www.misitio.com/landing.php";
     $provincia      = request("region",$NO_REQUERIDO);
     $to             = "...";  //this account is set in PILOT CRM
     $subject        = "New contact of ".$nombre;
     
     $cuerpoDelMail = armarCuerpoDelMail($nombre, $apellido, $telefono, $celular, $email, $modeloAuto, $comentarios, $landing, $linkLanding, $provincia, $provider);
     //can use here  
     if (enviarElMail("mi_cuenta@mail.com", $to, $subject, $cuerpoDelMail)){
         echo "Your request was sent succesfully."; 
     }else{
         echo "We could not process your request. Try later please."; 
     }
     return true; 
 }


// Takes the parameters by post or get
function request($param, $required=true, $default="")
{
    $result = $default;
    
    //check POST configuration parameter 
    if (isset($_POST[$param])) {
        
        if($_POST[$param]!="")
        {
            $result = $_POST[$param];
        } else {
            if ($required)
            {
                throw new Exception("Required parameter ".$param." was not set ");
            }
        
        }
    }
    else if(isset($_GET[$param]))
    {
        if($_GET[$param]!="")
        {
            $result = $_GET[$param];
        } else {
            if ($required)
            {
                throw new Exception("Required parameter ".$param." was not set");
            }
        
        }
    }
    else 
    {
        if ($required)
        {
            throw new Exception("Required parameter ".$param." was not set");
        } 
    }
    
    return $result;
}
//Function for sending emails 
function enviarElMail($de, $para, $asunto, $cuerpodelmail)
{
    //Here implement the email sending function that is available on the server. 
    }
    
//This function returns the content of the body of the mail with the values already replaced
 

function armarCuerpoDelMail($nombre, $apellido, $telefono, $celular, $email, $modeloAuto, $comentarios, $landing, $linkLanding, $provincia, $provider)
{
    $result = '
        <?xml version="1.0" encoding="UTF-8"?>
        <?adf version="1.0"?>
            <adf>
            <prospect>
               <requestdate>'.date("Y-d-m H:i:s").'</requestdate>
               <vehicle>
                    <id></id>
                    <year></year>
                    <make>RENAULT</make>
                    <model>'.$modeloAuto.'</model>
                    <vin></vin>
                    <stock></stock>
                    <trim></trim>
                    <price type="asking"></price>
                </vehicle>
                <customer>
                    <contact>
                        <name part="full"></name>
                        <name part="first">'.$nombre.'</name>
                        <name part="last">'.$apellido.'</name>
                        <email>'.$email.'</email>
                        <phone>'.$telefono.'</phone>
                        <cellphone>'.$celular.'</cellphone>
                        <international_phone></international_phone>
                        <address>
                            <street></street>
                            <city>'.$provincia.'</city>
                            <regioncode></regioncode>
                            <postalcode></postalcode>
                            <country>Argentina</country>
                        </address>
                    </contact>
                    <comments>
                            <![CDATA["'.$comentarios.'"]]>
                      </comments>
                </customer>
                <vendor>
                    <vendorname></vendorname>
                    <contact>
                        <name part="full"></name>
                        <email></email>
                        <phone></phone>
                    </contact>
                </vendor>
                <provider>
                    <name>'.$provider.'</name>
                    <service>'.$landing.'</service>
                    <notification_email></notification_email >
                    <debug>0</debug >
                    <url><![CDATA["'.$linkLanding.']]></url>
                </provider>
            </prospect>
            <format>
                <formtype>pilot</formtype>
                <formversion>1</formversion>
                <key></key>
            </format>
        </adf>';
    return $result;
}


                ?>