3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

電話番号SIDを取得する

Posted at

Twilio 電話番号SID取得する方法です。
こちらのソースを実行すれば自分のアカウントの登録されている電話番号のSIDを取得することが可能です。

get_twilio_PN
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'
 
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'your Account SID'
auth_token = 'your Auth Token'
@client = Twilio::REST::Client.new account_sid, auth_token
 
 
# Loop over numbers and print out a property for each one
@client.account.incoming_phone_numbers.list.each do |number|
    puts number.sid
    puts number.phone_number
end
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?