Authentication #

Authentication is required for this route. The authenticated user will be able to retrieve and update tickets to which they have access. They will also be able to create new tickets. It is recommended that a user with the role of Support Manager or higher is used.

Schema #

When working with the Tickets REST API route the following fields can be expected in any responses.

id
integer
Unique identifier for the ticket
Read Only
date
string
The date the ticket was published, in the site’s timezone
date_gmt
string
The date the ticket was published, as GMT
modified
string
The date the ticket was last modified, in the site’s timezone
modified_gmt
string
The date the ticket was last modified, as GMT
status
string
The named status of the ticket
One of: new, open, hold, closed – additional values may be available if the KBS Custom Ticket Status extension is installed
title
object
The title of the ticket
content
object
The content for the ticket
ticket_data
object
Ticket fields
See Ticket Data Object
replies
integer
The count of replies associated with the ticket
links
object
Links associated with the ticket
Ticket Data Object #
The following fields are included within the ticket_data object
resolved_date
string
The date the ticket was resolved, in local timezone
number
string
Unique identifier for the ticket
key
string
Unique key for the ticket
files
object
Data of files associated with ticket
agent
integer
WP user ID of agent assigned to the ticket
additional_agents
object
WP user ID’s of additional agent workers of the ticket
customer
integer
KBS user ID of the ticket customer
email
string
Email address of the ticket customer
user_id
integer
WP user ID of the ticket customer
user_info
object
Ticket customer information
company
integer
ID of company associated with the ticket
participants
object
Email addresses of ticket participants
form_data
object
The data that was submitted via a submission form

List Tickets #

Query this endpoint to retrieve a collection of tickets that the authenticated user has access to. The response you receive can be controlled and filtered using the URL query parameters below.

Definition #

GET /kbs/v1/tickets

Example Request #

$ curl https://example.com/wp-json/kbs/v1/tickets

Arguments #

page Current page of the collection
Default: 1
per_page Maximum number of items to be returned in result set
Default: 10
exclude Ensure result set excludes specific post IDs
include Limit result set to specific post IDs
offset Offset the result set by a specific number of items
order Order sort attribute ascending or descending
Default: desc
One of: ascdesc
orderby Sort collection by object attribute
Default: id
One of: iddate, title, agentcustomermodifiedinclude
status
string | array
Limit result set to tickets assigned one or more statuses
Default: All registered ticket statuses
One of: new, open, hold, closed – or any custom status registered via the KBS Custom Ticket Status extension if installed
user Limit result set to tickets logged by customers with a specific WP user ID
customer Limit result set to tickets logged by customers with a specific KBS user ID
company Limit result set to tickets associated with a specific company ID
agent Limit result set to tickets assigned to an agent with a specific WP user ID

Retrieve a Single Ticket #

Definitions #

GET /kbs/v1/tickets/<id>

GET /kbs/v1/tickets/<number>

Example Requests #

Retrieve Ticket by WP Post ID
$ curl https://example.com/wp-json/kbs/v1/tickets/<id>

Retrieve Ticket by KBS Ticket Number
$ curl https://example.com/wp-json/kbs/v1/tickets/<number>

Arguments #

id WP Post ID of the ticket
number KBS ticket number

Create a Ticket #

Arguments #

ticket_title
string
required
The subject of the ticket
ticket_content
text
required
The content of the ticket
customer_email
string
required
Customers email address
customer_first
string
required
Customers first name
customer_last
string
required
Customers Last Name
customer_phone1
string
Customers primary phone number
customer_phone2
string
Customers additional phone number
customer_website
string
Customers website address
agent_id
integer | string
WP user ID or email address of agent to be assigned to ticket
post_category
integer
ID of category to which to add the ticket
department
integer
ID of department to which to assign the ticket

Definition #

POST /kbs/v1/tickets

Update a Ticket #

Arguments #

id
integer
WP Post ID of the ticket
agent
integer | string
WP user ID or email address of agent to be assigned to ticket
agents
string
Comma separated list of agents to be added as workers of the ticket
company
integer
ID of company to associate with ticket
customer
integer | string
KBS ID or email address of customer to associate with ticket
status
string
The updated status of the ticket
One of: open, hold, closed – or any custom status registered via the KBS Custom Ticket Status extension if installed
post_category
integer
ID of a category to add to the ticket
department
integer
ID of department to which to assign the ticket

Definition #

POST /kbs/v1/tickets/<id>

Example Request #

$ curl -X POST https://example.com/wp-json/kbs/v1/tickets/<id> -d '{"status":"closed"}'


Was this article helpful?

Tickets REST API Route

Authentication # Authentication is required for this route. The authenticated user will be able to retrieve and update tickets to which they have access. They will also be able to create new tickets. It is recommended that a user with the role of Support Manager or higher is used. Schema # When working with the…
KB Article rating: 4.0 based on 1 ratings
KBS is now a LOGON product. For new and existing support requests, please send us an email.
If you have an open support ticket, please email us directly to follow up.
This is default text for notification bar