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.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| count | Integer | 1 to return a count, 0 to return full data. | No | 0 |
| customer | Integer | ID of customer to get tickets for. | No | Customer of authentication user. |
| customers | Integer | 1 to return tickets created by the customers of this customer, 0 to return tickets created by this customer. | No | 0 |
| descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
| limit | Integer | The maximum results to return. 0 for all. | No | 0 |
| offset | Integer | The result to start at. 0 for the first. | No | 0 |
| pages | Integer | 1 to return a reduced set of data for generating the pages select box, 0 to return full data. | No | 0 |
| status | String | Only return tickets with this status. "closed", "customer", "open", or "parent". "open" returns tickets with the "customer" or "parent" status. | No | "open" |
| sort | String | Field to sort by. "created", "status", or "updated". | No | "created" |
Responses
| Code | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid customer specified. |
| 401 | The authentication details provided are invalid. |
| 403 | Your rate plan does not allow this. |
| 402 | Your 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
| Version | Changes |
|---|---|
| 3.15 | Function added. |
