Package com.vonage.client.messages
Class MessageStatus
java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.messages.MessageStatus
- All Implemented Interfaces:
Jsonable
This class represents the data of a callback which is invoked after a message has been sent.
It provides metadata about the message, such as its status, how much it cost, when it was sent,
what service (channel) it was sent via, sender and recipient, message response ID, client reference etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDescribes the error that was encountered when sending the message.static enumstatic final classDescribes the charge incurred for sending the message. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Channelprotected Stringprotected MessageStatus.Errorprotected Stringprotected UUIDprotected MessageStatus.Statusprotected Instantprotected Stringprotected MessageStatus.Usage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageStatusCreates an instance of this class from a JSON payload.Catch-all for properties which are not mapped by this class during deserialization.The service used to send the message.Client reference of up to 40 characters.getError()If the message encountered a problem a descriptive error will be supplied in this object.getFrom()The 'from' number used in the outboundMessageRequest.Unique identifier of the message that was sent, as returned inMessageResponse.getMessageUuid().getChannel() is Channel.SMS, returns the number of SMS messages concatenated together to comprise the submitted message.The status of the message.The datetime of when the event occurred.getTo()The 'to' number used in the outboundMessageRequest.getUsage()Describes the cost of the message that was sent.If the getChannel() is Channel.WHATSAPP and getStatus() is MessageStatus.Status.DELIVERED, returns the conversation ID of the message that triggered this callback.If the getChannel() is Channel.WHATSAPP and getStatus() is MessageStatus.Status.DELIVERED, returns the conversation's origin type.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
-
Field Details
-
unknownProperties
-
timestamp
-
messageUuid
-
to
-
from
-
status
-
channel
-
clientRef
-
error
-
usage
-
-
Constructor Details
-
MessageStatus
protected MessageStatus()
-
-
Method Details
-
getMessageUuid
Unique identifier of the message that was sent, as returned inMessageResponse.getMessageUuid().- Returns:
- The UUID of the message.
-
getTo
The 'to' number used in the outboundMessageRequest.- Returns:
- The recipient number or ID.
-
getFrom
The 'from' number used in the outboundMessageRequest.- Returns:
- The sender number or ID.
-
getTimestamp
The datetime of when the event occurred.- Returns:
- The timestamp as an Instant.
-
getStatus
The status of the message.- Returns:
- The message status as an enum.
-
getChannel
The service used to send the message.- Returns:
- The channel, as an enum.
-
getClientRef
Client reference of up to 40 characters. The reference will be present if set in the original outboundMessageRequest.- Returns:
- The client reference, or
nullif unset.
-
getError
If the message encountered a problem a descriptive error will be supplied in this object.- Returns:
- The error object, or
nullif there was no problem to report.
-
getUsage
Describes the cost of the message that was sent.- Returns:
- The usage object, or
nullif absent.
-
getDestinationNetworkCode
- Returns:
- The mobile network code as a string, or
nullif not applicable. - Since:
- 8.1.0
-
getSmsTotalCount
getChannel() is Channel.SMS, returns the number of SMS messages concatenated together to comprise the submitted message. SMS messages are 160 characters, if a submitted message exceeds that size it is sent as multiple SMS messages. This number indicates how many SMS messages are required.- Returns:
- The number of SMS messages used for this message, or
nullif not applicable. - Since:
- 8.1.0
-
getWhatsappConversationType
If the getChannel() is Channel.WHATSAPP and getStatus() is MessageStatus.Status.DELIVERED, returns the conversation's origin type.- Returns:
- The WhatsApp conversation category as an enum,
nullif absent or not applicable. - Since:
- 8.1.0
-
getWhatsappConversationId
If the getChannel() is Channel.WHATSAPP and getStatus() is MessageStatus.Status.DELIVERED, returns the conversation ID of the message that triggered this callback.- Returns:
- The WhatsApp conversation ID,
nullif absent or not applicable. - Since:
- 8.1.0
-
getAdditionalProperties
Catch-all for properties which are not mapped by this class during deserialization.- Returns:
- Additional (unknown) properties as a Map, or
nullif absent.
-
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.
-