nikserg/itcom-public-api

此软件包最新版本(1.1.16)没有可用的许可信息。

阿йтиком公共API

1.1.16 2022-10-06 14:20 UTC

README

阿йтикомCRM操作的公共API

安装

composer require nikserg/itcom-public-api

使用方法

API有两种授权模式

  • 作为用户,使用用户bearer令牌。在这种情况下,API可以访问用户有权限访问的所有申请。
  • 仅访问一个申请,使用其ID和访问令牌。在这种情况下,将无法创建新的申请,并且只能访问一个申请。

第一种模式使用UserClient类,第二种模式使用IndividualRequestClient类。

用户授权示例使用

$client = new \nikserg\ItcomPublicApi\BaseClient('<bearer token>');
$createdCertificate = $client->createOrUpdate(['EPGU']);
echo $createdCertificate->id; //ID созданной заявки

$client->createOrUpdate(['EPGU'], $createdCertificate->id, 'new name'); //Обновление заявки

测试

为了系统不发送真实请求,可以替换为\nikserg\ItcomPublicApi\UserClient类使用\nikserg\ItcomPublicApi\MockUserClient类。

@todo 为IndividualRequestClient类也实现类似的操作。