importplivoclient=plivo.RestClient(auth_id="<auth_id>",auth_token="<auth_token>")# Add Tollfree to a Powerpack
powerpack=client.powerpacks.get(uuid='<powerpack_uuid>')# Version 1
response=powerpack.add_tollfree('<tollfree_number>')# Version 2
response=powerpack.numberpool.tollfree.add('<tollfree_number>')print(response)
require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")begin# Add a Tollfree Numberpowerpack=api.powerpacks.get('<powerpack_uuid>')# Version 1response=powerpack.add_tollfree('<tollfree_number>')# Version 2response=powerpack.numberpool.tollfree.add('<tollfree_number>')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>');// Add Tollfree to a Powerpackclient.powerpacks.get("<powerpack_uuid>").then(function(powerpack){returnpowerpack.add_tollfree("<tollfree>")//return powerpack.number_pool.tollfree.add("<tollfree>"); 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);// Add a TollFree to Powerpacktry{$powerpack=$client->powerpacks->get($powerpack_uuid);// Version 1$response=$powerpack->add_tollfree($tollfree_number);// Version 2 $response=$powerpack->number_pool->tollfree->add($tollfree_number);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;publicclassTest{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");// Add Tollfree to Powerpacktry{Powerpackpowerpack=Powerpack.getter("<powerpack_uuid>").get();// Version 1Tollfreeresponse=powerpack.add_tollfree().tollfree("<tollfree>").get();//Version 2Tollfreeresponse=powerpack.numberpool.tollfree.add().tollfree("<tollfree>").get();}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{classProgram{staticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");// Add Tollfree to Powerpacktry{varpowerpack=api.Powerpacks.Get("<powerpack_uuid>");// Version 1// var response = powerpack.Add_Tollfree("<tollfree_number>");// Version 2varresponse=powerpack.numberpool.tollfree.Add("<tollfree_number>");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}// Add Tollfree to Powerpackpowerpack,err:=client.Powerpack.Get("<powerpack_uuid>")iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=powerpack.Add_tollfree("<tollfree_number>")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>")# Add Tollfree to a Powerpack
powerpack=client.powerpacks.get(uuid='<powerpack_uuid>')# Version 1
response=powerpack.add_tollfree('<tollfree_number>')# Version 2
response=powerpack.numberpool.tollfree.add('<tollfree_number>')print(response)
require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")begin# Add a Tollfree Numberpowerpack=api.powerpacks.get('<powerpack_uuid>')# Version 1response=powerpack.add_tollfree('<tollfree_number>')# Version 2response=powerpack.numberpool.tollfree.add('<tollfree_number>')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>');// Add Tollfree to a Powerpackclient.powerpacks.get("<powerpack_uuid>").then(function(powerpack){returnpowerpack.add_tollfree("<tollfree>")//return powerpack.number_pool.tollfree.add("<tollfree>"); 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);// Add a TollFree to Powerpacktry{$powerpack=$client->powerpacks->get($powerpack_uuid);// Version 1$response=$powerpack->add_tollfree($tollfree_number);// Version 2 $response=$powerpack->number_pool->tollfree->add($tollfree_number);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;publicclassTest{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");// Add Tollfree to Powerpacktry{Powerpackpowerpack=Powerpack.getter("<powerpack_uuid>").get();// Version 1Tollfreeresponse=powerpack.add_tollfree().tollfree("<tollfree>").get();//Version 2Tollfreeresponse=powerpack.numberpool.tollfree.add().tollfree("<tollfree>").get();}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{classProgram{staticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");// Add Tollfree to Powerpacktry{varpowerpack=api.Powerpacks.Get("<powerpack_uuid>");// Version 1// var response = powerpack.Add_Tollfree("<tollfree_number>");// Version 2varresponse=powerpack.numberpool.tollfree.Add("<tollfree_number>");Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}