leadvertex/plugin-component-api-client

此包已被弃用且不再维护。未建议替代包。

LeadVertex插件API客户端组件

0.6.6 2022-10-24 13:21 UTC

This package is auto-updated.

Last update: 2023-12-01 15:22:22 UTC


README

\Leadvertex\Plugin\Components\ApiClient\ApiClient - 组件,该组件接受API端点URL和API令牌,允许向leadvertex.com的GraphQL API进行查询。此组件底层使用softonic/graphql-client GraphQL客户端库

用法

例如,在您的插件应用程序中,您可以创建国际化类如下

<?php
$client = new \Leadvertex\Plugin\Components\ApiClient\ApiClient('https://cluster.leadvertex.com/companies/1/CRM', 'token here');

/** @var \Softonic\GraphQL\Response $response */
$response = $client->query('query {name, company}');

print_r($response->getData());
print_r($response->getErrors());