-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to SupportPal PHP API Client Wiki.
In this wiki, we will cover installing and using the client, all endpoints available including samples, and advanced settings.
The API client has the following system requirements:
- PHP 7.2.5+
The API client can be installed using Composer:
composer require supportpal/api-client-php
Using the API requires the API URL and an API token. The API URL is your help desk system URL (excluding the locale) appended with /api. In our example below, the system URL is https://www.example.com/support.
An API token can be generated by going to Settings -> General -> API Tokens in the operator panel. https://docs.supportpal.com/current/API+Tokens
$apiUrl = 'https://www.example.com/support/api';
$apiToken = 'JF9veGtKLw&8lVddyL9z14n&E3Y9JA65';These are fed to the SupportPal class to initialise the client.
$supportPal = new \SupportPal\ApiClient\SupportPal($apiUrl, $apiToken);All supported API endpoints can be accessed through the getApi function.
$api = $supportPal->getApi();To fetch tickets (GET /ticket/ticket endpoint), you would need to call the getTickets function.
$tickets = $api->getTickets();If you needed to filter the tickets, for example only fetch open tickets, you can add filtering options in an array as a parameter to the call.
$tickets = $api->getTickets(['status' => 1]);Find all the supported endpoints under the Reference section in the Wiki sidebar.