PHP bindings to the SalesLoft API
This library requires PHP 7.1 and later
The recommended way to install drift-php is through Composer
This library is intended to speed up development time but is not a shortcut to reading the SalesLoft API documentation. Many endpoints require specific and required fields for successful operation. Always read the documentation before using an endpoint.
composer require mckltech/salesloft-php
Initialize your client using your access token:
use SalesLoft\SalesLoftClient;
$client = new SalesLoftClient('ACCESS_TOKEN');
- The access token is expected to be from your SalesLoft API Key console or from a successful OAuth install
This library is unofficial and is not endorsed or supported by SalesLoft.
For bugs and issues, open an issue in this repo and feel free to submit a PR. Any issues that do not contain full logs or explanations will be closed. We need you to help us help you!
This library is intended to work with the SalesLoft V2 API as published in May 2021.
/** List Users */
$client->users->list();
/** Create A Person */
$client->people->create(['email_address' => '[email protected]', 'first_name' => 'Sales', 'last_name' => 'Loft']);
All endpoints follow a similar mechanism to the examples show above. Again, please ensure you read the SalesLoft API documentation prior to use as there are numerous required fields for most POST/PUT/PATCH operations.
- Cadences
- Users
- People
- Notes
- Person Stages
Exceptions are handled by HTTPlug. Every exception thrown implements Http\Client\Exception
. See the http client exceptions and the client and server errors. If you want to catch errors you can wrap your API call into a try/catch block:
try {
$users = $client->users->list();
} catch(Http\Client\Exception $e) {
if ($e->getCode() == '404') {
// Handle 404 error
return;
} else {
throw $e;
}
}
The layout and methodology used in this library is courtesy of https://github.com/intercom/intercom-php