0
votes

I want to disable SMS for a phone number that has been ported into my Twilio account. When a number is ported into the account Twilio assigns a demo URL. How can I blank that URL out via the REST API? When I try via the REST API there is validation on the SMS URL.

1

1 Answers

2
votes

You can set the SmsUrl property to nil:

require 'twilio-ruby' 

# put your own credentials here 
account_sid = your_account_sid
auth_token = your_auth_token 

# set up a client to talk to the Twilio REST API 
@client = Twilio::REST::Client.new account_sid, auth_token 

@client.account.incoming_phone_numbers.get('the phone number ID').update({
'SmsUrl' => nil
})