Get Phone Numbers for an Organization with Given Criteria
List all the phone numbers for the given organization along with the status and owner (if any).
Numbers can be standard, service, or mobile. Both standard and service numbers are PSTN numbers. Service numbers are considered high-utilization or high-concurrency phone numbers and can be assigned to features like auto-attendants, call queues, and hunt groups. Phone numbers can be linked to a specific location, be active or inactive, and be assigned or unassigned. The owner of a number is the person, workspace, or feature to which the number is assigned. Only a person can own a mobile number.
Retrieving this list requires a full or read-only administrator or location administrator auth token with a scope of spark-admin:telephony_config_read
.
Query Parameters
List numbers for this organization.
Return the list of phone numbers for this location within the given organization. The maximum length is 36.
Limit the number of phone numbers returned to this maximum count. The default is 2000.
Start at the zero-based offset in the list of matching phone numbers. The default is 0.
Search for this phoneNumber
.
Search among the available phone numbers. This parameter cannot be used along with ownerType
parameter when set to true
.
Sort the list of phone numbers based on the following:lastName
,dn
,extension
. Sorted by number and extension in ascending order.
Return the list of phone numbers that are owned by the given ownerName
. Maximum length is 255.
Returns only the matched number/extension entries assigned to the feature with the specified UUID or broadsoftId
.
Returns the list of phone numbers of the given ownerType
. Possible input values:
Returns the list of phone numbers with the given extension.
Returns the filtered list of phone numbers that contain a given type of number. numberType
cannot be used along with the available
or state
query parameters. Possible input values:
Returns the filtered list of phone numbers of the given phoneNumberType
. Response excludes any extensions without numbers. Possible input values:
Returns the list of phone numbers with the matching state. Response excludes any extensions without numbers. Possible input values:
Returns the overall count of the phone numbers along with other details for a given organization.
Returns the list of toll-free phone numbers.
Returns the list of restricted non-geographical numbers.
Returns the list of phone numbers that are of given includedTelephonyTypes
. By default, if this query parameter is not provided, it will list both PSTN and Mobile Numbers. Possible input values are PSTN_NUMBER or MOBILE_NUMBER.
Returns the list of service phone numbers.
Response Properties
Array of phone numbers.
A unique identifier for the phone number.
Extension for a phone number.
Routing prefix of location.
Routing prefix + extension of a person or workspace.
Phone number's state.
Returns the filtered list of phone numbers of the given phoneNumberType
. Response excludes any extensions without numbers. Possible input values:
Filter the results to include only primary phone numbers.
Filter the results to include only alternate phone numbers.
Filter the results to include only FAX phone numbers.
Filter the results to include only Dialed Number Identification Service (DNIS) phone numbers.
Filter the results to include all numbers.
If true
, the phone number is used as location CLID.
The telephony type for the number.
The number is a PSTN number.
The number is a mobile number.
Mobile Network for the number if the number is MOBILE_NUMBER.
Routing Profile for the number if the number is MOBILE_NUMBER.
If true
, the phone number is a toll-free number.
If true
, the phone number is a service number; otherwise, it is a standard number.
ID of location in which phone number exists.
Name of the location for phone number.
ID of the owner to which phone number is assigned.
Type of the phone number's owner.
The PSTN phone number's owner is a workspace.
The phone number's owner is a person.
The PSTN phone number's owner is a virtual line.
The PSTN phone number's owner is an auto-attendant.
The PSTN phone number's owner is a call queue.
The PSTN phone number's owner is a group paging.
The PSTN phone number's owner is a hunt group.
The PSTN phone number's owner is a voice messaging.
The PSTN phone number's owner is a Single Number Reach.
The PSTN phone number's owner is a Contact Center link.
The PSTN phone number's owner is a Contact Center adapter.
The PSTN phone number's owner is a route list.
The PSTN phone number's owner is a voicemail group.
The PSTN phone number's owner is a collaborate bridge.
First name of the phone number's owner.
Last name of the phone number's owner.
Count of phone numbers categorized by type or their states, such as assigned or unassigned.
Count of phone numbers that are in the assigned state.
Count of phone numbers which are in the un-assigned state.
Count of phone numbers which are inactive.
Count of extensions only without phone number.
Count of the toll free numbers.
Total phone numbers and extensions available.
Count of phone numbers of type MOBILE_NUMBER
only without PSTN_NUMBER
and extension.
Count of phone numbers with includedTelephonyTypes
as PSTN_NUMBER
and isServiceNumber
value as true
.
Response Codes
The list below describes the common success and error responses you should expect from the API:
Code | Status | Description |
---|---|---|
200 | OK | Successful request with body content. |
201 | Created | The request has succeeded and has led to the creation of a resource. |
202 | Accepted | The request has been accepted for processing. |
204 | No Content | Successful request without body content. |
400 | Bad Request | The request was invalid or cannot be otherwise served. An accompanying error message will explain further. |
401 | Unauthorized | Authentication credentials were missing or incorrect. |
403 | Forbidden | The request is understood, but it has been refused or access is not allowed. |
404 | Not Found | The URI requested is invalid or the resource requested, such as a user, does not exist. Also returned when the requested format is not supported by the requested method. |
405 | Method Not Allowed | The request was made to a resource using an HTTP request method that is not supported. |
409 | Conflict | The request could not be processed because it conflicts with some established rule of the system. For example, a person may not be added to a room more than once. |
410 | Gone | The requested resource is no longer available. |
415 | Unsupported Media Type | The request was made to a resource without specifying a media type or used a media type that is not supported. |
423 | Locked | The requested resource is temporarily unavailable. A Retry-After header may be present that specifies how many seconds you need to wait before attempting the request again. |
428 | Precondition Required | File(s) cannot be scanned for malware and need to be force downloaded. |
429 | Too Many Requests | Too many requests have been sent in a given amount of time and the request has been rate limited. A Retry-After header should be present that specifies how many seconds you need to wait before a successful request can be made. |
500 | Internal Server Error | Something went wrong on the server. If the issue persists, feel free to contact the Webex Developer Support team. |
502 | Bad Gateway | The server received an invalid response from an upstream server while processing the request. Try again later. |
503 | Service Unavailable | Server is overloaded with requests. Try again later. |
504 | Gateway Timeout | An upstream server failed to respond on time. If your query uses max parameter, please try to reduce it. |
Header
Query Parameters
- orgIdstringList numbers for this organization.
- locationIdstringReturn the list of phone numbers for this location within the given organization. The maximum length is 36.
- maxnumberLimit the number of phone numbers returned to this maximum count. The default is 2000.
- startnumberStart at the zero-based offset in the list of matching phone numbers. The default is 0.
- phoneNumberstringSearch for this `phoneNumber`.
- availablebooleanSearch among the available phone numbers. This parameter cannot be used along with `ownerType` parameter when set to `true`.
- orderstringSort the list of phone numbers based on the following:`lastName`,`dn`,`extension`. Sorted by number and extension in ascending order.
- ownerNamestringReturn the list of phone numbers that are owned by the given `ownerName`. Maximum length is 255.
- ownerIdstringReturns only the matched number/extension entries assigned to the feature with the specified UUID or `broadsoftId`.
- ownerTypeenumReturns the list of phone numbers of the given `ownerType`. Possible input values:
- extensionstringReturns the list of phone numbers with the given extension.
- numberTypeenumReturns the filtered list of phone numbers that contain a given type of number. `numberType` cannot be used along with the `available` or `state` query parameters. Possible input values:
- phoneNumberTypeenumReturns the filtered list of phone numbers of the given `phoneNumberType`. Response excludes any extensions without numbers. Possible input values:
- stateenumReturns the list of phone numbers with the matching state. Response excludes any extensions without numbers. Possible input values:
- detailsbooleanReturns the overall count of the phone numbers along with other details for a given organization.
- tollFreeNumbersbooleanReturns the list of toll-free phone numbers.
- restrictedNonGeoNumbersbooleanReturns the list of restricted non-geographical numbers.
- includedTelephonyTypesarray[TelephonyType]Returns the list of phone numbers that are of given `includedTelephonyTypes`. By default, if this query parameter is not provided, it will list both PSTN and Mobile Numbers. Possible input values are PSTN_NUMBER or MOBILE_NUMBER.
- serviceNumberbooleanReturns the list of service phone numbers.
{ "count": { "assigned": 33, "unAssigned": 114, "inActive": 12, "extensionOnly": 692, "tollFreeNumbers": 1, "total": 839, "mobileNumber": 6, "serviceNumber": 1 }, "phoneNumbers": [ { "phoneNumber": "+12056350001", "extension": "11", "routingPrefix": "1234", "esn": "123411", "state": "ACTIVE", "phoneNumberType": "FAX", "mainNumber": false, "includedTelephonyTypes" : "MOBILE_NUMBER", "mobileNetwork" : "mobileNetwork", "routingProfile" : "AttRtPf", "tollFreeNumber": false, "isServiceNumber": false, "location": { "id": "Y2lzY29zcGFyazovL3VzL0xPQ0FUSU9OL2E4Mjg5NzIyLTFiODAtNDFiNy05Njc4LTBlNzdhZThjMTA5OA", "name": "Banglore" }, "owner": { "id": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9jODhiZGIwNC1jZjU5LTRjMjMtODQ4OC00NTNhOTE3ZDFlMjk", "type": "PEOPLE", "firstName": "sadiqhussain96", "lastName": "sadiqhussain96" } }, { "phoneNumber": null, "extension": "568", "routingPrefix": "1234", "esn": "1234568", "mainNumber": false, "includedTelephonyTypes" : "PSTN_NUMBER", "tollFreeNumber": false, "isServiceNumber": false, "location": { "id": "Y2lzY29zcGFyazovL3VzL0xPQ0FUSU9OL2M2MDliOGE1LTAxNmQtNDAwNy1hN2E0LTJhMThiZmZjY2FmNg", "name": "Richardson" }, "owner": { "id": "Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNzVkMjI4Mi0yZjk1LTQ2MmMtYjFiNC1kYjRlZjU1OTk3MWE", "type": "PEOPLE", "firstName": "chandru_2", "lastName": "test_2" } }, { "phoneNumber": "+12026282002", "state": "ACTIVE", "phoneNumberType": "PRIMARY", "mainNumber": true, "includedTelephonyTypes": "PSTN_NUMBER", "tollFreeNumber": false, "isServiceNumber": true, "location": { "id": "Y2lzY29zcGFyazovL3VzL0xPQ0FUSU9OLzEwN2EzNTkwLWY3OWMtNGM0OS1iM2I2LWQ1MzhjYTA0YWU1MA", "name": "Washington" } } ] }