skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. Your app’s hash string is the first 11 characters of the base64-encoded hash.
    Try to pass 11 characters: Ex: 'He42w354ol9'.

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

    Source: https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search