The application to be assigned to the phone number. If not specified, the application selected as the default_number_app of the account is assigned. For more information, refer to the default_number_app argument in application and the app_id attribute in application object. You may use either app_id or object_id but not both.
subaccount string
The auth_id of the subaccount to which this number should be added. This can be performed only by the main account.
alias string
An alias assigned to the phone number.
object_typestring
Users can pass object_type as trunk.
Mandatory parameter when object_id is present.
Object_type will support trunk, phlo, and xml as values in the next release.
object_idstring
Users can pass trunk_id.
Mandatory parameter when object_type is present.
Object_id will support trunk_id, phlo_id, and xml_id as values in the next release.
message_methodstringrequired — conditional
Allowed values: GET, POST
Allowed for voice- and SMS-enabled numbers.
Required if message_url is passed.
message_urlstringrequired — conditional
Message URL of length not greater than 255 characters.
Allowed only for voice- and SMS-enabled numbers.
Required if message_method is passed.
app_id cannot be updated when object_type is set as trunk and object id is provided.
<?php/**
* Example for Number update
*/require'vendor/autoload.php';usePlivo\RestClient;usePlivo\Exceptions\PlivoRestException;$client=newRestClient("<auth_id>","<auth_token>");try{$response=$client->numbers->update('12025551111',['object_id'=>'33123401372191272','object_type'=>'trunk','message_method'=>'POST','message_url'=>'https://www.plivo.com']);print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
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);}}}