Class Message

    • Constructor Detail

      • Message

        protected Message​(Message.MessageType type,
                          java.lang.String from,
                          java.lang.String to,
                          boolean statusReportRequired)
        Abstract type for more specific SMS message types.
        This constructor exposes the full range of possible parameters and is not for general use Instead, it is accessed via super() in the constructors of various sub-classes that expose a relevant sub-set of the available parameters
        Parameters:
        type - the type of SMS message to be sent
        from - the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 15 chars)
        to - the phone number of the handset you wish to send the message to
    • Method Detail

      • getType

        public Message.MessageType getType()
        Returns:
        int the type of message will influence the makeup of the request we post to the Nexmo server, and also the action taken by the Nexmo server in response to this message
      • getFrom

        public java.lang.String getFrom()
        Returns:
        String the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 11 chars)
      • getTo

        public java.lang.String getTo()
        Returns:
        String the phone number of the handset that you wish to send the message to
      • getClientReference

        public java.lang.String getClientReference()
        Returns:
        String A user definable value that will be stored in the Nexmo sms records. It will be available in detailed reporting & analytics in order to help with reconciliation of messages
      • setClientReference

        public void setClientReference​(java.lang.String clientReference)
      • getMessageClass

        public Message.MessageClass getMessageClass()
        Returns:
        com.nexmo.sms.verify.messages.parameters.MessageClass The message class that is to be applied to this message.
      • setTimeToLive

        public void setTimeToLive​(java.lang.Long timeToLive)
      • setCallbackUrl

        public void setCallbackUrl​(java.lang.String callbackUrl)
      • getStatusReportRequired

        public boolean getStatusReportRequired()
        Get the value of the 'status-report-req' parameter.
      • setStatusReportRequired

        public void setStatusReportRequired​(boolean statusReportRequired)
        Set the value of the 'status-report-req' parameter. If set to 'true', Nexmo will call 'callbackUrl' with status updates about the delivery of this message. If this value is set to 'true', then 'callbackUrl' should also be set to a URL that is configured to receive these status updates.
        Parameters:
        statusReportRequired - 'true' if status reports are desired, 'false' otherwise.
      • addParams

        public void addParams​(org.apache.http.client.methods.RequestBuilder request)