bcoyle73
bcoyle73

Reputation: 33

Setting Twilio SMS url to blank via REST API

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.

Upvotes: 0

Views: 154

Answers (1)

Cody Caughlan
Cody Caughlan

Reputation: 32758

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
})

Upvotes: 2

Related Questions