Connect / Client / send_chat_integration_event

send_chat_integration_event#

Connect.Client.send_chat_integration_event(**kwargs)#

Processes chat integration events from Amazon Web Services or external integrations to Amazon Connect. A chat integration event includes:

  • SourceId, DestinationId, and Subtype: a set of identifiers, uniquely representing a chat

  • ChatEvent: details of the chat action to perform such as sending a message, event, or disconnecting from a chat

When a chat integration event is sent with chat identifiers that do not map to an active chat contact, a new chat contact is also created before handling chat action.

Access to this API is currently restricted to Amazon Pinpoint for supporting SMS integration.

See also: AWS API Documentation

Request Syntax

response = client.send_chat_integration_event(
    SourceId='string',
    DestinationId='string',
    Subtype='string',
    Event={
        'Type': 'DISCONNECT'|'MESSAGE'|'EVENT',
        'ContentType': 'string',
        'Content': 'string'
    },
    NewSessionDetails={
        'SupportedMessagingContentTypes': [
            'string',
        ],
        'ParticipantDetails': {
            'DisplayName': 'string'
        },
        'Attributes': {
            'string': 'string'
        },
        'StreamingConfiguration': {
            'StreamingEndpointArn': 'string'
        }
    }
)
Parameters:
  • SourceId (string) –

    [REQUIRED]

    External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this is the E164 phone number of the chat customer participant.

  • DestinationId (string) –

    [REQUIRED]

    Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon Connect instance and flow to be used to start chats. For SMS, this is the phone number destination of inbound SMS messages represented by an Amazon Pinpoint phone number ARN.

  • Subtype (string) –

    Classification of a channel. This is used in part to uniquely identify chat.

    Valid value: ["connect:sms"]

  • Event (dict) –

    [REQUIRED]

    Chat integration event payload

    • Type (string) – [REQUIRED]

      Type of chat integration event.

    • ContentType (string) –

      Type of content. This is required when Type is MESSAGE or EVENT.

      • For allowed message content types, see the ContentType parameter in the SendMessage topic in the Amazon Connect Participant Service API Reference.

      • For allowed event content types, see the ContentType parameter in the SendEvent topic in the Amazon Connect Participant Service API Reference.

    • Content (string) –

      Content of the message or event. This is required when Type is MESSAGE and for certain ContentTypes when Type is EVENT.

      • For allowed message content, see the Content parameter in the SendMessage topic in the Amazon Connect Participant Service API Reference.

      • For allowed event content, see the Content parameter in the SendEvent topic in the Amazon Connect Participant Service API Reference.

  • NewSessionDetails (dict) –

    Contact properties to apply when starting a new chat. If the integration event is handled with an existing chat, this is ignored.

    • SupportedMessagingContentTypes (list) –

      The supported chat message content types. Supported types are text/plain, text/markdown, application/json, application/vnd.amazonaws.connect.message.interactive, and application/vnd.amazonaws.connect.message.interactive.response.

      Content types must always contain text/plain. You can then put any other supported type in the list. For example, all the following lists are valid because they contain text/plain: [text/plain, text/markdown, application/json], [text/markdown, text/plain], [text/plain, application/json, application/vnd.amazonaws.connect.message.interactive.response].

      • (string) –

    • ParticipantDetails (dict) –

      The customer’s details.

      • DisplayName (string) – [REQUIRED]

        Display name of the participant.

    • Attributes (dict) –

      A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows just like any other contact attributes.

      There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.

      • (string) –

        • (string) –

    • StreamingConfiguration (dict) –

      The streaming configuration, such as the Amazon SNS streaming endpoint.

      • StreamingEndpointArn (string) – [REQUIRED]

        The Amazon Resource Name (ARN) of the standard Amazon SNS topic. The Amazon Resource Name (ARN) of the streaming endpoint that is used to publish real-time message streaming for chat conversations.

Return type:

dict

Returns:

Response Syntax

{
    'InitialContactId': 'string',
    'NewChatCreated': True|False
}

Response Structure

  • (dict) –

    • InitialContactId (string) –

      Identifier of chat contact used to handle integration event. This may be null if the integration event is not valid without an already existing chat contact.

    • NewChatCreated (boolean) –

      Whether handling the integration event resulted in creating a new chat or acting on existing chat.

Exceptions

  • Connect.Client.exceptions.InvalidRequestException

  • Connect.Client.exceptions.ResourceNotFoundException

  • Connect.Client.exceptions.InternalServiceException

  • Connect.Client.exceptions.ThrottlingException

  • Connect.Client.exceptions.AccessDeniedException