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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
customerIntegerID of customer to get requests for.NoCustomer of authentication user.
statusStringOnly return requests with this status. "approved", "new", "rejected", or empty string for all.NoEmpty string.
sortStringField to sort by. "amount", "created", "status", "type", or "updated".No"created"
descendingInteger1 to sort descending, 0 not to.No0

Responses

CodeDescription
200Success.
400Invalid customer specified.
401The authentication details provided are invalid.
402Your 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

VersionChanges
3.13Function added.