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

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.com.ar/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"
Obligatory parameters
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.
parámetros obligatorios
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 Numeric code of the contact type of the lead.
1: Electronic, 2: Telephone , 3: Interview
pilot_business_type_id Numerical code of the business type.
1: Brand New, 2: Used, 2: Saving Plan
pilot_origin_id Deprecado
pilot_suborigin_id Alphanumerical code of lead origin/channel.
It Can be obtained from the crm backend Ex 78d8ddn: landing .
pilot_notes Lead notes
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_model 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_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 can change often, check periodically to avoid integration errors.
pilot_provider_service Name of the service, provider, landing or that collect the leads.
pilot_provider_url URL of the service that collects the lead.
pilot_client_identity_document Lead’s ID.
pilot_tracking_id External tracking code.
pilot_client_ip Web client IP
pilot_best_contact_time Best moment of the day for contact (E.g. All day)
MANDATORY

Output format

Each successful call to the webhooks returns a JSON document with information about
service execution. Example of an error message return:

{
	"success":boolean value - true or false,
	"message": string value: result message or “Error” in case success is false ,
	"data": struct: return news leads properties or error message in case success is false
}
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;
}


                ?>