OTP Verification unknown keyword error in Twilio with Rails

Viewed 350

want to send android app hash along with the otp with the help of twillio but not getting proper tutorails in rails. i tried in this way

require 'twilio-ruby'
@client = Twilio::REST::Client.new("XXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXX")
verification = @client.verify.services('VXXXXXXXXXXXXXXXXX').verifications.create(app_hash: "HXXXXXXX", to: '+91XXXXXXXXX', channel: 'sms')

But getting againg and again error unknown keyword: app_hash

I followed this tutorial https://www.twilio.com/docs/verify/api/verification

2 Answers

The Twilio Ruby API excerpt goes like:

@client = Twilio::REST::Client.new(account_sid, auth_token)

verification = @client.verify
                      .services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                      .verifications
                      .create(to: '+15017122661', channel: 'sms')

I don't see any app_hash parameter, where did you get that from? Try removing it and see what's going on.

Related