JSON API » numbers » numbers/list

Gets the fields of all numbers visible to the user in the given customer.

Input parameters

Requires authentication and the user or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
calleridInteger1 to return numbers that can be used as callerid (including callerid only numbers), 0 to return all normal numbers.No0
callerid_locationInteger1 to return numbers that can be used as location callerid (including callerid only numbers), 0 to return all normal numbers.No0
customerIntegerID of customer to get numbers for.NoCustomer of authentication user.
countInteger1 to return a count, 0 to return full data.No0
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
pagesInteger1 to return a reduced set of data for generating the pages select box, 0 to return full data.No0
sortStringField to sort by. "destination", "dnumber", or "number".No"number"

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 numbers table in the database.

Example: With required parameters

http://enswitch.example.com/api/json/numbers/list/?auth_username=user;auth_password=password

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":[ { "number":"2125551234", "description":"example1", ... }, { "number":"2125551235", "description":"example2", ... } ] }

Change history

VersionChanges
3.13Function added.