Vtiger REST API client for PHP
composer require qadeersahmed/vtiger-restapi-php
require 'vendor/autoload.php';
$vtiger = new vtiger('VTIGER_URL', 'VTIGER_USERNAME', 'VTIGER_ACCESSKEY');
$params = [
'assigned_user_id' => '1',
'subject' => 'Test',
'quotestage' => 'Created',
'productid' => '14x3',
'description' => 'Test Description',
'hdnTaxType' => 'group', // group or individual taxes are obtained from the application
'LineItems' => [
'0' => [
'productid' => '14x3',
'sequence_no' => '1',
'quantity' => '1.000',
'listprice' => '500.00',
'comment' => 'sample comment product',
],
],
];
$result = $vtiger->create($params, 'Quotes');
$params = ['id' => '12x3654', 'lastname' => 'Test Lead', 'email' => '[email protected]', 'assigned_user_id' => '19x1'];
$result = $vtiger->update($params);
$result = $vtiger->retrieve('5x3679');
$params = ['id' => '12x3653', 'email' => '[email protected]', 'assigned_user_id' => '19x1'];
$result = $vtiger->revise($params);
$result = $vtiger->describe('Contacts');
$params = ['email' => '[email protected]'];
$select = ['mobile'];
$result = $vtiger->query('Contacts', $params, $select);
$result = $vtiger->listTypes();
$result = $vtiger->retrieveRelated('12x3653', 'Activities', 'Calendar');