leaddesk / rest-api-client
LeadDesk REST API client for PHP
v0.8.0
2023-05-11 05:06 UTC
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.18
- phpunit/phpunit: ^9.5
README
A small PHP helper library for using LeadDesk REST API. Library is based on Guzzle HTTP client https://docs.guzzlephp.org/.
See https://leaddesk.com/docs/introduction-rest-api/ for more info on LeadDesk API.
NOTICE! This is a work-in-progress project at first, so breaking changes can happen until v1.0.0 is released.
Install
The only officially supported way to use the library is to download it using composer https://getcomposer.org/.
composer require leaddesk/rest-api-client
Usage
# 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);
How to contribute
TODO: Instructions to be written later when this project is more mature.