QBusiness / Client / list_messages

list_messages#

QBusiness.Client.list_messages(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.list_messages(
    applicationId='string',
    conversationId='string',
    maxResults=123,
    nextToken='string',
    userId='string'
)
Parameters:
  • applicationId (string) –

    [REQUIRED]

    The identifier for the Amazon Q application.

  • conversationId (string) –

    [REQUIRED]

    The identifier of the Amazon Q web experience conversation.

  • maxResults (integer) – The maximum number of messages to return.

  • nextToken (string) – If the number of retrievers returned exceeds maxResults, Amazon Q returns a next token as a pagination token to retrieve the next set of messages.

  • userId (string) –

    [REQUIRED]

    The identifier of the user involved in the Amazon Q web experience conversation.

Return type:

dict

Returns:

Response Syntax

{
    'messages': [
        {
            'actionExecution': {
                'payload': {
                    'string': {
                        'value': {...}|[...]|123|123.4|'string'|True|None
                    }
                },
                'payloadFieldNameSeparator': 'string',
                'pluginId': 'string'
            },
            'actionReview': {
                'payload': {
                    'string': {
                        'allowedValues': [
                            {
                                'displayValue': {...}|[...]|123|123.4|'string'|True|None,
                                'value': {...}|[...]|123|123.4|'string'|True|None
                            },
                        ],
                        'displayName': 'string',
                        'displayOrder': 123,
                        'required': True|False,
                        'type': 'STRING'|'NUMBER'|'ARRAY'|'BOOLEAN',
                        'value': {...}|[...]|123|123.4|'string'|True|None
                    }
                },
                'payloadFieldNameSeparator': 'string',
                'pluginId': 'string',
                'pluginType': 'SERVICE_NOW'|'SALESFORCE'|'JIRA'|'ZENDESK'
            },
            'attachments': [
                {
                    'error': {
                        'errorCode': 'InternalError'|'InvalidRequest'|'ResourceInactive'|'ResourceNotFound',
                        'errorMessage': 'string'
                    },
                    'name': 'string',
                    'status': 'FAILED'|'SUCCEEDED'
                },
            ],
            'body': 'string',
            'messageId': 'string',
            'sourceAttribution': [
                {
                    'citationNumber': 123,
                    'snippet': 'string',
                    'textMessageSegments': [
                        {
                            'beginOffset': 123,
                            'endOffset': 123
                        },
                    ],
                    'title': 'string',
                    'updatedAt': datetime(2015, 1, 1),
                    'url': 'string'
                },
            ],
            'time': datetime(2015, 1, 1),
            'type': 'USER'|'SYSTEM'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • messages (list) –

      An array of information on one or more messages.

      • (dict) –

        A message in an Amazon Q web experience.

        • actionExecution (dict) –

          Performs an Amazon Q plugin action during a non-streaming chat conversation.

          • payload (dict) –

            A mapping of field names to the field values in input that an end user provides to Amazon Q requests to perform their plugin action.

            • (string) –

              • (dict) –

                A user input field in an plugin action execution payload.

                • value (document) –

                  The content of a user input field in an plugin action execution payload.

          • payloadFieldNameSeparator (string) –

            A string used to retain information about the hierarchical contexts within an action execution event payload.

          • pluginId (string) –

            The identifier of the plugin the action is attached to.

        • actionReview (dict) –

          An output event that Amazon Q 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.

          • payload (dict) –

            Field values that an end user needs to provide to Amazon Q for Amazon Q to perform the requested plugin action.

            • (string) –

              • (dict) –

                A user input field in an plugin action review payload.

                • allowedValues (list) –

                  Information about the field values that an end user can use to provide to Amazon Q for Amazon Q to perform the requested plugin action.

                  • (dict) –

                    Information about the field values that an end user can use to provide to Amazon Q for Amazon Q to perform the requested plugin action.

                    • displayValue (document) –

                      The name of the field.

                    • value (document) –

                      The field value.

                • displayName (string) –

                  The name of the field.

                • displayOrder (integer) –

                  The display order of fields in a payload.

                • required (boolean) –

                  Information about whether the field is required.

                • type (string) –

                  The type of field.

                • value (document) –

                  The field value.

          • payloadFieldNameSeparator (string) –

            A string used to retain information about the hierarchical contexts within an action review payload.

          • pluginId (string) –

            The identifier of the plugin associated with the action review.

          • pluginType (string) –

            The type of plugin.

        • attachments (list) –

          A file directly uploaded into an Amazon Q web experience chat.

          • (dict) –

            The details of a file uploaded during chat.

            • error (dict) –

              An error associated with a file uploaded during chat.

              • errorCode (string) –

                The code associated with the data source sync error.

              • errorMessage (string) –

                The message explaining the data source sync error.

            • name (string) –

              The name of a file uploaded during chat.

            • status (string) –

              The status of a file uploaded during chat.

        • body (string) –

          The content of the Amazon Q web experience message.

        • messageId (string) –

          The identifier of the Amazon Q web experience message.

        • sourceAttribution (list) –

          The source documents used to generate Amazon Q web experience message.

          • (dict) –

            The documents used to generate an Amazon Q web experience response.

            • citationNumber (integer) –

              The number attached to a citation in an Amazon Q generated response.

            • snippet (string) –

              The content extract from the document on which the generated response is based.

            • textMessageSegments (list) –

              A text extract from a source document that is used for source attribution.

              • (dict) –

                Provides information about a text extract in a chat response that can be attributed to a source document.

                • beginOffset (integer) –

                  The zero-based location in the response string where the source attribution starts.

                • endOffset (integer) –

                  The zero-based location in the response string where the source attribution ends.

            • title (string) –

              The title of the document which is the source for the Amazon Q generated response.

            • updatedAt (datetime) –

              The Unix timestamp when the Amazon Q application was last updated.

            • url (string) –

              The URL of the document which is the source for the Amazon Q generated response.

        • time (datetime) –

          The timestamp of the first Amazon Q web experience message.

        • type (string) –

          The type of Amazon Q message, whether HUMAN or AI generated.

    • nextToken (string) –

      If the response is truncated, Amazon Q returns this token, which you can use in a later request to list the next set of messages.

Exceptions

  • QBusiness.Client.exceptions.ResourceNotFoundException

  • QBusiness.Client.exceptions.InternalServerException

  • QBusiness.Client.exceptions.LicenseNotFoundException

  • QBusiness.Client.exceptions.ThrottlingException

  • QBusiness.Client.exceptions.ValidationException

  • QBusiness.Client.exceptions.AccessDeniedException