Authentication #

Authentication is only required for this route if you are adding or editing categories.

Schema #

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

List Ticket Categories #

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.

Definition #

GET /wp/v2/ticket_categories

Example Request #

$ curl https://example.com/wp-json/wp/v2/ticket_categories

Arguments #

context Scope under which the request is made; determines fields present in response
Default: view
One of: viewembededit
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: ascdesc
orderby Sort collection by term attribute
Default: name
One of: idincludenamesluginclude_slugsterm_groupdescriptioncount
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

Create a Ticket Category #

Arguments #

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

Definition #

POST /wp/v2/ticket_categories

Retrieve a Ticket Category #

Definition #

GET /wp/v2/ticket_categories/<id>

Example Request #

$ curl https://example.com/wp-json/wp/v2/ticket_categories/<id>

Arguments #

id Unique identifier for the term
context Scope under which the request is made; determines fields present in response
Default: view
One of: viewembededit

Update a Ticket Category #

Arguments #

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

Definition #

POST /wp/v2/ticket_categories/<id>

Example Request #

$ curl -X POST https://example.com/wp-json/wp/v2/ticket_categories/<id> -d '{"description":"My ticket term"}'

Delete a Ticket Category #

Arguments #

id Unique identifier for the term
force Required to be true, as terms do not support trashing

Definition #

DELETE /wp/v2/ticket_categories/<id>

Example Request #

$ curl -X DELETE https://example.com/wp-json/wp/v2/ticket_categories/<id>


Was this article helpful?