class Twilio::REST::Verify::V2::ServiceContext::VerificationList
Public Class Methods
Initialize the VerificationList
@param [Version] version Version
that contains the resource @param [String] service_sid The SID of the
{Service}[https://www.twilio.com/docs/verify/api/service] the resource is associated with.
@return [VerificationList] VerificationList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/verify/v2/service/verification.rb 22 def initialize(version, service_sid: nil) 23 super(version) 24 25 # Path Solution 26 @solution = {service_sid: service_sid} 27 @uri = "/Services/#{@solution[:service_sid]}/Verifications" 28 end
Public Instance Methods
Create the VerificationInstance
@param [String] to The phone number or
{email}[https://www.twilio.com/docs/verify/email] to verify. Phone numbers must be in {E.164 format}[https://www.twilio.com/docs/glossary/what-e164].
@param [String] channel The verification method to use. Can be:
{`email`}[https://www.twilio.com/docs/verify/email], `sms` or `call`.
@param [String] custom_friendly_name A custom user defined friendly name that
overwrites the existing one in the verification message
@param [String] custom_message The text of a custom message to use for the
verification.
@param [String] send_digits The digits to send after a phone call is answered,
for example, to dial an extension. For more information, see the Programmable Voice documentation of {sendDigits}[https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits].
@param [String] locale The locale to use for the verification SMS or call. Can
be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `en-GB`, `es`, `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`, `pl`, `pt`, `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or `zh-HK.`
@param [String] custom_code A pre-generated code to use for verification. The
code can be between 4 and 10 characters, inclusive.
@param [String] amount The amount of the associated PSD2 compliant transaction.
Requires the PSD2 Service flag enabled.
@param [String] payee The payee of the associated PSD2 compliant transaction.
Requires the PSD2 Service flag enabled.
@param [Hash] rate_limits The custom key-value pairs of Programmable Rate
Limits. Keys correspond to `unique_name` fields defined when {creating your Rate Limit}[https://www.twilio.com/docs/verify/api/service-rate-limits]. Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request.
@param [Hash] channel_configuration
{`email`}[https://www.twilio.com/docs/verify/email] channel configuration in json format. Must include 'from' and 'from_name'.
@param [String] app_hash Your {App
Hash}[https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string] to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.
@return [VerificationInstance] Created VerificationInstance
# File lib/twilio-ruby/rest/verify/v2/service/verification.rb 68 def create(to: nil, channel: nil, custom_friendly_name: :unset, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset, app_hash: :unset) 69 data = Twilio::Values.of({ 70 'To' => to, 71 'Channel' => channel, 72 'CustomFriendlyName' => custom_friendly_name, 73 'CustomMessage' => custom_message, 74 'SendDigits' => send_digits, 75 'Locale' => locale, 76 'CustomCode' => custom_code, 77 'Amount' => amount, 78 'Payee' => payee, 79 'RateLimits' => Twilio.serialize_object(rate_limits), 80 'ChannelConfiguration' => Twilio.serialize_object(channel_configuration), 81 'AppHash' => app_hash, 82 }) 83 84 payload = @version.create('POST', @uri, data: data) 85 86 VerificationInstance.new(@version, payload, service_sid: @solution[:service_sid], ) 87 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/verification.rb 91 def to_s 92 '#<Twilio.Verify.V2.VerificationList>' 93 end