vtiger-cloudsdk/restapi-php

Vtiger 云 Restapi 库

1.1 2024-07-25 10:50 UTC

This package is not auto-updated.

Last update: 2024-10-03 11:44:44 UTC


README

RestApi 库使得与 Vtiger 云上的数据进行交互变得简单。

参考: https://www.vtiger.com/docs/rest-api-for-vtiger

设置

您需要知道 Vtiger 云实例的域名以及为该实例分配的登录用户名和访问密钥。

$restapi = new \Vtiger\Cloud\RestApi($domain, $username, $accesskey);

类型

$types = $restapi->listTypes();

创建记录

$moduleName = "Accounts";
$newAccount = array(
	"accountname" => "Name of Account",
	"assigned_user_id" => $restapi->myid()
);
$account = $restapi->create($moduleName, $newAccount);

查找记录

$records = $restapi->query("SELECT * FROM Accounts WHERE createdtime = '2019-01-01';");

检索记录

$id = "target_record_id";
$record = $restapi->retrieve($id);