An open API service indexing awesome lists of open source software.

https://github.com/linkorb/ticketbox-client


https://github.com/linkorb/ticketbox-client

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# TicketBox Client

Create tickets for TicketBox and view activities from your application

## Installation

```
composer require linkorb/ticketbox-client
```

## Example

Create Client

```php
require_once __DIR__ . '/../vendor/autoload.php';

use Linkorb\TicketBoxClient\Client as Client;
use Linkorb\TicketBoxClient\Ticket as Ticket;

// get the client
$client = new Client(
'http://tickets.dev/api/v1/',
,

);
```
Create Ticket by logged in User

```php
// Create Ticket with Logged in user
$ticket = new Ticket( $client ); // padidng client
$ticket->setSubject();
$ticket->setDescription();

try {
$ticket->create();
} catch( Exception $e ) {
echo $e->getMessage();
}
```

Create ticket by Anonymous user

```php
// Create Anon Ticket
$ticket = new Ticket( $client );
$ticket->setSubject();
$ticket->setDescription();
$ticket->setUser();
$ticket->setEmail();
$ticket->setPhone();
$ticket->setOrg();

try {
$ticket->create();
} catch( Exception $e ) {
echo $e->getMessage();
}
```

Get Ticket & its activities

```php
// Create Anon Ticket
$ticket = new Ticket( $client );

$ticket->get();
echo $ticket->getSubject(); // all the field null if not found.

$activities = $ticket->getActivity(); // get activities
var_dump($activities);
```

Change status of ticket

```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get(5);

try {
$ticket->setPending();
// $ticket->setClose();
// $ticket->setSchedule();

} catch ( Exception $e ) {
echo $e->getMessage();
}
```

Message ticket

```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get();

try {

$ticket->message( );

} catch ( Exception $e ) {
echo $e->getMessage();
}
```

Transfer Ticket

```php
// Get ticket
$ticket = new Ticket( $client );
$ticket->get();

try {
$ticket->transfer();
} catch ( Exception $e ) {
echo $e->getMessage();
}
```

## Brought to you by the LinkORB Engineering team



Check out our other projects at [engineering.linkorb.com](http://engineering.linkorb.com).

Btw, we're hiring!