List Resources

View as Markdown

Use this endpoint for the AvailablePhoneNumbers method to return a list of URIs to phone number resources available to the account. The list is categorized by type (Local, Toll-Free, Mobile, etc) and ISO country.

Path parameters

AccountSidstringRequiredformat: "uuid"
The Project ID that uniquely identifies the Account to retrieve.

Response

uristringRequired
The URI for the API call.
countrieslist of objectsRequired
List of available countries.
Response
1{
2 "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers",
3 "countries": [
4 {
5 "country_code": "US",
6 "country": "United States",
7 "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US",
8 "beta": false,
9 "subresource_uris": {
10 "local": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/Local",
11 "toll_free": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/TollFree"
12 }
13 }
14 ]
15}

Request examples

List all resources

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client
5 .availablePhoneNumbers()
6 .then(availablePhoneNumbers => {
7 console.log(availablePhoneNumbers);
8 });

List resources in US

This example returns a list of URIs to phone number resources available to the account in the US ISO country. The URIs are categorized by type (Local, Toll-Free, Mobile, etc).

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client
5 .availablePhoneNumbers('US')
6 .fetch()
7 .then(availablePhoneNumbers => {
8 console.log(availablePhoneNumbers);
9 });
Response
1{
2 "country_code": "US",
3 "country": "United States",
4 "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US",
5 "beta": false,
6 "subresource_uris": {
7 "local": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/Local",
8 "toll_free": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/TollFree"
9 }
10}