Skip to content

Ticket Endpoints

Jay edited this page Jun 6, 2024 · 10 revisions

Below are the currently supported ticket endpoints.

Channel Settings

GET /ticket/channel/{channel}/settings

Requires a valid channel name.

$webSettings = $api->getTicketApi()->getChannelSettings('web');

Custom Fields

GET /ticket/customfield

$customfields = $api->getTicketApi()->getCustomFields();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-custom-field-get

$customfields = $api->getTicketApi()->getCustomFields(['department_id' => 1]);

GET /ticket/customfield/{id}

$customfield = $api->getTicketApi()->getCustomField(1);

Departments

GET /ticket/department

$departments = $api->getTicketApi()->getDepartments();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-department-get

$departments = $api->getTicketApi()->getDepartments(['department_id' => 1, 'public' => 1]);

GET /ticket/department/{id}

$department = $api->getTicketApi()->getDepartment(1);

Priorities

GET /ticket/priority

$priorities = $api->getTicketApi()->getPriorities();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-priority-get

$priorities = $api->getTicketApi()->getPriorities(['department_id' => 1]);

GET /ticket/priority/{id}

$priority = $api->getTicketApi()->getPriority(1);

Settings

GET /ticket/settings

$settings = $api->getTicketApi()->getSettings();

Statuses

GET /ticket/status

$status = $api->getTicketApi()->getStatuses();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-status-get

$statuses = $api->getTicketApi()->getStatuses(['order_column' => 'name']);

GET /ticket/status/{id}

$status = $api->getTicketApi()->getStatus(1);

Tickets

GET /ticket/ticket

$tickets = $api->getTicketApi()->getTickets();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-ticket-get

$tickets = $api->getTicketApi()->getTickets(['status' => '1,3,4']);

GET /ticket/ticket/{id}

$ticket = $api->getTicketApi()->getTicket(1);

POST /ticket/ticket

$createTicket = new \SupportPal\ApiClient\Model\Ticket\Request\CreateTicket([
    'user' => 1,
    'department' => 1,
    'status' => 1,
    'priority' => 1,
    'subject' => 'Subject',
    'text' => 'Message'
]);
$ticket = $api->getTicketApi()->createTicket($createTicket);

For a full list of parameters, see https://api.supportpal.com/api.html#ticket-ticket-post

PUT /ticket/ticket/{id}

$updateTicket = new \SupportPal\ApiClient\Model\Ticket\Request\UpdateTicket(['status' => 2]);
$ticket = $api->getTicketApi()->updateTicket($id, $updateTicket);

For a full list of parameters, see https://api.supportpal.com/api.html#ticket-ticket-put

DELETE /ticket/ticket/{id}

$api->getTicketApi()->deleteTicket($id);

Ticket Attachments

GET /ticket/attachment

$attachments = $api->getTicketApi()->getAttachments();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-attachment-get

$attachments = $api->getTicketApi()->getAttachments(['ticket_id' => 1]);

GET /ticket/attachment/{id}

$attachment = $api->getTicketApi()->getAttachment(1);

GET /ticket/attachment/{id}/download

$stream = $api->getTicketApi()->downloadAttachment(1);

A StreamInterface is returned.

Ticket Messages

GET /ticket/message

$messages = $api->getTicketApi()->getMessages();

You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#ticket-message-get

$messages = $api->getTicketApi()->getMessages(['ticket_id' => 1, 'by' => 0]);

GET /ticket/message/{id}

$message = $api->getTicketApi()->getMessage(1);

POST /ticket/message

$createMessage = new \SupportPal\ApiClient\Model\Ticket\Request\CreateMessage([
    'ticket_id' => 1,
    'user_id'   => 1,
    'text'      => 'Message'
]);
$message = $api->getTicketApi()->createMessage($createMessage);

For a full list of parameters, see https://api.supportpal.com/api.html#ticket-message-post

PUT /ticket/message/{id}

$updateMessage = new \SupportPal\ApiClient\Model\Ticket\Request\UpdateMessage(['text' => 'New Text']);
$message = $api->getTicketApi()->updateMessage($id, $updateMessage);

For a full list of parameters, see https://api.supportpal.com/api.html#ticket-message-put

DELETE /ticket/message/{id}

$api->getTicketApi()->deleteMessage($id);