apideck-libraries / php-sdk
Apideck OpenAPI 规范:优化后的 SDK
3.5.3
2024-09-24 12:30 UTC
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
- dev-main
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.0
- 0.0.7
- 0.0.6
- dev-generator-update
- dev-revert-57-generator-update
This package is auto-updated.
Last update: 2024-09-24 12:31:10 UTC
README
目录
安装
要求
PHP 7.3 及以上。也应该兼容 PHP 8.0,但尚未测试。
Composer
使用 composer 安装最新 SDK
$ composer require apideck-libraries/php-sdk
入门
该模块支持所有 Apideck API 端点。有关 API 的完整信息,请访问 文档。
配置
通过传递到配置的必需设置来初始化新的 Apideck 实例。
require('vendor/autoload.php');
use Apideck\Client\Apideck;
use Apideck\Client\ApideckConfiguration;
$config = new ApideckConfiguration('<insert-api-key-here>', '<insert-application-id-here>', '<insert-consumer-id-here>');
$apideck = new Apideck($config);
顶级参数(除 apiKey 外)可以在特定资源调用中覆盖。
<?php // Declare Unify Api to use $crmApi = $apideck->getCrmApi(); // Override consumerId serviceId as declared in initial configuration for this operation. $serviceId = 'salesforce'; $response = $crmApi->contactsAll( false, null, null, $serviceId, null, 10 );
示例
检索所有联系人列表并更新第一条记录的新地址。
<?php require('vendor/autoload.php'); use Apideck\Client\Apideck; use Apideck\Client\ApideckConfiguration; use Apideck\Client\Model\Contact; use Apideck\Client\Model\Address; use Apideck\Client\Model\PhoneNumber; $config = new ApideckConfiguration('<insert-api-key-here>', '<insert-application-id-here>', '<insert-consumer-id-here>'); $apideck = new Apideck($config); $crmApi = $apideck->getCrmApi(); $response = $crmApi->contactsAll(false, null, null, $serviceId, null, 10); $data = $response->getData(); $result = $crmApi->contactsUpdate([ $data[0]->getId(), new Contact([ "name" => "John Doe", "first_name" => "John", "last_name" => "Doe", "addresses" => [ new Address([ "city" => "Hoboken", "line1" => "Streetname 19", "state" => "NY" ]) ], "phone_numbers" => [ new PhoneNumber([ "number" => "0486565656", "phoneType" => "home" ]) ] ]) ]); var_dump($result);
Apideck 统一 API
以下 API 目前可用
AccountingApi
在此处阅读 AccountingApi 的完整文档 这里。
AtsApi
在此处阅读 AtsApi 的完整文档 这里。
ConnectorApi
在此处阅读 ConnectorApi 的完整文档 这里。
CrmApi
在此处阅读 CrmApi 的完整文档 这里。
EcommerceApi
在此处阅读 EcommerceApi 的完整文档 这里。
FileStorageApi
在此处阅读 FileStorageApi 的完整文档 这里。
HrisApi
在此处阅读 HrisApi 的完整文档 这里。
IssueTrackingApi
在此处阅读 IssueTrackingApi 的完整文档 这里。
LeadApi
在此处阅读 LeadApi 的完整文档 这里。
PosApi
在此处阅读 PosApi 的完整文档 这里。
SmsApi
在此处阅读 SmsApi 的完整文档 这里。
VaultApi
在此处阅读 VaultApi 的完整文档 这里。
WebhookApi
在此处阅读 WebhookApi 的完整文档 这里。
支持
打开 问题!