fredbradley / topdesk
A Laravel Service Provider for the TOPdesk API
Requires
- php: ^8.0
- fredbradley/cacher: ^2.0
- fredbradley/easytime: ^1.0
- illuminate/support: ~9|~10|~11
- madebybob/php-number: ^1.4
Requires (Dev)
- laravel/pint: ^1.13
- mockery/mockery: ^1.1
- orchestra/testbench: *
- phpunit/phpunit: ^9.0
- dev-master
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- 3.0.0
- v2.0.34
- v2.0.33
- v2.0.32
- v2.0.31
- v2.0.30
- v2.0.29
- v2.0.28
- v2.0.27
- v2.0.26
- v2.0.25
- v2.0.24
- v2.0.23
- v2.0.22
- v2.0.21
- v2.0.20
- v2.0.19
- v2.0.18
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.3.1
- v1.3.0
- v1.2.15
- v1.2.14
- v1.2.13
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/version2
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/laravel/framework-6.20.44
- dev-dependabot/composer/guzzlehttp/guzzle-7.4.5
- dev-dependabot/composer/guzzlehttp/psr7-2.2.1
- dev-dependabot/composer/league/flysystem-1.1.4
This package is auto-updated.
Last update: 2024-11-15 11:41:49 UTC
README
This is a TOPdesk API wrapper for Laravel. Using Laravel's HTTP Facade. Please check out the Version 1 releases if you do not use Laravel, or the original package from Innovaat.
Minimum Requirements
- PHP 8.0 or higher
Installation
Via Composer
$ composer require fredbradley/topdesk
Set up
Ensure you understand the TOPdesk API configuration and your TOPdesk environment is set up to use the API. More details can be found at developers.topdesk.com.
Add three variables to your .env
file
TOPdesk_endpoint="" # Your TOPdesk url, ending in "`tas/`" TOPdesk_app_username="" # Your username you wish to authenticate with TOPdesk_app_password="" # Your application password for that username.
Guide
Our TOPdesk API implementation contains the following features:
- Simple login using application passwords.
- Automatic retry functionality that retries requests when connection errors or status codes >= 500 occur. We have experienced various instabilities with the TOPdesk API, and hopefully this minimizes these shortcomings.
- Direct function calls for much used api endpoints (
createIncident($params)
,getIncidentById($id)
,getListOfIncidents()
,escalateIncidentById($id)
,deescalateIncidentById($id)
,getListOfDepartments()
,createDepartment($params)
,getListOfBranches()
,createBranch($params)
among others). - Easy syntax for all other endpoints using
$api->request($method, $uri, $json = [], $query = [])
.
Now your API should be ready to use:
$incidents = TOPDesk::getListOfIncidents([ 'start' => 0, 'page_size' => 10 ]); foreach($incidents as $incident) { var_dump($incident['number']); }
Many requests have been implemented as direct functions of the API. However, not all of them have been implemented.
For manual API requests, use the request()
function:
TOPDesk::request('GET', 'api/incidents/call_types', [ // Optional array to be sent as JSON body (for POST/PUT requests). ], [ // Optional (search) query parameters, see API documentation for supported values. ], [ // Optional parameters for the Guzzle request itself. // @see http://docs.guzzlephp.org/en/stable/request-options.html ]);
Documentation
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
- Fred Bradley - Laravel Wrapper
- Innovaat - Initial TOPdesk API PHP Wrapper
License
MIT. Please see the license file for more information.