JSON API » tickets » tickets/list

Gets the fields of tickets created by the given customer if customers=0, or created by all the customers of the given customer if customers=1.

Input parameters

Requires authentication and the administrator or commerce role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
countInteger1 to return a count, 0 to return full data.No0
customerIntegerID of customer to get tickets for.NoCustomer of authentication user.
customersInteger1 to return tickets created by the customers of this customer, 0 to return tickets created by this customer.No0
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
offsetIntegerThe result to start at. 0 for the first.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
statusStringOnly return tickets with this status. "closed", "customer", "open", or "parent". "open" returns tickets with the "customer" or "parent" status.No"open"
sortStringField to sort by. "created", "status", or "updated".No"created"

Responses

CodeDescription
200Success.
400Invalid customer specified.
401The authentication details provided are invalid.
403Your rate plan does not allow this.
402Your role does not allow this.

Data returned

An array of fields, corresponding to the rows of the tickets table in the database.

Example: Listing tickets customer support needs to reply to

http://enswitch.example.com/api/json/tickets/list/?auth_username=user;auth_password=password;status=parent;customers=1

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "customer":123, ... }, { "id":2, "customer":123, ... } ] }

Example: Listing tickets that have been replied to by customer support, and awaiting customer

http://enswitch.example.com/api/json/tickets/list/?auth_username=user;auth_password=password;status=customer

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "customer":123, ... }, { "id":2, "customer":123, ... } ] }

Change history

VersionChanges
3.15Function added.