HelpSpot Help Desk Software
This is the PHP SDK to the HelpSpot API. The SDK can work with both the public and private (staff) API., (*1)
Please read the full documentation for each API method here:, (*2)
Install
Via Composer, (*3)
``` bash
$ composer require helpspot/helpspot, (*4)
## Loading
If your framework handles autoloading you can simply use a **use** statement at the top of your php
file to access HelpSpot. If it doesn't, you can load in HelpSpot with the require statement shown below plus using the **use** statement at the top of the file you want to access HelpSpot in.
```php
require_once "vendor/autoload.php";
use helpspot\helpspot\helpspot;
// Access HelpSpot in your functions and methods in this file
Usage
Authentication
You can authenticate either via an api key or a username and password combination. The API key is now the recommended authentication method and is the only method available if the HelpSpot instance uses SAML or LDAP authentication., (*5)
API Key:, (*6)
$helpspot = new helpspot('https://company.helpspot.com', '', '','apikey');
Username Password:, (*7)
$helpspot = new helpspot('https://company.helpspot.com', 'user@example.com', 'password');
Create a request using the private api
$helpspot = new helpspot('https://company.helpspot.com', 'user@example.com', 'password');
$helpspot->post('private.request.create', [
'sEmail' => 'customer@company.com',
'tNote' => 'testing',
'xCategory' => 1
]);
Update a request using the private api
$helpspot = new helpspot('https://company.helpspot.com', 'user@example.com', 'password');
$helpspot->post('private.request.update', [
'xRequest' => 12400,
'fNoteType' => 1, // A public note
'tNote' => 'Update the request with this note.',
]);
Get a request using the private api
$helpspot = new helpspot('https://company.helpspot.com', 'user@example.com', 'password');
$request = $helpspot->get('private.request.get', [
'xRequest' => 12400
]);
echo $request->sEmail;
Create a request using the public api
$helpspot = new helpspot('https://company.helpspot.com');
$helpspot->post('request.create', [
'sEmail' => 'customer@company.com',
'tNote' => 'testing'
]);
Checking for errors
$helpspot = new helpspot('https://company.helpspot.com', 'user@example.com', 'password');
$request = $helpspot->get('private.request.get', [
'xRequest' => 12400
]);
if($helpspot->hasError())
{
foreach($helpspot->getErrors() as $error)
{
echo $error->id .' '. $error->description;
}
}
else
{
echo $request->sEmail;
}
Security
If you discover any security related issues, please email customer.service@userscape.com instead of using the issue tracker., (*8)
Credits
License
The MIT License (MIT). Please see License File for more information., (*9)