-
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
Use of this library requires two components:
- The base URL of your help desk, for example
https://www.example.com/supportorhttps://support.example.com - An API token
You can initialise the API client by creating an ApiContext.
$hostname = 'example.com';
$apiToken = 'JF9veGtKLw&8lVddyL9z14n&E3Y9JA65';
$apiContext = new \SupportPal\ApiClient\Model\ApiContext($hostname, $apiToken);
$sp = new \SupportPal\ApiClient\SupportPal($apiContext);If your help desk runs from a sub directory, for example https://example.com/support, you can initialise the client like so:
$apiContext = new \SupportPal\ApiClient\Model\ApiContext($hostname, $apiToken);
$apiContext->setPath('support');By default the API client uses https. If you haven't setup an SSL certificate for your help desk you can switch to http:
$apiContext = new \SupportPal\ApiClient\Model\ApiContext($hostname, $apiToken);
$apiContext->setScheme('http')->setPort(80);If you're using a self-signed certificate, you will need to disable SSL verification:
$apiContext = new \SupportPal\ApiClient\Model\ApiContext($hostname, $apiToken);
$requestDefaults = new \SupportPal\ApiClient\Model\RequestDefaults;
$requestDefaults->disableSsl();
$sp = new \SupportPal\ApiClient\SupportPal($apiContext, $requestDefaults);Find all the supported endpoints under the Reference section in the Wiki sidebar.