twilio / twilio-ruby

A Ruby gem for communicating with the Twilio API and generating TwiML
MIT License
1.35k stars 462 forks source link

Using the new deactivation API returns a 307 response causing an "Unable to fetch record" exception #532

Closed owaiswiz closed 3 years ago

owaiswiz commented 4 years ago

Issue Summary

When using the new deactivation API, an exception occurs with HTTP Error 307. A workaround for now is to catch the exception and get the redirect URL using the exception_object.response.

Similar to https://github.com/twilio/twilio-php/issues/655 and https://github.com/twilio/twilio-csharp/issues/534#issuecomment-676508898

Steps to Reproduce

Fetch deactivated numbers list from the official example

Code Snippet

your_twillio_client.messaging.deactivations.fetch(date: Date.new(2020, 9, 5));

Exception/Log

Twilio::REST::RestError: [HTTP 307] 307 : Unable to fetch record
from /home/owaiswiz/.rvm/gems/ruby-2.6.6/gems/twilio-ruby-5.40.1/lib/twilio-ruby/framework/version.rb:72:in `fetch'

Technical details:

childish-sambino commented 4 years ago

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.