<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
salesoftech / amocrm-api-php-salesoftech example snippets
use SalesOfTech\AmoCRM\SoftAmoClient;
use SalesOfTech\AmoCRM\Storage\SqlTokenStorage;
$pdo = new PDO(
'mysql:host=127.0.0.1;dbname=soft;charset=utf8mb4',
'user',
'pass',
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);
// Storage will automatically create table `amocrm_api_php_salesoftech_tokens` if it does not exist
$storage = new SqlTokenStorage($pdo);
$amo = (new SoftAmoClient($storage))
->setRedirectUri('https://example.com/amocrm/oauth/callback');
// Get client for a specific company (tenant)
$client = $amo->getClient(1);
// Use standard amocrm/amocrm-api-php services
$leadsService = $client->leads();
$leads = $leadsService->get();