jaime/vtiger-restapi-php

PHP版的Vtiger REST API客户端

1.0.0 2022-01-10 04:48 UTC

This package is auto-updated.

Last update: 2024-09-01 20:31:53 UTC


README

PHP版的Vtiger REST API客户端

安装

composer require jaime/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' => 'test@test.com', 'assigned_user_id' => '19x1'];
$result = $vtiger->update($params);

检索

$result = $vtiger->retrieve('5x3679');

修订

$params = ['id' => '12x3653', 'email' => 'test2@test.com', 'assigned_user_id' => '19x1'];
$result = $vtiger->revise($params);

描述

$result = $vtiger->describe('Contacts');

查询

$params = ['email' => 'test2@test.com'];
$select = ['mobile'];

$result = $vtiger->query('Contacts', $params, $select);

列出类型

$result = $vtiger->listTypes();

检索相关

$result = $vtiger->retrieveRelated('12x3653', 'Activities', 'Calendar');