JSON API » requests » requests/list
Gets the fields of requests in the given customer. The customer is the system owner or reseller whom the request is addressed to, normally the parent of the customer who made the request.
Input parameters
Requires authentication and the commerce role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
customer | Integer | ID of customer to get requests for. | No | Customer of authentication user. |
status | String | Only return requests with this status. "approved", "new", "rejected", or empty string for all. | No | Empty string. |
sort | String | Field to sort by. "amount", "created", "status", "type", or "updated". | No | "created" |
descending | Integer | 1 to sort descending, 0 not to. | No | 0 |
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid customer specified. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
Data returned
An array of fields, corresponding to the rows of the requests table in the database.
Example: With required parameters
http://enswitch.example.com/api/json/requests/list/?auth_username=user;auth_password=password{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "customer":123, ... }, { "id":2, "customer":123, ... } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |