Message Types
Each conversation in Web1on1 is regarded as a continuous event stream: an un-terminated succession of individual events, ordered by the point in time at which each event occurred. Each event in this stream (things that we can observe occurring at a particular point in time) is called a Message.
To distinguish the various type of events occurring over the lifetime of a conversation, each Message specifies a type
The following twelve Message types can be seen in a conversation:
- chat: a regular chat message from a user, chatbot or contact (default message type).
- card: a card-shaped message from an agent or from a consumer.
- postback: a canned response for an action button from an agent or a consumer.
- mention: a comment left by the agent for an organization or another agent.
- tag: a command sent by the agent.
- search: a search command sent by the agent.
- command: a command sent by the agent.
- form: activation or de-activation of a form within the conversation's current category.
- field: a recording of a data result for a form field.
- results: a set of one or more results as completed and 'sent' by the agent.
- report: a set of one or more results as generated by a bot.
- status: a system-generated status triggered by the system.
Common and Type-based Message Attributes
When creating Messages in the conversation stream, the type determines which other Messages properties are relevant.
Common Attributes
The following attributes may be specified for each type of Message:
- conversation - The ID of the conversation this Message belongs to. Required;
- type - The message type. Defaults to 'chat'.
- text - A text for the Message. Required.
- isBackchannel - Do not send to consumer, display in the backchannel stream in the UI.
- meta - A flat object of key-value pairs.
The following attributes are typically set by the system on Message creation:
- id - The unique ID of the Message;
- organization - the Organization owner of the Message;
- orgPath - the path to the organization;
- user - The User ID of the agent assigned to the conversation;
- contact - The Contact ID of the consumer represented in the conversation;
- slug - A unique URL path segment for the Message;
- url - The full path to the viewer for this Message;
- results - A list of containers for key/value pairs;
- updatedAt - Last modified date;
- createdAt - Creation date.
Type 'chat' Attributes
In addition to these attributes, a Message of type chat or card may contain:
- role - The role of the message sender in the conversation;
- contentType - The content-type of the message;
- items - A list of items
- actions - A list of action buttons
Types 'results' and 'reports' Attributes
Likewise, the results and report type Message may contain:
- results - A list of form result objects containing key/value pairs.