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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
countInteger1 to return a count, 0 to return full data.No0
customerIntegerID of customer to get telephone lines for.NoCustomer of authentication user.
descendingInteger1 to sort descending, 0 not to.No0
limitIntegerThe maximum results to return. 0 for all.No0
offsetIntegerThe result to start at. 0 for the first.No0
ownerIntegerID 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.No0
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
passwordInteger1 to return telephone lines' passwords, 0 not to. See note below.No0
sortStringField to sort by. "description" or "name".No"name"

Administrators are returned the passwords of all telephone lines. Other users are returned only the passwords of telephone lines they own.

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 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:

NameTypeDescription
displayStringThe 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

VersionChanges
4.3Function no longer returns provision1 field.
3.14password input parameter added.
3.13Function added.