Update an IncomingPhoneNumber
Use this endpoint for the IncomingPhoneNumber method to modify the properties of an incoming phone number.
Parameters
Parameter | Description |
---|---|
AccountSid Required | The unique identifier of the account associated with this phone number. |
AddressSid Optional | The unique identifier for the address associated with this phone number. |
EmergencyAddressSid Optional | The unique identifier of the address to be used for E911. |
FriendlyName Optional | The formatted version of the phone number. |
IdentitySid Optional | The unique identifier for the identity associated with this phone number. |
SmsApplicationSid Optional | The unique identifier for the application associated with SMS handling on this phone number. If SmsApplicationSid is present, the URLs on the application will be used and all other URLs will be ignored. |
SmsFallbackMethod Optional | Whether the request to SmsFallbackUrl is a GET or a POST . Default is POST . |
SmsFallbackUrl Optional | The URL to request if errors occur when fetching SmsUrl . |
SmsMethod Optional | Whether the request to SmsUrl is a GET or a POST . Default is POST . |
SmsUrl Optional | The URL to request when an incoming SMS is received. |
StatusCallback Optional | The URL to request to pass status updates to. |
StatusCallbackMethod Optional | Whether the request to StatusCallback is a GET or a POST . Default is POST . |
TrunkSid Optional | The unique identifier for the Trunk associated with this phone number. |
VoiceApplicationSid Optional | The unique identifier for the application associated with call handling on this phone number. If VoiceApplicationSid is present, the URLs on the application will be used and all other URLs will be ignored. |
VoiceCallerIdLookup Optional | Whether or not to look up a caller's name in the database. Possible values are true or false . |
VoiceFallbackMethod Optional | Whether the request to VoiceFallbackUrl is a GET or a POST . Default is POST . |
VoiceFallbackUrl Optional | The URL to request if errors occur when fetching Url . |
VoiceMethod Optional | Whether the request to Url is a GET or a POST . Default is POST . |
VoiceReceiveMode Optional | Whether this number can receive calls or fax. Possible values are voice or fax . Default is voice. |
VoiceUrl Optional | The URL to request when a phone number receives a call or fax. |
Examples
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{IncomingPhoneNumberSid}.json \
-X POST \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.incomingPhoneNumbers('IncomingPhoneNumberSid')
.update()
.then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var incomingPhoneNumber = IncomingPhoneNumberResource.Update(
accountSid: "YourProjectID",
pathSid: "IncomingPhoneNumberSid"
);
Console.WriteLine(incomingPhoneNumber.FriendlyName);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
incoming_phone_number = client \
.incoming_phone_numbers('IncomingPhoneNumberSid') \
.update()
print(incoming_phone_number.friendly_name)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
incoming_phone_number = @client
.incoming_phone_numbers('IncomingPhoneNumberSid')
.update()
puts incoming_phone_number.friendly_name
Request: Update an IncomingPhoneNumber's VoiceUrl
In this example, we will update the URL that SignalWire will request when a call to your account is received.
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{IncomingPhoneNumberSid}.json \
-X POST \
--data-urlencode "AccountSid=b3877c40-da60-4998-90ad-b792e98472ac" \
--data-urlencode "VoiceUrl=http://your-application.com/docs/voice.xml" \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.incomingPhoneNumbers('IncomingPhoneNumberSid')
.update({
accountSid: 'b3877c40-da60-4998-90ad-b792e98472ac',
voiceUrl: 'http://your-application.com/docs/voice.xml'
})
.then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
.done();
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var incomingPhoneNumber = IncomingPhoneNumberResource.Update(
accountSid: "b3877c40-da60-4998-90ad-b792e98472ac",
voiceUrl: new Uri("http://your-application.com/docs/voice.xml"),
pathSid: "IncomingPhoneNumberSid"
);
Console.WriteLine(incomingPhoneNumber.FriendlyName);
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
incoming_phone_number = client \
.incoming_phone_numbers('IncomingPhoneNumberSid') \
.update(
voice_url='http://your-application.com/docs/voice.xml',
account_sid='b3877c40-da60-4998-90ad-b792e98472ac'
)
print(incoming_phone_number.friendly_name)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
incoming_phone_number = @client
.incoming_phone_numbers('IncomingPhoneNumberSid')
.update(
account_sid: 'b3877c40-da60-4998-90ad-b792e98472ac',
voice_url: 'http://your-application.com/docs/voice.xml'
)
puts incoming_phone_number.friendly_name
Responses
200 OK
{
"account_sid": "b3877c40-da60-4998-90ad-b792e98472ac",
"address_requirements": "none",
"address_sid": "b3877c40-da60-4998-90ad-b792e98472ad",
"api_version": "2010-04-01",
"beta": false,
"capabilities": {
"mms": true,
"sms": false,
"voice": true
},
"date_created": "Tue, 25 Sept 2018 23:00:00 +0000",
"date_updated": "Wed, 26 Sept 2018 22:00:00 +0000",
"emergency_address_sid": null,
"emergency_status": "Inactive",
"friendly_name": "310-338-6745",
"identity_sid": "b3877c40-da60-4998-90ad-b792e98472ri",
"origin": "origin",
"phone_number": "+13103386745",
"sid": "b3877c40-da60-4998-90ad-b792e98472pn",
"sms_application_sid": null,
"sms_fallback_method": "POST",
"sms_fallback_url": "",
"sms_method": "POST",
"sms_url": "",
"status_callback": "",
"status_callback_method": "POST",
"trunk_sid": "b3877c40-da60-4998-90ad-b792e98472tr",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472ac/IncomingPhoneNumbers/b3877c40-da60-4998-90ad-b792e98472pn.json",
"voice_application_sid": null,
"voice_caller_id_lookup": false,
"voice_fallback_method": "POST",
"voice_fallback_url": null,
"voice_method": "GET",
"voice_url": "http://your-application.com/docs/voice.xml"
}