Check out our server SDKs page and install the right helper based on the programming language you want to use.
Buy a Plivo phone number. A phone number is required to receive calls. You can buy a Plivo phone number in over 20+ countries through the Buy Numbers tab on your Plivo account UI. Check the Voice API coverage page for all the supported countries.
Use a web hosting service to host your web application. There are many inexpensive cloud hosting providers that you can use for just a few dollars a month. Follow the instructions of your hosting provider to host your web application.
List All Rented Numbers
This API call returns a list with the details of all numbers rented under your Plivo account.
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Get all numbers
params={'limit':'10','offset':'0'}response=p.get_numbers()printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Get all numbersparams={'limit'=>'10',# Used to display the number of results per page.'offset'=>'0'# Denotes the number of value items by which the results should be offset. }response=p.get_numbers(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Get details of all numbersvarparams={'limit':'10','offset':'0'};p.get_numbers(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# Get all numbers$params=array('limit'=>'10',# Used to display the number of results per page.'offset'=>'0'# Denotes the number of value items by which the results should be offset. );$response=$p->get_numbers($params);print_r($response);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.number.NumberSearchFactory;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");// Get all numbersLinkedHashMap<String,String>parameters=newLinkedHashMap<String,String>();parameters.put("limit","10");// Used to display the number of results per page. parameters.put("offset","0");// Denotes the number of value items by which the results should be offset. try{NumberSearchFactoryresp=api.getNumbers(parameters);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Get all numbersIRestResponse<NumberList>resp=plivo.get_numbers(newDictionary<string,string>(){{"limit","10"},// The number of results per page{"offset","0"},// The number of value items by which the results should be offset});Console.WriteLine(resp.Content);}}}
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)//Getdetailsofasinglenumberparams={'number':'444444444444'# PHone number for which the details have to be retrieved
}response=p.get_number(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Get details of a single numberparams={'number'=>'444444444444'# Phone number for which the details have to be retrieved}response=p.get_number(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Get details of a single numbervarparams={'number':'444444444444'// Phone number for which the details have to be retrieved};p.get_number_details(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# Get details of a single number$params=array('number'=>'444444444444'# PHone number for which the details have to be retrieved);$response=$p->get_number($params);print_r($response);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.number.NumberSearchFactory;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");// Get details of a single numberLinkedHashMap<String,String>parameters=newLinkedHashMap<String,String>();parameters.put("number","444444444444");// Phone number for which the details have to be retrieved try{Numberresp=api.getNumber(parameters);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Get details of a single numberIRestResponse<Number>res=plivo.get_number(newDictionary<string,string>(){{"number","444444444444"}// Phone number for which the details have to be retrieved});Console.WriteLine(res.Content}}}
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Modify a number
params={'number':'11111111111',# Number that has to be modified
'alias':'testing'# The textual name given to the number
}response=p.modify_number(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Modify a numberparams={'number'=>'11111111111',# Number that has to be modified'alias'=>'testing'# The textual name given to the number}response=p.modify_number(params)putsstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Modify a numbervarparams={'number':'11111111111',// Number that has to be modified'alias':'testing'// The textual name given to the number};p.edit_number(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);// Modify alias of a number$params=array('number'=>'11111111111',# Phone number for which the details have to be retrieved'alias'=>'testing'# The textual name given to the number);$response=$p->modify_number($params);print_r($response);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.account.SubAccount;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");// Modify a numberLinkedHashMap<String,String>params=newLinkedHashMap<String,String>();params.put("number","11111111111");// Number that has to be modifiedparams.put("alias","testing");// The textual name given to the numbertry{GenericResponseresp=api.editNumber(params);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Modify a numberIRestResponse<GenericResponse>res=plivo.modify_number(newDictionary<string,string>(){{"numebr","11111111111"},// Number that has to be modified{"alias","testing"}// The textual name given to the number});//Prints the responseConsole.Write(res.Content);}}}
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Link an application to a number
params={'number':'444444444444',# Number that has to be linked to an application
'app_id':'16638156474000802'# Application ID that has to be linked
}response=p.link_application_number(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Link an application to a numberparams={'number'=>'444444444444',# Number that has to be linked to an application'app_id'=>'16638156474000802'# Application ID that has to be linked}response=p.link_application_number(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Link an application to a numbervarparams={'number':'444444444444',// Number that has to be linked to an application'app_id':'16638156474000802'// Application ID that has to be linked};p.link_application_number(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# Link an application to a number$params=array('number'=>'444444444444',# Number that has to be linked to an application'app_id'=>'16638156474000802'# Application ID that has to be linked);$response=$p->link_application_number($params);print_r($response);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.response.GenericResponse;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");// Link an application to a phone numberLinkedHashMap<String,String>parameters=newLinkedHashMap<String,String>();parameters.put("number","444444444444");parameters.put("app_id","16638156474000802");try{GenericResponseresp=api.linkApplicationNumber(parameters);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Link an application to a phone number IRestResponse<GenericResponse>resp=plivo.link_application_number(newDictionary<string,string>(){{"number","444444444444"},// Number that has to be linked to an application{"app_id","16638156474000802"}// Application ID that has to be linked});Console.WriteLine(resp.Content);}}}
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Unlink an application from an number
params={'number':'444444444444'# Number that has to be unlikned to an application
}response=p.unlink_application_number(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Unlink an application from an numberparams={'number'=>'444444444444'# Number that has to be unlikned to an application}response=p.unlink_application_number(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Unlink an application from an numbervarparams={'number':'444444444444'// Number that has to be unlikned to an application};p.unlink_application_number(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# Unlink an application from an number$params=array('number'=>'444444444444'# Number that has to be unlikned to an application);$response=$p->unlink_application_number($params);print_r($response);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.response.GenericResponse;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");// Unlink an application from a phone numberLinkedHashMap<String,String>param=newLinkedHashMap<String,String>();param.put("number","444444444444");try{GenericResponseresp=api.unlinkApplicationNumber(param);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Unlink an application from a phone number IRestResponse<GenericResponse>response=plivo.unlink_application_number(newDictionary<string,string>(){{"number","444444444444"}// Number that has to be unlikned to an application});Console.WriteLine(response.Content);}}}
1
2
3
curl -X POST -i--user AUTH_ID:AUTH_TOKEN \-H"Content-Type: application/json"\
https://api.plivo.com/v1/Account/{auth_id}/Number/444444444444/
Relinquish a Number
This API lets you relinquish a number on Plivo. Upon successful execution, the number will no longer be usable or accessible from your Plivo account. This operation cannot be undone.
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)# Unrent a number
params={'number':'1111111111'# Number that has to be unrented
}response=p.unrent_number(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require'rubygems'require'plivo'includePlivoAUTH_ID="Your AUTH_ID"AUTH_TOKEN="Your AUTH_TOKEN"p=RestAPI.new(AUTH_ID,AUTH_TOKEN)# Unrent a numberparams={'number'=>'1111111111'# Number that has to be unrented}response=p.unrent_number(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});// Unrent a numbervarparams={'number':'1111111111',// Number that has to be unrented};p.unrent_number(params,function(status,response){console.log('Status: ',status);console.log('API Response:\n',response);});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);# Unrent a number$params=array('number'=>'1111111111'# Number that has to be unrented);$response=$p->unrent_number($params);print_r($response);?>
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");// Unrent a numberIRestResponse<GenericResponse>response=plivo.unrent_number(newDictionary<string,string>(){{"number","1111111111"}// Number that has to be unrented});Console.WriteLine(response.Content);}}}