Customers REST API Route
Authentication #
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.
Schema #
When working with the Customers REST API route the following fields can be expected in any responses.
idinteger |
Unique identifier for the customer Read Only |
namestring |
The name of the customer |
user_idinteger |
The WP user ID of the customer |
emailstring |
The email address of the customer |
additional_emailsobject |
List of additional email addresses of the customer |
phoneobject |
Primary and additional phone numbers of the customer |
websitestring |
Website address of the customer |
addressstring |
Address of the customer |
companyinteger |
ID of the company for which the customer is associated |
date_createdstring |
Date the customer was created in website timezone |
notesobject |
List of notes added against the customer |
ticket_countinteger |
Number of tickets that the customer has logged |
List Customers #
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.
Definition #
GET /kbs/v1/customers
Example Request #
$ curl https://example.com/wp-json/kbs/v1/customers
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 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: descOne of: asc, desc |
orderby |
Sort collection by object attribute Default: idOne 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 |
Retrieve a Single Customer #
Definition #
GET /kbs/v1/agents/<id>
Example Request #
$ curl https://example.com/wp-json/kbs/v1/customers/<id>
Arguments #
id |
ID or email address of the customer to retrieve |
