Replies REST API Route
Authentication #
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.
Schema #
When working with the Replies REST API route the following fields can be expected in any responses.
idinteger |
Unique identifier for the ticket reply Read Only |
datestring |
The date the reply was published, in the site’s timezone |
date_gmtstring |
The date the reply was published, as GMT |
modifiedstring |
The date the reply was last modified, in the site’s timezone |
modified_gmtstring |
The date the reply was last modified, as GMT |
statusstring |
The named status of the reply One of: publish |
contentobject |
The content for the reply |
ticket_dataobject |
Ticket fields See Ticket Data Object |
linksobject |
Links associated with the ticket |
| Ticket Data Object # The following fields are included within the ticket_data object |
|
idinteger |
Unique WP Post identifier for the ticket |
numberstring |
Unique identifier for the ticket |
keystring |
Unique key for the ticket |
statusstring |
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 |
titlestring |
The title of the ticket |
Retrieve a List Replies of 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.
Definition #
GET /kbs/v1/replies/ticket/<id>
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: descOne of: asc, desc |
orderby |
Sort collection by object attribute Default: idOne 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 |
Retrieve a Single Ticket Reply #
Definition #
GET /kbs/v1/replies/<id>
Example Request #
$ curl https://example.com/wp-json/kbs/v1/tickets/<id>
Arguments #
id |
WP Post ID of the ticket |
Add a New Ticket Reply #
Arguments #
idinteger required |
Unique WP Post ID of ticket to which to add reply |
reply_contenttext required |
The content of the ticket reply |
reply_authorinteger |
WP User ID of reply author Default: Current user ID |
agentinteger |
User ID or email address of agent from whom reply is being authored |
ticket_statusstring |
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_ticketbool |
A true closes the ticket once the reply is addedDefault: false |
Definition #
POST /kbs/v1/replies/ticket/<id>
Example Request #
$ curl -X POST https://example.com/wp-json/kbs/v1/replies/ticket/<id> -d '{"reply_content":"This is my reply"}'
