thecsea / osticket-php-client
Rest php client for osticket
Installs: 10 366
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 4
Open Issues: 0
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- phpunit/phpunit: ~4.0
README
Rest php client for osticket
Features
Ositcket features
- Creation of tickets
- Attachments
- Execution of cron
Other/TODO
- Unit tests
- Laravel integration
- Load data by env
- PHP doc
- Force HTTPS
- Better HTTPS status code manage (for example 303 and other 2xx)
- Travis scrutinizer integration
- Usage guide and wiki
- Proxy
Examples
Create a ticket
use it\thecsea\osticket_php_client\OsticketPhpClient; use it\thecsea\osticket_php_client\OsticketPhpClientException; $support = new OsticketPhpClient($url, $apiKey); try{ $response = $client->newTicket() ->withName('test') ->withEmail('test@test.com') ->withPhone('0123456789') ->withSubject('subject') ->withMessage('message') ->withTopicId('1') ->getData(); print $response; }catch(OsticketPhpClientException $e){ print $->getMessage(); }
Of course you can perform the request without inserting all fields.
You can also use withData method passing and array of data that is merged with the data set previously or with the defaut data