Customising Template Files
KB Support utilises template files to display content on the front end of your website. These files can be customised as described below.
These are more advanced articles that developers can reference in order to hook into KB Support functions and features in order to further enhance functionality and/or create extensions.
KB Support utilises template files to display content on the front end of your website. These files can be customised as described below.
No authentication is required for this route.
When working with the Forms REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the form Read Only |
date string |
The date the form was published, in the site’s timezone |
date_gmt string |
The date the form was published, as GMT |
modified string |
The date the form was last modified, in the site’s timezone |
modified_gmt string |
The date the form was last modified, as GMT |
status string |
The named status of the form One of: publish , future , draft , pending , private |
title object |
The title of the form |
meta object |
Meta fields |
fields object |
Form fields |
links object |
Links associated with the ticket |
Query this endpoint to retrieve a collection of forms. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/forms
$ curl https://example.com/wp-json/kbs/v1/forms
page |
Current page of the collection Default: 1 |
per_page |
Maximum number of items to be returned in result set Default: 10 |
search |
Limit results to those matching a string |
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: asc , desc |
orderby |
Sort collection by object attribute Default: title One of: id , date , modified , include , title |
status string | array |
Limit result set to forms assigned one or more statuses Default: publish |
slug |
Limit result set to posts with one or more specific slugs |
GET /kbs/v1/forms/<id>
$ curl https://example.com/wp-json/kbs/v1/forms/<id>
id |
WP Post ID of the form |
No authentication is required for this route.
When working with the Form Fields REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the field Read Only |
date string |
The date the field was published, in the site’s timezone |
date_gmt string |
The date the field was published, as GMT |
modified string |
The date the field was last modified, in the site’s timezone |
modified_gmt string |
The date the field was last modified, as GMT |
title object |
The title of the field |
parent integer |
The post parent ID |
menu_order integer |
Menu order |
meta integer |
Meta fields |
links object |
Links associated with the ticket |
Query this endpoint to retrieve a collection of fields. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/forms/fields
$ curl https://example.com/wp-json/kbs/v1/forms/fields
page |
Current page of the collection Default: 1 |
per_page |
Maximum number of items to be returned in result set Default: 10 |
search |
Limit results to those matching a string |
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: asc , desc |
orderby |
Sort collection by object attribute Default: title One of: id , date , modified , include , title , parent , menu_order |
status string | array |
Limit result set to fields assigned one or more statuses Default: publish |
slug |
Limit result set to fields with one or more specific slugs |
parent |
Limit result set to fields with particular parent IDs |
parent_exclude |
Limit result set to all fields except those of a particular parent ID |
GET /kbs/v1/forms/fields/<id>
$ curl https://example.com/wp-json/kbs/v1/forms/fields/<id>
id |
WP Post ID of the field |
Authentication is required for this route. The authenticated user will be able to retrieve ticket replies for tickets to which they have access. They will also be able to create new ticket replies. It is recommended that a user with the role of Support Manager or higher is used.
When working with the Replies REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the ticket reply Read Only |
date string |
The date the reply was published, in the site’s timezone |
date_gmt string |
The date the reply was published, as GMT |
modified string |
The date the reply was last modified, in the site’s timezone |
modified_gmt string |
The date the reply was last modified, as GMT |
status string |
The named status of the reply One of: publish |
content object |
The content for the reply |
ticket_data object |
Ticket fields See Ticket Data Object |
links object |
Links associated with the ticket |
Ticket Data Object # The following fields are included within the ticket_data object |
|
id integer |
Unique WP Post identifier for the ticket |
number string |
Unique identifier for the ticket |
key string |
Unique key for the ticket |
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 string |
The title of the ticket |
Query this endpoint to retrieve a collection of replies for the given ticket ID. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/replies/ticket/<id>
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: asc , desc |
orderby |
Sort collection by object attribute Default: id One of: id , date , agent , customer , modified , include |
customer |
Limit result set to tickets logged by customers with a specific KBS user ID |
agent |
Limit result set to tickets assigned to an agent with a specific WP user ID |
GET /kbs/v1/replies/<id>
$ curl https://example.com/wp-json/kbs/v1/tickets/<id>
id |
WP Post ID of the ticket |
id integer required |
Unique WP Post ID of ticket to which to add reply |
reply_content text required |
The content of the ticket reply |
reply_author integer |
WP User ID of reply author Default: Current user ID |
agent integer |
User ID or email address of agent from whom reply is being authored |
ticket_status string |
The status to update the ticket to once the reply is added One of: open, hold, closed – or any custom status registered via the KBS Custom Ticket Status extension if installed |
close_ticket bool |
A true closes the ticket once the reply is addedDefault: false |
POST /kbs/v1/replies/ticket/<id>
$ curl -X POST https://example.com/wp-json/kbs/v1/replies/ticket/<id> -d '{"reply_content":"This is my reply"}'
Authentication is required for this route and the authenticated user is required to have the ticket manager role. It is recommended that a user with the role of Support Manager or higher is used.
When working with the Agents REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the agent Read Only |
name string |
The display name of the agent |
first_name string |
The first name of the agent |
last_name string |
The last name of the agent |
email string |
The email address of the agent |
Query this endpoint to retrieve a collection of KB Support agents. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/agents
$ curl https://example.com/wp-json/kbs/v1/agents
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 agent IDs |
include |
Limit result set to specific agent IDs |
offset |
Offset the result set by a specific number of items |
order |
Order sort attribute ascending or descending Default: desc One of: asc , desc |
orderby |
Sort collection by object attribute Default: id One of: id , include , name , slug , email , registered_date |
search string |
Limit result set to a search string |
GET /kbs/v1/agents/<id>
$ curl https://example.com/wp-json/kbs/v1/agents/<id>
id |
WP User ID of the agent |
Authentication is required for this route and the authenticated user is required to have the ticket manager role. It is recommended that a user with the role of Support Manager or higher is used.
When working with the Customers REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the customer Read Only |
name string |
The name of the customer |
user_id integer |
The WP user ID of the customer |
email string |
The email address of the customer |
additional_emails object |
List of additional email addresses of the customer |
phone object |
Primary and additional phone numbers of the customer |
website string |
Website address of the customer |
address string |
Address of the customer |
company integer |
ID of the company for which the customer is associated |
date_created string |
Date the customer was created in website timezone |
notes object |
List of notes added against the customer |
ticket_count integer |
Number of tickets that the customer has logged |
Query this endpoint to retrieve a collection of KB Support agents. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/customers
$ curl https://example.com/wp-json/kbs/v1/customers
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 customer IDs |
include |
Limit result set to specific customerIDs |
offset |
Offset the result set by a specific number of items |
order |
Order sort attribute ascending or descending Default: desc One of: asc , desc |
orderby |
Sort collection by object attribute Default: id One of: id , user_id , name , email , company_id , date |
user_id |
Limit result set to specific customer WP user ID’s |
email |
Limit result set to specific email addresses |
name |
Limit result set to specific customer names |
company |
Limit result set to customers associated with a specific company ID |
GET /kbs/v1/agents/<id>
$ curl https://example.com/wp-json/kbs/v1/customers/<id>
id |
ID or email address of the customer to retrieve |
Authentication is required for this route and the authenticated user is required to have the ticket manager role. It is recommended that a user with the role of Support Manager or higher is used.
When working with the Companies REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the company Read Only |
title object |
The name of the company |
slug string |
An alphanumeric identifier for the object unique to its type |
featured_media integer |
ID of the featured media for the object (generally compant logo) |
meta object |
Contains contact information for the company Contains: _kbs_company_customer , _kbs_company_contact , _kbs_company_email , _kbs_company_phone , _kbs_company_website |
links object |
Links associated with the company |
Query this endpoint to retrieve a collection of KB Support companies. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/companies
$ curl https://example.com/wp-json/kbs/v1/companies
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 company IDs |
include |
Limit result set to specific company IDs |
offset |
Offset the result set by a specific number of items |
order |
Order sort attribute ascending or descending Default: desc One of: asc , desc |
orderby |
Sort collection by object attribute Default: id One of: id , user_id , name , email , company_id , date |
search |
Limit result set to specific search string |
GET /kbs/v1/tickets/<id>
GET /kbs/v1/tickets/<number>
$ curl https://example.com/wp-json/kbs/v1/companies/<id>
id |
WP Post ID of the ticket |
Authentication is only required for this route if you are adding or editing categories.
When working with the Ticket Categories REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the term Read Only |
count integer |
Number of tickets for the term Read Only |
description string |
HTML description of the term |
link string |
URL of the term Read Only |
name string |
HTML title for the term |
slug string |
An alphanumeric identifier for the term unique to its type |
taxonomy string |
Type attribution for the term Read Only |
parent integer |
The parent term ID |
meta object |
Meta fields |
Query this endpoint to retrieve a collection of ticket categories. The response you receive can be controlled and filtered using the URL query parameters below.
GET /wp/v2/ticket_categories
$ curl https://example.com/wp-json/wp/v2/ticket_categories
context |
Scope under which the request is made; determines fields present in response Default: view One of: view , embed , edit |
page |
Current page of the collection Default: 1 |
per_page |
Maximum number of items to be returned in result set Default: 10 |
search |
Limit results to those matching a string |
exclude |
Ensure result set excludes specific IDs |
include |
Limit result set to specific IDs |
order |
Order sort attribute ascending or descending Default: asc One of: asc , desc |
orderby |
Sort collection by term attribute Default: name One of: id , include , name , slug , include_slugs , term_group , description , count |
hide_empty |
Whether to hide terms not assigned to any posts |
parent |
Limit result set to terms assigned to a specific parent |
post |
Limit result set to terms assigned to a specific ticket |
slug |
Limit result set to terms with one or more specific slugs |
description |
HTML description of the term |
name Required |
HTML title for the term. |
slug |
An alphanumeric identifier for the term unique to its type |
parent |
The parent term ID |
meta |
Meta fields |
POST /wp/v2/ticket_categories
GET /wp/v2/ticket_categories/<id>
$ curl https://example.com/wp-json/wp/v2/ticket_categories/<id>
id |
Unique identifier for the term |
context |
Scope under which the request is made; determines fields present in response Default: view One of: view , embed , edit |
id |
Unique identifier for the term |
description |
HTML description of the term |
name |
HTML title for the term |
slug |
An alphanumeric identifier for the term unique to its type |
parent |
The parent term ID |
meta |
Meta fields |
POST /wp/v2/ticket_categories/<id>
$ curl -X POST https://example.com/wp-json/wp/v2/ticket_categories/<id> -d '{"description":"My ticket term"}'
id |
Unique identifier for the term |
force |
Required to be true, as terms do not support trashing |
DELETE /wp/v2/ticket_categories/<id>
$ curl -X DELETE https://example.com/wp-json/wp/v2/ticket_categories/<id>
Authentication is only required for this route if you are adding or editing departments.
When working with the Ticket Departments REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the term Read Only |
count integer |
Number of tickets for the term Read Only |
description string |
HTML description of the term |
link string |
URL of the term Read Only |
name string |
HTML title for the term |
slug string |
An alphanumeric identifier for the term unique to its type |
taxonomy string |
Type attribution for the term Read Only |
parent integer |
The parent term ID |
meta object |
Meta fields |
Query this endpoint to retrieve a collection of departments. The response you receive can be controlled and filtered using the URL query parameters below.
GET /wp/v2/ticket_departments
$ curl https://example.com/wp-json/wp/v2/ticket_departments
context |
Scope under which the request is made; determines fields present in response Default: view One of: view , embed , edit |
page |
Current page of the collection Default: 1 |
per_page |
Maximum number of items to be returned in result set Default: 10 |
search |
Limit results to those matching a string |
exclude |
Ensure result set excludes specific IDs |
include |
Limit result set to specific IDs |
order |
Order sort attribute ascending or descending Default: asc One of: asc , desc |
orderby |
Sort collection by term attribute Default: name One of: id , include , name , slug , include_slugs , term_group , description , count |
hide_empty |
Whether to hide terms not assigned to any posts |
parent |
Limit result set to terms assigned to a specific parent |
post |
Limit result set to terms assigned to a specific ticket |
slug |
Limit result set to terms with one or more specific slugs |
description |
HTML description of the term |
name Required |
HTML title for the term. |
slug |
An alphanumeric identifier for the term unique to its type |
parent |
The parent term ID |
meta |
Meta fields |
POST /wp/v2/ticket_departments
GET /wp/v2/ticket_departments/<id>
$ curl https://example.com/wp-json/wp/v2/ticket_departments/<id>
id |
Unique identifier for the term |
context |
Scope under which the request is made; determines fields present in response Default: view One of: view , embed , edit |
id |
Unique identifier for the term |
description |
HTML description of the term |
name |
HTML title for the term |
slug |
An alphanumeric identifier for the term unique to its type |
parent |
The parent term ID |
meta |
Meta fields |
POST /wp/v2/ticket_departments/<id>
$ curl -X POST https://example.com/wp-json/wp/v2/ticket_departments/<id> -d '{"description":"My department term"}'
id |
Unique identifier for the term |
force |
Required to be true, as terms do not support trashing |
DELETE /wp/v2/ticket_departments/<id>
$ curl -X DELETE https://example.com/wp-json/wp/v2/ticket_departments/<id>
You can use the KB Support REST API to retrieve information regarding Tickets, Customers and Agents via 3rd party applications. You can also use the REST API to remotely create content such as tickets and replies.