ruby on rails - How can I fix the "Twilio::REST::RestError"? -




i followed documentation here: https://www.twilio.com/blog/2016/04/receive-and-reply-to-sms-in-rails.html

now have following error:

twilio::rest::resterror (unable create record: requested resource /2010-04-01/accounts//messages.json not found): 

my messages controller code is:

class messagescontroller < applicationcontroller   skip_before_action :verify_authenticity_token  # skip_before_action :authenticate_user!, :only => "reply"    def reply     message_body = params["body"]     from_number = params["from"]     init_twilio     msg = @client.messages.create(       from: rails.application.secrets.twilio_number,       to: from_number,       body: "hello! number #{from_number}. xxx  test message."     )    end    private    def init_twilio     account_sid = rails.application.secrets.twilio_sid     auth_token = rails.application.secrets.twilio_auth_key     @client = twilio::rest::client.new account_sid, auth_token   end end 

hard level of detail given there error in secrets.yml file. double check our twilio keys set properly.





wiki

Comments

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -

Asterisk AGI Python Script to Dialplan does not work -