PHP code example of qadeersahmed / vtiger-restapi-php

1. Go to this page and download the library: Download qadeersahmed/vtiger-restapi-php 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/ */

    

qadeersahmed / vtiger-restapi-php example snippets




$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');
bash
composer