QConnect / Client / get_next_message

get_next_message#

QConnect.Client.get_next_message(**kwargs)#

Retrieves next message on an Amazon Q in Connect session.

See also: AWS API Documentation

Request Syntax

response = client.get_next_message(
    assistantId='string',
    nextMessageToken='string',
    sessionId='string'
)
Parameters:
  • assistantId (string) –

    [REQUIRED]

    The identifier of the Amazon Q in Connect assistant.

  • nextMessageToken (string) –

    [REQUIRED]

    The token for the next message. Use the value returned in the SendMessage or previous response in the next request to retrieve the next message.

  • sessionId (string) –

    [REQUIRED]

    The identifier of the Amazon Q in Connect session.

Return type:

dict

Returns:

Response Syntax

{
    'conversationSessionData': [
        {
            'key': 'string',
            'value': {
                'stringValue': 'string'
            }
        },
    ],
    'conversationState': {
        'reason': 'SUCCESS'|'FAILED'|'REJECTED',
        'status': 'CLOSED'|'READY'|'PROCESSING'
    },
    'nextMessageToken': 'string',
    'requestMessageId': 'string',
    'response': {
        'messageId': 'string',
        'participant': 'CUSTOMER'|'AGENT'|'BOT',
        'timestamp': datetime(2015, 1, 1),
        'value': {
            'text': {
                'value': 'string'
            }
        }
    },
    'type': 'TEXT'
}

Response Structure

  • (dict) –

    • conversationSessionData (list) –

      The conversation data stored on an Amazon Q in Connect Session.

      • (dict) –

        The list of key-value pairs that are stored on the session.

        • key (string) –

          The key of the data stored on the session.

        • value (dict) –

          The value of the data stored on the session.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • stringValue (string) –

            The string value of the data stored on the session.

    • conversationState (dict) –

      The state of current conversation.

      • reason (string) –

        The reason of the conversation state.

      • status (string) –

        The status of the conversation state.

    • nextMessageToken (string) –

      The token for the next message.

    • requestMessageId (string) –

      The identifier of the submitted message.

    • response (dict) –

      The message response to the requested message.

      • messageId (string) –

        The identifier of a message.

      • participant (string) –

        The participant of a message.

      • timestamp (datetime) –

        The timestamp of a message.

      • value (dict) –

        The value of a message data.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: text. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • text (dict) –

          The message data in text type.

          • value (string) –

            The value of the message data in text type.

    • type (string) –

      The type of message response.

Exceptions

  • QConnect.Client.exceptions.ValidationException

  • QConnect.Client.exceptions.AccessDeniedException

  • QConnect.Client.exceptions.ResourceNotFoundException