jaime / vtiger-restapi-php
Vtiger REST API client for PHP
1.0.0
2022-01-10 04:48 UTC
Requires
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- phpunit/phpunit: ^9.5
README
Vtiger REST API client for PHP
Installation
composer require jaime/vtiger-restapi-php
Usage
require 'vendor/autoload.php'; $vtiger = new vtiger('VTIGER_URL', 'VTIGER_USERNAME', 'VTIGER_ACCESSKEY');
Create
$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');
Update
$params = ['id' => '12x3654', 'lastname' => 'Test Lead', 'email' => 'test@test.com', 'assigned_user_id' => '19x1']; $result = $vtiger->update($params);
Retrieve
$result = $vtiger->retrieve('5x3679');
Revise
$params = ['id' => '12x3653', 'email' => 'test2@test.com', 'assigned_user_id' => '19x1']; $result = $vtiger->revise($params);
Describe
$result = $vtiger->describe('Contacts');
Query
$params = ['email' => 'test2@test.com']; $select = ['mobile']; $result = $vtiger->query('Contacts', $params, $select);
ListTypes
$result = $vtiger->listTypes();
RetrieveRelated
$result = $vtiger->retrieveRelated('12x3653', 'Activities', 'Calendar');