Twilio :: REST :: TwilioError(无法获取页面)

时间:2018-06-13 11:50:18

标签: ruby-on-rails twilio-api

当我尝试从给定的twillio api购买数字时出现此错误:

@client = Twilio::REST::Client.new ENV['TWILIO_SID'], ENV['TWILIO_TOKEN']
@account = @client.api.account
@account.incoming_phone_numbers.create({:phone_number => phone_number, :sms_application_sid => "#{application_sid}"}) if phone_number.present?

这是回溯:

> lib/twilio_request.rb:41:in `available_phone_numbers'  
> app/models/assignment.rb:144:in `purchase_twilio_number'  
> app/controllers/assignments_controller.rb:15:in `create'  
> app/controllers/application_controller.rb:26:in `set_time_zone'
> 
> 
> 
> F, [2018-06-13T11:41:29.224403 #16118] FATAL -- :
> [675d377b-c241-4d0b-b918-0f2839bf9d9a]    F,
> [2018-06-13T11:41:29.224673 #16118] FATAL -- :
> [675d377b-c241-4d0b-b918-0f2839bf9d9a] Twilio::REST::TwilioError
> (Unable to fetch page): F, [2018-06-13T11:41:29.224804 #16118] FATAL
> -- : [675d377b-c241-4d0b-b918-0f2839bf9d9a]    F, [2018-06-13T11:41:29.224932 #16118] FATAL -- :
> [675d377b-c241-4d0b-b918-0f2839bf9d9a] lib/twilio_request.rb:41:in
> `available_phone_numbers' [675d377b-c241-4d0b-b918-0f2839bf9d9a]
> app/models/assignment.rb:144:in `purchase_twilio_number'
> [675d377b-c241-4d0b-b918-0f2839bf9d9a]
> app/controllers/assignments_controller.rb:15:in `create'
> [675d377b-c241-4d0b-b918-0f2839bf9d9a]
> app/controllers/application_controller.rb:26:in `set_time_zone'

0 个答案:

没有答案