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 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.
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.
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 |
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.
GET /kbs/v1/tickets
$ curl https://example.com/wp-json/kbs/v1/tickets
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 , 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 |
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 |
GET /kbs/v1/tickets/<id>
GET /kbs/v1/tickets/<number>
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>
id |
WP Post ID of the ticket |
number |
KBS ticket number |
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 |
POST /kbs/v1/tickets
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 |
POST /kbs/v1/tickets/<id>
$ curl -X POST https://example.com/wp-json/kbs/v1/tickets/<id> -d '{"status":"closed"}'
Authentication is not required for this route unless attempting to retrieve restricted articles.
When working with the Articles REST API route the following fields can be expected in any responses.
id integer |
Unique identifier for the article Read Only |
date string |
The date the article was published, in the site’s timezone |
date_gmt string |
The date the article was published, as GMT |
modified string |
The date the article was last modified, in the site’s timezone |
modified_gmt string |
The date the article was last modified, as GMT |
guid object |
The globally unique identifier for the object. Read only |
slug string |
An alphanumeric identifier for the object unique to its type |
status string |
The named status of the article One of: publish , future , draft , pending , private |
type string |
Type of Post for the object Read only |
title object |
The title of the article |
content object |
The content of the article |
excerpt object |
The excerpt for the object |
author integer |
The ID for the author of the object |
replies integer |
The count of replies associated with the ticket |
links object |
Links associated with the ticket |
Query this endpoint to retrieve a collection of articles. The response you receive can be controlled and filtered using the URL query parameters below.
GET /kbs/v1/articles
$ curl https://example.com/wp-json/kbs/v1/articles
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 article IDs |
include |
Limit result set to specific article 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: author , date , id , include , modified , parent , relevance , slug , include_slugs , title , views , views_month |
status string | array |
Limit result set to articles assigned one or more statuses Default: publish |
search string |
Limit results to those matching a string |
GET /kbs/v1/articles/<id>
$ curl https://example.com/wp-json/kbs/v1/articles/<id>
id |
WP Post ID of the ticket |