Amazon Connect Service

2023/01/19 - Amazon Connect Service - 2 updated api methods

Changes  Amazon Connect Chat introduces Persistent Chat, allowing customers to resume previous conversations with context and transcripts carried over from previous chats, eliminating the need to repeat themselves and allowing agents to provide personalized service with access to entire conversation history.

DescribeContact (updated) Link ¶
Changes (response)
{'Contact': {'RelatedContactId': 'string'}}

This API is in preview release for Amazon Connect and is subject to change.

Describes the specified contact.

Warning

Contact information remains available in Amazon Connect for 24 months, and then it is deleted.

Only data from November 12, 2021, and later is returned by this API.

See also: AWS API Documentation

Request Syntax

client.describe_contact(
    InstanceId='string',
    ContactId='string'
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type ContactId

string

param ContactId

[REQUIRED]

The identifier of the contact.

rtype

dict

returns

Response Syntax

{
    'Contact': {
        'Arn': 'string',
        'Id': 'string',
        'InitialContactId': 'string',
        'PreviousContactId': 'string',
        'InitiationMethod': 'INBOUND'|'OUTBOUND'|'TRANSFER'|'QUEUE_TRANSFER'|'CALLBACK'|'API'|'DISCONNECT'|'MONITOR',
        'Name': 'string',
        'Description': 'string',
        'Channel': 'VOICE'|'CHAT'|'TASK',
        'QueueInfo': {
            'Id': 'string',
            'EnqueueTimestamp': datetime(2015, 1, 1)
        },
        'AgentInfo': {
            'Id': 'string',
            'ConnectedToAgentTimestamp': datetime(2015, 1, 1)
        },
        'InitiationTimestamp': datetime(2015, 1, 1),
        'DisconnectTimestamp': datetime(2015, 1, 1),
        'LastUpdateTimestamp': datetime(2015, 1, 1),
        'ScheduledTimestamp': datetime(2015, 1, 1),
        'RelatedContactId': 'string'
    }
}

Response Structure

  • (dict) --

    • Contact (dict) --

      Information about the contact.

      • Arn (string) --

        The Amazon Resource Name (ARN) for the contact.

      • Id (string) --

        The identifier for the contact.

      • InitialContactId (string) --

        If this contact is related to other contacts, this is the ID of the initial contact.

      • PreviousContactId (string) --

        If this contact is not the first contact, this is the ID of the previous contact.

      • InitiationMethod (string) --

        Indicates how the contact was initiated.

      • Name (string) --

        The name of the contact.

      • Description (string) --

        The description of the contact.

      • Channel (string) --

        How the contact reached your contact center.

      • QueueInfo (dict) --

        If this contact was queued, this contains information about the queue.

        • Id (string) --

          The unique identifier for the queue.

        • EnqueueTimestamp (datetime) --

          The timestamp when the contact was added to the queue.

      • AgentInfo (dict) --

        Information about the agent who accepted the contact.

        • Id (string) --

          The identifier of the agent who accepted the contact.

        • ConnectedToAgentTimestamp (datetime) --

          The timestamp when the contact was connected to the agent.

      • InitiationTimestamp (datetime) --

        The date and time this contact was initiated, in UTC time. For INBOUND , this is when the contact arrived. For OUTBOUND , this is when the agent began dialing. For CALLBACK , this is when the callback contact was created. For TRANSFER and QUEUE_TRANSFER , this is when the transfer was initiated. For API , this is when the request arrived.

      • DisconnectTimestamp (datetime) --

        The timestamp when the customer endpoint disconnected from Amazon Connect.

      • LastUpdateTimestamp (datetime) --

        The timestamp when contact was last updated.

      • ScheduledTimestamp (datetime) --

        The timestamp, in Unix epoch time format, at which to start running the inbound flow.

      • RelatedContactId (string) --

        The contactId that is related to this contact.

StartChatContact (updated) Link ¶
Changes (request, response)
Request
{'PersistentChat': {'RehydrationType': 'ENTIRE_PAST_SESSION | FROM_SEGMENT',
                    'SourceContactId': 'string'}}
Response
{'ContinuedFromContactId': 'string'}

Initiates a flow to start a new chat for the customer. Response of this API provides a token required to obtain credentials from the CreateParticipantConnection API in the Amazon Connect Participant Service.

When a new chat contact is successfully created, clients must subscribe to the participant’s connection for the created chat within 5 minutes. This is achieved by invoking CreateParticipantConnection with WEBSOCKET and CONNECTION_CREDENTIALS.

A 429 error occurs in the following situations:

  • API rate limit is exceeded. API TPS throttling returns a TooManyRequests exception.

  • The quota for concurrent active chats is exceeded. Active chat throttling returns a LimitExceededException .

If you use the ChatDurationInMinutes parameter and receive a 400 error, your account may not support the ability to configure custom chat durations. For more information, contact Amazon Web Services Support.

For more information about chat, see Chat in the Amazon Connect Administrator Guide .

See also: AWS API Documentation

Request Syntax

client.start_chat_contact(
    InstanceId='string',
    ContactFlowId='string',
    Attributes={
        'string': 'string'
    },
    ParticipantDetails={
        'DisplayName': 'string'
    },
    InitialMessage={
        'ContentType': 'string',
        'Content': 'string'
    },
    ClientToken='string',
    ChatDurationInMinutes=123,
    SupportedMessagingContentTypes=[
        'string',
    ],
    PersistentChat={
        'RehydrationType': 'ENTIRE_PAST_SESSION'|'FROM_SEGMENT',
        'SourceContactId': 'string'
    }
)
type InstanceId

string

param InstanceId

[REQUIRED]

The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.

type ContactFlowId

string

param ContactFlowId

[REQUIRED]

The identifier of the flow for initiating the chat. To see the ContactFlowId in the Amazon Connect console user interface, on the navigation menu go to Routing , Contact Flows . Choose the flow. On the flow page, under the name of the flow, choose Show additional flow information . The ContactFlowId is the last part of the ARN, shown here in bold:

arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/846ec553-a005-41c0-8341-xxxxxxxxxxxx

type Attributes

dict

param Attributes

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) --

type ParticipantDetails

dict

param ParticipantDetails

[REQUIRED]

Information identifying the participant.

  • DisplayName (string) -- [REQUIRED]

    Display name of the participant.

type InitialMessage

dict

param InitialMessage

The initial message to be sent to the newly created chat.

  • ContentType (string) -- [REQUIRED]

    The type of the content. Supported types are text/plain , text/markdown , and application/json .

  • Content (string) -- [REQUIRED]

    The content of the chat message.

    • For text/plain and text/markdown , the Length Constraints are Minimum of 1, Maximum of 1024.

    • For application/json , the Length Constraints are Minimum of 1, Maximum of 12000.

type ClientToken

string

param ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

This field is autopopulated if not provided.

type ChatDurationInMinutes

integer

param ChatDurationInMinutes

The total duration of the newly started chat session. If not specified, the chat session duration defaults to 25 hour. The minumum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7 days).

type SupportedMessagingContentTypes

list

param SupportedMessagingContentTypes

The supported chat message content types. 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] .

  • (string) --

type PersistentChat

dict

param PersistentChat

Enable persistent chats. For more information about enabling persistent chat, and for example use cases and how to configure for them, see Enable persistent chat.

  • RehydrationType (string) --

    The contactId that is used for rehydration depends on the rehydration type. RehydrationType is required for persistent chat.

    • ENTIRE_PAST_SESSION : Rehydrates a chat from the most recently terminated past chat contact of the specified past ended chat session. To use this type, provide the initialContactId of the past ended chat session in the sourceContactId field. In this type, Amazon Connect determines the most recent chat contact on the specified chat session that has ended, and uses it to start a persistent chat.

    • FROM_SEGMENT : Rehydrates a chat from the past chat contact that is specified in the sourceContactId field.

    The actual contactId used for rehydration is provided in the response of this API.

  • SourceContactId (string) --

    The contactId from which a persistent chat session must be started.

rtype

dict

returns

Response Syntax

{
    'ContactId': 'string',
    'ParticipantId': 'string',
    'ParticipantToken': 'string',
    'ContinuedFromContactId': 'string'
}

Response Structure

  • (dict) --

    • ContactId (string) --

      The identifier of this contact within the Amazon Connect instance.

    • ParticipantId (string) --

      The identifier for a chat participant. The participantId for a chat participant is the same throughout the chat lifecycle.

    • ParticipantToken (string) --

      The token used by the chat participant to call CreateParticipantConnection. The participant token is valid for the lifetime of a chat participant.

    • ContinuedFromContactId (string) --

      The contactId from which a persistent chat session is started. This field is populated only for persistent chats.