This API returns the list of toll-free numbers from the number pool.
The API response contains a meta field with the following fields:
limit: The size of the page returned in the response.
next: The URL that points to the next page of results. (Currently this will be blank because only one toll-free can be present in a number pool.)
offset: The offset for the page returned in the response.
previous: The URL that points to the previous page of results. (Currently this will be blank because only one toll-free can be present in a number pool.)
total_count: The total number of records that match the specified filters. (Currently this is always 1.)
importplivoclient=plivo.RestClient(auth_id="<auth_id>",auth_token="<auth_token>")# List all Tollfree in a Powerpack
powerpack=client.powerpacks.get(uuid='<powerpack_uuid>')# Version 1
response=powerpack.list_tollfree()# Version 2
response=powerpack.numberpool.tollfree.list()print(response)
require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")begin# List all tollfree numberspowerpack=api.powerpacks.get('<powerpack_uuid>')# Version 1response=powerpack.list_tollfree()# Version 2response=response.numberpool.tollfree.list()puts(response)rescuePlivoRESTError=>eputs'Exception: '+e.messageend
1
2
3
4
5
6
7
8
9
10
11
12
13
letplivo=require('plivo');letclient=newplivo.Client('<auth_id>','<auth_token>');// List all Tollfree in a Powerpackclient.powerpacks.get("<powerpack_uuid>").then(function(powerpack){returnpowerpack.list_tollfree()// return powerpack.number_pool.tollfree.list() V2}).then(function(result){console.log(result)})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?phprequire'vendor/autoload.php';usePlivo\RestClient;$client=newRestClient("<auth_id>","<auth_token>");$client->client->setTimeout(40);// List all Tollfree in a Powerpacktry{$powerpack=$client->powerpacks->get("<powerpack_uuid>");// Version 1$response=$powerpack->list_tollfree();// Version 2$response=$powerpack->number_pool->tollfree->list();print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api;importjava.io.IOException;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.powerpack.Powerpack;importcom.plivo.api.models.powerpack.Tollfree;importcom.plivo.api.models.base.ListResponse;publicclassTest{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");// List all Tollfree in a Powerpacktry{Powerpackpowerpack=Powerpack.getter("<powerpack_uuid>").get();// Version 1ListResponse<Tollfree>response=powerpack.list_tollfree().list();//Version 2ListResponse<Tollfree>response=powerpack.numberpool.tollfree.list().list();}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{classProgram{staticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");// List all Tollfree in a Powerpacktry{varpowerpack=api.Powerpacks.Get("<powerpack_uuid>");// Version 1varresponse=powerpack.List_Tollfree();// Version 2varresponse=powerpack.numberpool.tollfree.List();Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}
packagemainimport("fmt"plivo"github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}// List all Tollfree in a Powerpackpowerpack,err:=client.Powerpack.Get("<powerpack_uuid>")iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=powerpack.List_tollfree()iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}
Example Request
1
2
3
4
5
6
7
8
9
10
importplivoclient=plivo.RestClient(auth_id="<auth_id>",auth_token="<auth_token>")# List all Tollfree in a Powerpack
powerpack=client.powerpacks.get(uuid='<powerpack_uuid>')# Version 1
response=powerpack.list_tollfree()# Version 2
response=powerpack.numberpool.tollfree.list()print(response)
require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")begin# List all tollfree numberspowerpack=api.powerpacks.get('<powerpack_uuid>')# Version 1response=powerpack.list_tollfree()# Version 2response=response.numberpool.tollfree.list()puts(response)rescuePlivoRESTError=>eputs'Exception: '+e.messageend
1
2
3
4
5
6
7
8
9
10
11
12
13
letplivo=require('plivo');letclient=newplivo.Client('<auth_id>','<auth_token>');// List all Tollfree in a Powerpackclient.powerpacks.get("<powerpack_uuid>").then(function(powerpack){returnpowerpack.list_tollfree()// return powerpack.number_pool.tollfree.list() V2}).then(function(result){console.log(result)})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?phprequire'vendor/autoload.php';usePlivo\RestClient;$client=newRestClient("<auth_id>","<auth_token>");$client->client->setTimeout(40);// List all Tollfree in a Powerpacktry{$powerpack=$client->powerpacks->get("<powerpack_uuid>");// Version 1$response=$powerpack->list_tollfree();// Version 2$response=$powerpack->number_pool->tollfree->list();print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api;importjava.io.IOException;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.powerpack.Powerpack;importcom.plivo.api.models.powerpack.Tollfree;importcom.plivo.api.models.base.ListResponse;publicclassTest{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");// List all Tollfree in a Powerpacktry{Powerpackpowerpack=Powerpack.getter("<powerpack_uuid>").get();// Version 1ListResponse<Tollfree>response=powerpack.list_tollfree().list();//Version 2ListResponse<Tollfree>response=powerpack.numberpool.tollfree.list().list();}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{classProgram{staticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");// List all Tollfree in a Powerpacktry{varpowerpack=api.Powerpacks.Get("<powerpack_uuid>");// Version 1varresponse=powerpack.List_Tollfree();// Version 2varresponse=powerpack.numberpool.tollfree.List();Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}
packagemainimport("fmt"plivo"github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}// List all Tollfree in a Powerpackpowerpack,err:=client.Powerpack.Get("<powerpack_uuid>")iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=powerpack.List_tollfree()iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input
for further improvements!