Package com.vonage.client.sms
Class MessageEvent
java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.sms.MessageEvent
- All Implemented Interfaces:
Jsonable
Represents an Inbound SMS webhook.
- Since:
- 8.3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessageEventCreates an instance of this class from a JSON payload.Whether the message exceeded the maximum-permitted length of a single message.The number of this part in the message.The transaction reference.The number of parts in this concatenated message.getData()The binary content of this message.The first word in the message body.Vonage's unique identifier for this message.The UTC±00:00 time when Vonage started to push this inbound message to your webhook endpoint.The phone number that this inbound message was sent from.getNonce()A random string that adds an extra element of unpredictability into the signature for the request.getText()Message body for this inbound message.The Unix timestamp representation ofgetMessageTimestamp().getTo()Phone number that the message was sent to.getType()Type of message.getUdh()The hex encoded user data header.Methods inherited from class com.vonage.client.JsonableBaseObject
createJsonObjectMapper, equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.vonage.client.Jsonable
toJson, updateFromJson
-
Method Details
-
getMsisdn
The phone number that this inbound message was sent from.- Returns:
- The sender number in E.164 format.
-
getTo
Phone number that the message was sent to. This is your virtual number.- Returns:
- The recipient number in E.164 format.
-
getMessageId
Vonage's unique identifier for this message.- Returns:
- The message ID.
-
getType
Type of message.- Returns:
- The message type as an enum.
-
getText
Message body for this inbound message.- Returns:
- The text message, or
nullif getType() is MessageType.BINARY.
-
getKeyword
The first word in the message body. This is typically used with short codes.- Returns:
- The message keyword, or
nullif getType() is MessageType.BINARY.
-
getData
The binary content of this message.- Returns:
- The message content as a string, or
nullif getType() is not MessageType.BINARY.
-
getUdh
The hex encoded user data header.- Returns:
- The user data header as a hex-encoded string, or
nullif getType() is not MessageType.BINARY.
-
getMessageTimestamp
The UTC±00:00 time when Vonage started to push this inbound message to your webhook endpoint.- Returns:
- The message timestamp as an Instant.
-
getTimestamp
The Unix timestamp representation ofgetMessageTimestamp().- Returns:
- The Unix timestamp of the message as a Long, or
nullif unavailable.
-
getNonce
A random string that adds an extra element of unpredictability into the signature for the request. You use the nonce and timestamp parameters with your shared secret to calculate and validate the signature for inbound messages.- Returns:
- The nonce, or
nullif the message is unsigned.
-
getConcat
Whether the message exceeded the maximum-permitted length of a single message.- Returns:
truefor multipart (concatenated) message, ornullif not applicable.
-
getConcatRef
The transaction reference. All parts of this message share this reference.- Returns:
- The concatenation reference, or
nullif not applicable.
-
getConcatTotal
The number of parts in this concatenated message.- Returns:
- Total number of messages used, or
nullif not applicable.
-
getConcatPart
The number of this part in the message. The first part of the message is 1.- Returns:
- The sequence number (part) for this message, or
nullif not applicable.
-
fromJson
Creates an instance of this class from a JSON payload.- Parameters:
json- The JSON string to parse.- Returns:
- An instance of this class with the fields populated, if present.
-