JSON API » phones » phones/list
Gets the fields of all telephone lines visible to the user in the given customer.
Input parameters
Requires authentication and the residential or user 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 telephone lines for. | No | Customer of authentication user. |
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 |
owner | Integer | ID of owner to get telephone lines for. 0 to return all telephone lines if administrator or wholesale role, or only telephone lines owned by calling person otherwise. -1 to return all telephone lines. ID of person to return telephone lines owned by that person. | 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 |
sort | String | Field to sort by. "description" or "name". | No | "name" |
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 phones table in the database. See phones/update for the meaning of most of these fields. In addition, for each telephone line the following extra field is returned:
Name | Type | Description |
---|---|---|
display | String | The name of the telephone line for display purposes. |
Example: With required parameters
http://enswitch.example.com/api/json/phones/list/?auth_username=user;auth_password=password{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "id":1, "name":"1234567", ... }, { "id":2, "name":"1234568", ... } ] }
Change history
Version | Changes |
---|---|
3.13 | Function added. |