mike-rollout / hubspot-php-client
hubspot PHP客户端
v1.0.0
2024-07-15 16:27 UTC
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
README
未提供描述(由Openapi Generator生成 https://github.com/openapitools/openapi-generator)
安装与使用
要求
PHP 7.4及更高版本。也应与PHP 8.0兼容。
Composer
要使用Composer安装绑定,请在composer.json
中添加以下内容
{ "repositories": [ { "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], "require": { "GIT_USER_ID/GIT_REPO_ID": "*@dev" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门指南
请按照安装过程进行,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: oauth2 $config = Rollout\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); // Configure API key authorization: private_apps $config = Rollout\Client\Configuration::getDefaultConfiguration()->setApiKey('private-app', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Rollout\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('private-app', 'Bearer'); $apiInstance = new Rollout\Client\Api\BasicApi( // If you want 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 ); $contact_id = 'contact_id_example'; // string try { $apiInstance->deleteCrmV3ObjectsContactsContactIdArchive($contact_id); } catch (Exception $e) { echo 'Exception when calling BasicApi->deleteCrmV3ObjectsContactsContactIdArchive: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI均相对于https://api.hubapi.com
模型
- AssociatedId
- AssociationSpec
- BatchInputSimplePublicObjectBatchInput
- BatchInputSimplePublicObjectId
- BatchInputSimplePublicObjectInputForCreate
- BatchReadInputSimplePublicObjectId
- BatchResponseSimplePublicObject
- BatchResponseSimplePublicObjectWithErrors
- CollectionResponseAssociatedId
- CollectionResponseSimplePublicObjectWithAssociationsForwardPaging
- CollectionResponseWithTotalSimplePublicObjectForwardPaging
- Error
- ErrorDetail
- Filter
- FilterGroup
- ForwardPaging
- NextPage
- Paging
- PreviousPage
- PublicAssociationsForObject
- PublicGdprDeleteInput
- PublicMergeInput
- PublicObjectId
- PublicObjectSearchRequest
- SimplePublicObject
- SimplePublicObjectBatchInput
- SimplePublicObjectId
- SimplePublicObjectInput
- SimplePublicObjectInputForCreate
- SimplePublicObjectWithAssociations
- StandardError
- ValueWithTimestamp
认证
为API定义的认证方案
oauth2_legacy
- 类型:
OAuth
- 流程:
accessCode
- 授权URL:
https://app.hubspot.com/oauth/authorize
- 作用域:
- media_bridge.read: 读取媒体和媒体事件
- crm.objects.goals.read: 读取目标
- tickets: 读取和写入票务
- crm.objects.custom.read: 查看自定义对象记录
- e-commerce: 电子商务
- crm.objects.custom.write: 更改自定义对象记录
oauth2
- 类型:
OAuth
- 流程:
accessCode
- 授权URL:
https://app.hubspot.com/oauth/authorize
- 作用域:
- crm.objects.quotes.write: 报价
- crm.objects.deals.read:
- crm.objects.line_items.read: 项
- crm.objects.deals.write:
- crm.objects.quotes.read: 报价
- crm.objects.line_items.write: 项
- crm.objects.companies.read:
- crm.objects.companies.write:
- crm.objects.contacts.write:
- crm.objects.contacts.read:
private_apps_legacy
- 类型: API密钥
- API密钥参数名: private-app-legacy
- 位置: HTTP头
private_apps
- 类型: API密钥
- API密钥参数名: private-app
- 位置: HTTP头
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包是由OpenAPI Generator项目自动生成的
- API版本:
v3
- 生成器版本:
7.7.0
- 生成器版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen