Skip to main content

messages

Creates, updates, deletes, gets or lists a messages resource.

Overview

Namemessages
TypeResource
Idaws.qbusiness.messages

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
action_executionobjectPerforms an Amazon Q Business plugin action during a non-streaming chat conversation.
action_reviewobjectAn output event that Amazon Q Business returns to an user who wants to perform a plugin action during a non-streaming chat conversation. It contains information about the selected action with a list of possible user input fields, some pre-populated by Amazon Q Business.
attachmentsarrayA file directly uploaded into an Amazon Q Business web experience chat.
bodystringThe content of the Amazon Q Business web experience message. (pattern: <code>\P{C}*$}</code>)
message_idstringThe identifier of the Amazon Q Business web experience message.
source_attributionarrayThe source documents used to generate Amazon Q Business web experience message.
timestring (date-time)The timestamp of the first Amazon Q Business web experience message.
type_stringThe type of Amazon Q Business message, whether HUMAN or AI generated. (USER, SYSTEM)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_messagesselectconversation_id, application_id, regionuserId, nextToken, maxResultsGets a list of messages associated with an Amazon Q Business web experience.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
application_idstringThe identifier for the Amazon Q Business application.
conversation_idstringThe identifier of the Amazon Q Business web experience conversation.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of messages to return.
nextTokenstringIf the number of messages returned exceeds maxResults, Amazon Q Business returns a next token as a pagination token to retrieve the next set of messages.
userIdstringThe identifier of the user involved in the Amazon Q Business web experience conversation.

SELECT examples

Gets a list of messages associated with an Amazon Q Business web experience.

SELECT
action_execution,
action_review,
attachments,
body,
message_id,
source_attribution,
time,
type_
FROM aws.qbusiness.messages
WHERE conversation_id = '{{ conversation_id }}' -- required
AND application_id = '{{ application_id }}' -- required
AND region = '{{ region }}' -- required
AND userId = '{{ userId }}'
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;