PHP code example of servicein / leadclient
1. Go to this page and download the library: Download servicein/leadclient library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
servicein / leadclient example snippets
define("API_URL", "**asked to the commercial department**");
define("API_KEY", "**asked to the commercial department**");
define("DEFAULT_CAMPAIGN", "**asked to the commercial department**");
//define("PROXY", "tpc://xxx.xxx.xxx.xxx:3128");
$lead = new Lead();
$lead->setFirstname("Tester")
->setLastname("Tester")
->setMail("[email protected]")
->setPhone("33333333333")
->setCity("Roma")
->setProvince("RM")
->setSex("M")
->setNote("Nota");
# set other campaign
->setCampaign("OTHER_CAMPAIGN")
try{
$leadClient = new Client($lead);
$result = $leadClient->sendLead();
if($result->isValid()){
echo "Lead successfully loaded".PHP_EOL;
}else{
echo "Error: ".$result->message.PHP_EOL;
}
} catch (Exception $ex) {
echo $ex->getMessage().PHP_EOL;
}
bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar