UserMessage

  • A UserMessage is a message sent by a user to an agent.

  • The UserMessage is found in the data field of the message object received from a Google Pub/Sub subscription.

  • The data field is a base64-encoded string that needs to be decoded to match the UserMessage structure.

  • The UserMessage contains fields such as senderPhoneNumber, messageId, sendTime, agentId, and a union field content which can be text, a user file, a location, or a suggestion response.

A message that a user sent to the agent.

The UserMessage appears in the "data" field of the "message" object that the agent receives from its Google Pub/Sub subscription. The "data" field is a base64-encoded string that the agent must decode to match the UserMessage structure.

JSON representation
{
  "senderPhoneNumber": string,
  "messageId": string,
  "sendTime": string,
  "agentId": string,
  "richMessageClassification": {
    object (RichMessageClassification)
  },
  "carrier": string,

  // Union field content can be only one of the following:
  "text": string,
  "userFile": {
    object (UserFile)
  },
  "location": {
    object (LatLng)
  },
  "suggestionResponse": {
    object (SuggestionResponse)
  }
  // End of list of possible types for union field content.
}
Fields
senderPhoneNumber

string

Phone number (in E.164 format) of the user that sent the message.

messageId

string

A unique message ID, assigned by the sending user's RCS client.

sendTime

string (Timestamp format)

Time at which the message was sent.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

agentId

string

The agent's unique identifier. Set by RCS for Business.

richMessageClassification

object (RichMessageClassification)

Classifies the message according to the US billing model. For details on each classification type, see the U.S. billing model guide. This field is only populated for US phone numbers.

carrier

string

Output only. The carrier information that the user’s phone number belongs to, according to Google RCS backends. Currently, this field is only populated for US phone numbers.

Union field content. Content of the message content can be only one of the following:
text

string

Text, specifically a string created through organic user typing and not a suggested reply.

userFile

object (UserFile)

Media file.

location

object (LatLng)

Location. Note that this is not necessarily the user's location. A user is able to send arbitrary locations to an agent.

suggestionResponse

object (SuggestionResponse)

Response generated by a user tapping a suggested reply or action.