PHP code example of bolid1 / php-api-client-amocrm

1. Go to this page and download the library: Download bolid1/php-api-client-amocrm 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/ */

    

bolid1 / php-api-client-amocrm example snippets


$lead = new \amoCRM\Entities\Elements\Lead;
$lead->setName('My new lead');

$requester = \amoCRM\RequesterFactory::make('subdoma', '[email protected]', 'secret_key');

$leads_requester = new \amoCRM\Entities\LeadsRequester($requester);
$created_leads = $leads_requester->add([$lead->toAmo()]);
if (!empty($created_leads[0]['id'])) {
    $lead->setId($created_leads[0]['id']);
}
sh
php composer.phar