JSON API » customers » customers/list
Gets the fields of all customers.
Input parameters
Requires authentication and the callshop or commerce role privileges.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
deleted | Integer | 1 to only return deleted customers, 0 to only return non-deleted customers. | Recommended | Any. |
bill_type | String | Only return customers with this billing type. Empty string for any. | No | Empty string. |
count | Integer | 1 to return a count, 0 to return full data. | No | 0 |
directory | Integer | 1 to only return customers with directory enabled, 0 to only return customers with direct disabled. | No | Any. |
limit | Integer | The maximum results to return. 0 for all. | No | 0 |
name | String | Only return customers whose name contains this string. | No | Empty string. |
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 |
parent | Integer | ID of parent customer. | No | Customer of authentication user. |
recursive | Integer | 1 to return sub-customers recursively, 0 not to. Has no effect if count or pages is specified. | No | 0 |
Responses
Code | Description |
---|---|
200 | Success. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
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 customers table in the database.
Example: With required and recommended parameters
https://www.015pbx.net/local/api/json/customers/list/?auth_username=user;auth_password=password;deleted=0{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":"1", "name":"example1", ... }, { "id":"2", "name":"example2", ... }, ] }