Class VerifyRequest


  • public class VerifyRequest
    extends java.lang.Object
    Describes a Verify request when passed to VerifyEndpoint)}.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  VerifyRequest.LineType
      Types of phone line to be specified for type.
    • Constructor Summary

      Constructors 
      Constructor Description
      VerifyRequest​(java.lang.String number, java.lang.String brand)
      Constructor.
      VerifyRequest​(java.lang.String number, java.lang.String brand, java.lang.String from)
      Constructor.
      VerifyRequest​(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale)
      Constructor.
      VerifyRequest​(java.lang.String number, java.lang.String brand, java.lang.String from, int length, java.util.Locale locale, VerifyRequest.LineType type)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBrand()  
      java.lang.String getCountry()
      The country for the destination phone number.
      java.lang.String getFrom()  
      int getLength()  
      java.util.Locale getLocale()  
      java.lang.Integer getNextEventWait()
      Get the wait time between attempts to deliver the PIN.
      java.lang.String getNumber()  
      java.lang.Integer getPinExpiry()
      Get the PIN validity time from generation, in seconds, or null if this has not been set.
      VerifyRequest.LineType getType()  
      void setCountry​(java.lang.String country)
      The country for the destination phone number.
      void setFrom​(java.lang.String from)  
      void setLength​(int length)  
      void setLocale​(java.util.Locale locale)  
      void setNextEventWait​(java.lang.Integer nextEventWait)
      Set the wait time between attempts to deliver the PIN.
      void setPinExpiry​(java.lang.Integer pinExpiry)
      Set the PIN validity time from generation, in seconds.
      void setType​(VerifyRequest.LineType type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VerifyRequest

        public VerifyRequest​(java.lang.String number,
                             java.lang.String brand)
        Constructor.
        Parameters:
        number - (required) The recipient's phone number in E.164 format.
        brand - (required) The name of the company or app to be verified for. Must not be longer than 18 characters.
      • VerifyRequest

        public VerifyRequest​(java.lang.String number,
                             java.lang.String brand,
                             java.lang.String from)
        Constructor.
        Parameters:
        number - (required) The recipient's phone number in E.164 format.
        brand - (required) The name of the company or app you are verifying for. Must not be longer than 18 characters.
        from - (optional The Nexmo number to use as the sender for the verification SMS message and calls, in E.164 format.
      • VerifyRequest

        public VerifyRequest​(java.lang.String number,
                             java.lang.String brand,
                             java.lang.String from,
                             int length,
                             java.util.Locale locale)
        Constructor.
        Parameters:
        number - (required) The recipient's phone number in E.164 format.
        brand - (required) The name of the company or app you are verifying for. Must not be longer than 18 characters.
        from - (optional The Nexmo number to use as the sender for the verification SMS message and calls, in E.164 format.
        length - (optional) The length of the verification code to be sent to the user. Must be either 4 or 6. Use -1 to use the default value.
        locale - (optional) Override the default locale used for verification. By default the locale is determined from the country code included in number
      • VerifyRequest

        public VerifyRequest​(java.lang.String number,
                             java.lang.String brand,
                             java.lang.String from,
                             int length,
                             java.util.Locale locale,
                             VerifyRequest.LineType type)
        Constructor.
        Parameters:
        number - (required) The recipient's phone number in E.164 format.
        brand - (required) The name of the company or app you are verifying for. Must not be longer than 18 characters.
        from - (optional A short alphanumeric string to specify the SenderID for SMS sent by Verify. Depending on the destination of the phone number you are applying, restrictions may apply. By default, sender_id is VERIFY. Must be 11 characters or fewer.
        length - (optional) The length of the verification code to be sent to the user. Must be either 4 or 6. Use -1 to use the default value.
        locale - (optional) Override the default locale used for verification. By default the locale is determined from the country code included in number
        type - (optional) If provided, restrict the verification to the specified network type. Contact [email protected] to enable this feature.
    • Method Detail

      • getNumber

        public java.lang.String getNumber()
        Returns:
        the recipient's phone number provided in the constructor, in E.164 format.
      • getBrand

        public java.lang.String getBrand()
        Returns:
        the name of the company or app to be verified for.
      • getFrom

        public java.lang.String getFrom()
        Returns:
        the short alphanumeric string to specify the SenderID for SMS sent by Verify, or null if one was not provided. This value is specified in some VerifyRequest constructors.

        If this value is null</tt>, the sender_id used will be <tt>VERIFY.

      • setFrom

        public void setFrom​(java.lang.String from)
      • getLength

        public int getLength()
        Returns:
        the length of the verification code to be sent to the user, specified in some VerifyRequest constructors. -1 indicates the default length will be used.
      • setLength

        public void setLength​(int length)
      • getLocale

        public java.util.Locale getLocale()
        Returns:
        the default locale used for verification. If this value is null, the locale will be determined from the country code included in number
      • setLocale

        public void setLocale​(java.util.Locale locale)
      • getCountry

        public java.lang.String getCountry()
        The country for the destination phone number.
        Returns:
        a String containing a 2-character country code
      • setCountry

        public void setCountry​(java.lang.String country)
        The country for the destination phone number.

        If you wish to used localised number formats or you are not sure if number is correctly formatted, set this to a two-character country code. For example, GB, US. Verify will work out the international phone number for you.

        Parameters:
        country - a String containing a 2-character country code
      • getPinExpiry

        public java.lang.Integer getPinExpiry()
        Get the PIN validity time from generation, in seconds, or null if this has not been set.
      • setPinExpiry

        public void setPinExpiry​(java.lang.Integer pinExpiry)
        Set the PIN validity time from generation, in seconds. The default (null) is 300 seconds.
      • getNextEventWait

        public java.lang.Integer getNextEventWait()
        Get the wait time between attempts to deliver the PIN.
        Returns:
        An Integer between 600-900, or null.
      • setNextEventWait

        public void setNextEventWait​(java.lang.Integer nextEventWait)
        Set the wait time between attempts to deliver the PIN.
        Parameters:
        nextEventWait - An Integer value between 60 and 900 seconds, or null to use the default duration.