Schema

The schema defines all the fields that exist for a ticket object.

date
string, datetime (ISO8601)

The date the object was published, in the site's timezone.

Context: view, edit, embed

date_gmt
string, datetime (ISO8601)

The date the object was published, as GMT.

Context: view, edit

guid
object

The globally unique identifier for the object.

Read only

Context: view, edit

id
integer

Unique identifier for the object.

Read only

Context: view, edit, embed

modified
string, datetime (ISO8601)

The date the object was last modified, in the site's timezone.

Read only

Context: view, edit

modified_gmt
string, datetime (ISO8601)

The date the object was last modified, as GMT.

Read only

Context: view, edit

slug
string

An alphanumeric identifier for the object unique to its type.

Context: view, edit, embed

status
string

A named status for the object.

Context: view, edit

One of: publish, future, draft, pending, private, queued, processing, hold, read, unread

type
string

Type of Post for the object.

Read only

Context: view, edit, embed

title
object

The title for the object.

Context: view, edit, embed

content
object

The content for the object.

Context: view, edit

ticket-tag
array

The terms assigned to the object in the ticket-tag taxonomy.

Context: view, edit

product
string

The terms assigned to the object in the product taxonomy.

Context: view, edit

department
string

The terms assigned to the object in the department taxonomy.

Context: view, edit

ticket_priority
string

The terms assigned to the object in the ticket_priority taxonomy.

Context: view, edit

ticket_channel
string

The terms assigned to the object in the ticket_channel taxonomy.

Context: view, edit

state
string

Limit result set to tickets in the specified state.

Context:

author
integer

The ID for the author of the object.

Context: view, edit, embed

assignee
integer

The agent assigned to this ticket

Context: view, edit, embed

secondary-assignee
integer

The secondary assignee for this ticket

Context: view, edit

tertiary-assignee
integer

The tertiary assignee for this ticket

Context: view, edit

customer-reply-count
integer

The number of customer replies to this ticket

Context: view, edit

agent-reply-count
integer

The number of agent replies to this ticket

Context: view, edit

total-reply-count
integer

The number of total replies to this ticket

Context: view, edit

time-calculated
integer

The gross time calculated for ticket in minutes

Context: view, edit

time-adjustments
integer

The time adjustments for ticket in minutes

Context: view, edit

time-final
integer

The final adjusted time for ticket in minutes

Read only

Context: view, edit

time-adjustments-type
string

The type of time adjustment, positive or negative.

Context: view, edit

time-notes
string

The notes for the time

Context: view, edit

Example Request

$ curl -X OPTIONS -i http://demo.getawesomesupport.com/wp-json/wpas-api/v1/tickets

List Tickets

Arguments

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.

after

Limit response to posts published after a given ISO8601 compliant date.

before

Limit response to posts published before a given ISO8601 compliant date.

exclude

Ensure result set excludes specific IDs.

Default:

include

Limit result set to specific IDs.

Default:

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: date

One of: author, date, id, include, modified, parent, relevance, slug, title

slug

Limit result set to posts with one or more specific slugs.

status

Limit result set to items assigned one or more statuses.

Default: any

ticket-tag

Limit result set to all items that have the specified term assigned in the ticket-tag taxonomy.

Default:

ticket-tag_exclude

Limit result set to all items except those that have the specified term assigned in the ticket-tag taxonomy.

Default:

product

Limit result set to all items that have the specified term assigned in the product taxonomy.

Default:

product_exclude

Limit result set to all items except those that have the specified term assigned in the product taxonomy.

Default:

department

Limit result set to all items that have the specified term assigned in the department taxonomy.

Default:

department_exclude

Limit result set to all items except those that have the specified term assigned in the department taxonomy.

Default:

ticket_priority

Limit result set to all items that have the specified term assigned in the ticket_priority taxonomy.

Default:

ticket_priority_exclude

Limit result set to all items except those that have the specified term assigned in the ticket_priority taxonomy.

Default:

ticket_channel

Limit result set to all items that have the specified term assigned in the ticket_channel taxonomy.

Default:

ticket_channel_exclude

Limit result set to all items except those that have the specified term assigned in the ticket_channel taxonomy.

Default:

state

Limit result set to tickets in the specified state.

Default: open

author

The ID for the author of the object.

Default: The ID of the current logged in client if applicable.

assignee

The agent assigned to this ticket

Default: The ID of the current logged in agent if applicable.

Definition

GET /wpas-api/v1/tickets

Example Request

$ curl http://demo.getawesomesupport.com/wp-json/wpas-api/v1/tickets

Retrieve a Ticket

Arguments

id

Unique identifier for the object.

context

Scope under which the request is made; determines fields present in response.

Default: view

One of: view, embed, edit

Definition

GET /wpas-api/v1/tickets/<id>

Example Request

$ curl http://demo.getawesomesupport.com/wp-json/wpas-api/v1/tickets/<id>

Create a Ticket

Arguments

date

The date the object was published, in the site's timezone.

date_gmt

The date the object was published, as GMT.

slug

An alphanumeric identifier for the object unique to its type.

status

A named status for the object.

Default: queued

One of: publish, future, draft, pending, private, queued, processing, hold, read, unread

title

The title for the object.

Required: true

content

The content for the object.

Required: true

ticket-tag

The terms assigned to the object in the ticket-tag taxonomy.

product

The terms assigned to the object in the product taxonomy.

department

The terms assigned to the object in the department taxonomy.

ticket_priority

The terms assigned to the object in the ticket_priority taxonomy.

ticket_channel

The terms assigned to the object in the ticket_channel taxonomy.

Default: web-service-api

state

Limit result set to tickets in the specified state.

Default: open

author

The ID for the author of the object.

assignee

The agent assigned to this ticket

Default: 4

secondary-assignee

The secondary assignee for this ticket

tertiary-assignee

The tertiary assignee for this ticket

customer-reply-count

The number of customer replies to this ticket

agent-reply-count

The number of agent replies to this ticket

total-reply-count

The number of total replies to this ticket

time-calculated

The gross time calculated for ticket in minutes

time-adjustments

The time adjustments for ticket in minutes

time-adjustments-type

The type of time adjustment, positive or negative.

time-notes

The notes for the time

Definition

POST /wpas-api/v1/tickets

Update a Ticket

Arguments

id

Unique identifier for the object.

date

The date the object was published, in the site's timezone.

date_gmt

The date the object was published, as GMT.

slug

An alphanumeric identifier for the object unique to its type.

status

A named status for the object.

One of: publish, future, draft, pending, private, queued, processing, hold, read, unread

title

The title for the object.

content

The content for the object.

ticket-tag

The terms assigned to the object in the ticket-tag taxonomy.

product

The terms assigned to the object in the product taxonomy.

department

The terms assigned to the object in the department taxonomy.

ticket_priority

The terms assigned to the object in the ticket_priority taxonomy.

ticket_channel

The terms assigned to the object in the ticket_channel taxonomy.

state

Limit result set to tickets in the specified state.

author

The ID for the author of the object.

assignee

The agent assigned to this ticket

secondary-assignee

The secondary assignee for this ticket

tertiary-assignee

The tertiary assignee for this ticket

customer-reply-count

The number of customer replies to this ticket

agent-reply-count

The number of agent replies to this ticket

total-reply-count

The number of total replies to this ticket

time-calculated

The gross time calculated for ticket in minutes

time-adjustments

The time adjustments for ticket in minutes

time-adjustments-type

The type of time adjustment, positive or negative.

time-notes

The notes for the time

Definition

POST /wpas-api/v1/tickets/<id>

Example Request

$ curl -X POST http://awesomesupport.dev/wp-json -d '{"title":"My New Title"}'

Delete a Ticket

Arguments

id

Unique identifier for the object.

force

Whether to bypass trash and force deletion.

Definition

DELETE /wpas-api/v1/tickets/<id>

Example Request

$ curl -X DELETE http://demo.getawesomesupport.com/wp-json/wpas-api/v1/tickets/<id>