Skip to content

Service enfonica.messaging.v1.Messages

Methods

CreateMessage
rpc CreateMessage(CreateMessageRequest) returns (Message)

Creates a Message and queues it for sending. Returns the created message.

The caller must have messaging.messages.create permission on the project.
GetMessage
rpc GetMessage(GetMessageRequest) returns (Message)

Retrieves a Message identified by the supplied resource name.

The caller must have messaging.messages.get permission on the project.
ListMessages
rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse)

Lists the Messages of the specified project. List returns Messages sorted by create_time descending.

The caller must have messaging.messages.list permission on the project.

Resource: Message

The Message resource. This represents a message, such as an SMS.

Fields  
name string
Resource name of the message. It must match the pattern projects/*/messages/*
to string
Required. The recipient phone number in +E164.
from string
Required. The phone number in +E164 or alphanumeric sender ID that initiated the message.
body string
The text of the message. Maximum of 1530 characters for messages encoding using GSM 7-bit encoding and 670 characters for messages encoding using UCS2 encoding. If a longer body is specified, it will be truncated to the maximum length.
status_update_url string
The URL where status updates webhooks should be sent.
reply_url string
The URL where replies, in the form of incoming message webhooks should be sent. This overrides any message handler URLs defined against the phone number receiving the reply.
validity_period_seconds int32
How long the message can stay in Enfonica's outgoing message queue, in seconds. Once the message has been accepted by carriers, we cannot guarantee the message will not be queued after this period.
smart_encoding boolean
Whether to automatically reply certain Unicode characters with similar GSM-7 characters.
labels map<string, string>
You can store any arbitrary data against labels. The maximum key size is 100. The maximum value size is 1000. The maximum number of keys is 50.
classification MessageClassification
The type of message that this is, such as transactional or marketing.
unsubscribe_content_behavior UnsubscribeContentBehavior
Whether the body should be modified to include content indicatig how to unsubscribe.
direction Direction
Output only. The direction of the message. Can be outgoing for messages that are sent or incoming for messages that are received.
error_code string
Output only. If the outgoing message failed to be delivered, the reason why.
error_message string
Output only. The human readable message associated with the error.
segment_count int32
Output only. The number of segments that make up the body.
price google.type.Money
Output only. The price of this message. This may not be populated until a certain stage in the message lifecycle.
status Status
Output only. The current status of the message.
create_identity string
Output only. The identity that created the message. This may be your user or service account, or identities used internally by Enfonica products.
create_time google.protobuf.Timestamp
Output only. The creation time of the message.
send_time google.protobuf.Timestamp
Output only. The time the message was sent. Only set for outgoing message.
deliver_time google.protobuf.Timestamp
Output only. The time when delivery was confirmed for the message. Only set for outgoing message.
encoding MessageEncoding
Output only. The encoding used for the body.

Message.Direction

The direction of a message.

Enums  
DIRECTION_UNSPECIFIED Unspecified direction.
OUTGOING An outgoing message.
INCOMING An incoming message

Message.MessageClassification

The type of message that this is.

Enums  
MESSAGE_CLASSIFICATION_UNSPECIFIED Unspecified.
UNCLASSIFIED The message is not classified. This message will be checked against unsubscribers before being sent.
TRANSACTIONAL A transactional message. This message will not be checked against unsubscribers before being sent.
MARKETING A marketing message. This message will be checked against unsubscribers before being sent.

Message.MessageEncoding

The encoding of a message body.

Enums  
MESSAGE_ENCODING_UNSPECIFIED Unknown message encoding.
GSM7 GSM 7-bit encoding.
UCS2 UCS-2 encoding.

Message.Status

The status of a message.

Enums  
STATUS_UNSPECIFIED Unspecified status.
QUEUED The message has been queued for sending.
SENDING The message is currently being dispatched to an upstream carrier.
SENT The upstream carrier has accepted the message.
FAILED The message failed to be sent within the Enfonica network. For upstream failures, the status will be UNDELIVERED.
DELIVERED The upstream has confirmed message delivery, where available, to the destination handset.
UNDELIVERED The upstream returned a delivery receipt indicating the message was not delivered.
RECEIVED The message is an incoming message that has been received.

Message.UnsubscribeContentBehavior

Behaviour with regards to unsubscribe content within the message.

Enums  
UNSUBSCRIBE_CONTENT_BEHAVIOR_UNSPECIFIED Unspecified.
NONE Do not insert any unsubscribe content within the message.
APPEND_URL Append a short URL to the end of the message body which allows the user to unsubscribe. This will only append the URL, and optionally a whitespace character before the URL.

Example body to use with this paramater:

"This is a marketing message. To unsubscribe:"

CreateMessageRequest

Request to create a new message.

Fields  
parent string
Required. The resource name of the parent project to create the message under. Must be of the form projects/*.
message Message
Required. The message resource to be created.

GetMessageRequest

The GetMessage request message.

Fields  
name string
Required. The resource name of the Message to retrieve. Must be of the form projects/*/messages/*.

ListMessagesRequest

The ListMessages request message.

Fields  
parent string
Required. The resource name of the parent of which to list messages. Must be of the form projects/*.
page_size int32
The maximum number of Messages to return in the response. Default value is 10 and maximum value is 100.
page_token string
A pagination token returned from a previous call to ListMessages that indicates where this listing should continue from.
filter string
Filter string to specify which results should be returned.

The following fields can be filtered: - createTime - to - from - status - direction - encoding

For example: createTime >= '2021-01-01T06:00:00.0Z' AND createTime < '2021-02-01' AND status = DELIVERED OR status = UNDELIVERED AND to = '+61' OR from = '+61'

Note that OR has higher precendence than AND.

ListMessagesResponse

The ListMessages response message.

Fields  
messages[] Message
A possibly paginated list of Messages that are direct descendants of the specified parent resource.
next_page_token string
If this is set, it indicates there are additional results and contains the token to retrieve the next page of results. To use this, pass it in the page_token field when calling ListMessages.