leaddesk/rest-api-client

LeadDesk REST API 客户端用于 PHP

v0.8.0 2023-05-11 05:06 UTC

This package is auto-updated.

Last update: 2024-09-11 07:50:01 UTC


README

一个用于使用 LeadDesk REST API 的小型 PHP 辅助库。库基于 Guzzle HTTP 客户端 https://docs.guzzlephp.org/

有关 LeadDesk API 的更多信息,请参阅 https://leaddesk.com/docs/introduction-rest-api/

注意! 这最初是一个正在开发中的项目,因此在发布 v1.0.0 之前可能会发生重大更改。

安装

使用此库的唯一官方支持方式是使用 composer 下载 https://getcomposer.org/

composer require leaddesk/rest-api-client

用法

# Create API client instance with yout API credentials
$client = new \LeadDesk\RestApiClient\Client(
  # Get your OAuth client_id and client_secret e.g. from LeadDesk Admin panel
  \LeadDesk\RestApiClient\ClientConfig::create('your_api_client_id', 'your_api_client_secret')
);

# Authenticate (=get access token) to your LeadDesk client
$client->authLeaddeskClientId($yourLeadDeskClientId)

# Fetch campaign with ID 1
$campaign = $client->campaigns()->get(1);

如何贡献

待办事项:稍后在此项目更加成熟时编写说明。