Menu Close Menu
Menu
  • 0
    • Number of items in basket: 0

      • Your basket is empty.
      • Total: £0.00
      • Checkout
  • Blog
  • Extensions
  • Support
    • Documentation
    • Log a Support Ticket
  • Your Account
    • Register
  • Contact Us
  • Demo

Tickets REST API Route

Tickets REST API Route

List, update and create tickets via 3rd party applications

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 #

pageCurrent page of the collection
Default: 1
per_pageMaximum number of items to be returned in result set
Default: 10
excludeEnsure result set excludes specific post IDs
includeLimit result set to specific post IDs
offsetOffset the result set by a specific number of items
orderOrder sort attribute ascending or descending
Default: desc
One of: asc, desc
orderbySort collection by object attribute
Default: id
One of: id, date, title, agent, customer, modified, include
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
userLimit result set to tickets logged by customers with a specific WP user ID
customerLimit result set to tickets logged by customers with a specific KBS user ID
companyLimit result set to tickets associated with a specific company ID
agentLimit 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 #

idWP Post ID of the ticket
numberKBS 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?

We're working hard to ensure we provide you with useful and relevant documentation to help you get the most out of KB Support.

Please take a moment to let us know if you found this article helpful.

Share this:

  • Tweet
  • WhatsApp

Related Articles

Advanced Developer Docs REST API Last updated: 12th January 2021

Published by Michael

Mike is the founder and lead developer of KB Support. When he's not working on KB Support, he's generally spending time with his 3 children and following his favourite football team

Posts by Michael Visit Website

Post navigation

Previous

Ticket Source REST API Route

Next

Replies REST API Route

KBS REST API Docs

  • Using the REST API
  • Tickets REST API Route
  • Replies REST API Route
  • Articles REST API Route
  • Agents REST API Route
  • Customers REST API Route
  • Companies REST API Route
  • Forms REST API Route
  • Form Fields REST API Route
  • Ticket Categories REST API Route
  • Ticket Departments REST API Route
  • Ticket Source REST API Route

Article Categories

  • Configuration
    • Advanced
    • Getting Started
  • Developer Docs
    • Constants
    • Hooks
  • Extensions
  • FAQs

Social Links

  • Follow us on Twitter
  • Like us on Facebook
  • Fork us on GitHub

Resources

  • Contact Us
  • KB Support Discount Code
  • KB Support Demo Site
  • Easy Plugin Demo

Sign up to our newsletter!

Subscribe now to receive all the latest news, thoughts and offers from KB Support.
New subscribers will receive 15% off their first purchase.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
© 2021 KB Support. All rights reserved.
  • Blog
  • Shop
  • Support
  • Demo
  • Privacy Policy
  • Discount Code