pandadoc / php-client
官方PandaDoc PHP客户端SDK
6.2.0
2024-04-05 09:12 UTC
Requires
- php: ^7.3 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
README
PandaDoc SDK提供广泛的功能,帮助您在产品中构建令人难以置信的文档自动化体验。
文档
需求
PHP 7.3 及更高版本
安装
Composer
要使用Composer安装绑定,请使用
composer require pandadoc/php-client
或者在 composer.json
中添加以下内容
{ "require": { "pandadoc/php-client": "6.2.0" } }
然后运行 composer install
入门
<?php require_once(__DIR__ . '/vendor/autoload.php'); # Defining the host is optional and defaults to https://api.pandadoc.com # See Configuration.php for a list of all supported configuration parameters. $apiKey = 'YOUR_API_KEY'; $config = PandaDoc\Client\Configuration::getDefaultConfiguration() ->setApiKey('Authorization', $apiKey) ->setApiKeyPrefix('Authorization', 'API-Key'); $apiInstance = new PandaDoc\Client\Api\TemplatesApi( // If you want to use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->listTemplates(); print_r($result); } catch (Exception $e) { echo 'Exception when calling TemplatesApi->listTemplates: ', $e->getMessage(), PHP_EOL; }
授权
apiKey
- 类型: API密钥
- API密钥参数名称: Authorization
- 位置: HTTP头
oauth2
- 类型: OAuth
- 流程: accessCode
- 授权URL: https://app.pandadoc.com/oauth2/authorize
- 作用域:
- read+write: 使用
read+write
创建、发送、删除和下载文档,使用read
查看模板和文档详情。
示例
文档
官方PandaDoc公共API文档
https://developers.pandadoc.com/reference/about
API端点文档
所有URI均相对于 https://api.pandadoc.com
许可证
SDK根据以下 许可证 发布。