pggns / liveagent

Unofficial LiveAgent API v3 PHP Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LiveAgent v3 REST API Client

Build Status Coverage Status Donate

This is an unofficial LiveAgent API v3 PHP Client. QualityUnit does not provide official one yet.

This is still an unstable development version. Currently only all GET requests are implemented and POST to create a ticket and a file. Feel free to contribute and add any missing requests.

LiveAgent Logo

Installation

Use composer to install this package.

Example of usage

Create a new LiveAgentAPI client instance

$la = new Pggns\LiveAgent\LiveAgentApi('https://yourliveagantdomain.com/api/v3', 'api_key');

Create new Ticket via LiveAgentAPI client instance

$ticket = new Pggns\LiveAgent\Ticket('Test API', 'This is a testing message.', 'recipient@example.org', 'user@example.org');

print_r($la->createTicket($ticket));

Create new File

$file = new Pggns\LiveAgent\File('path/to/file.txt');

print_r($la->createFile($file));

Create new Ticket and add a file as an attachment

$ticket = new Pggns\LiveAgent\Ticket('Test API', 'This is a testing message.', 'recipient@example.org', 'user@example.org');

$file = new Pggns\LiveAgent\File('path/to/file.txt');
$attachment = $la->createFile($file);

$ticket->addAttachment($attachment->id);

print_r($la->createTicket($ticket));

How to run tests?

Tests are build with Nette Tester. You can run it like this (inside of php container)

$ docker-compose up -d
$ docker-compose exec php bash
$ cd tests
$ php -f tester ./ -C --coverage coverage.html --coverage-src ../src

Minimum requirements

  • PHP 7.1+
  • php-curl

License

MIT License (c) Pavol Biely

Read the provided LICENSE file for details.

Links

About

Unofficial LiveAgent API v3 PHP Client

License:MIT License


Languages

Language:PHP 97.8%Language:Dockerfile 2.0%Language:Batchfile 0.2%