Amazon Connect Participant Service

2020/12/21 - Amazon Connect Participant Service - 3 new 1 updated api methods

Changes  This release adds three new APIs: StartAttachmentUpload, CompleteAttachmentUpload, and GetAttachment. For Amazon Connect Chat, you can use these APIs to share files in chat conversations.

StartAttachmentUpload (new) Link ¶

Provides a pre-signed Amazon S3 URL in response for uploading the file directly to S3.

See also: AWS API Documentation

Request Syntax

client.start_attachment_upload(
    ContentType='string',
    AttachmentSizeInBytes=123,
    AttachmentName='string',
    ClientToken='string',
    ConnectionToken='string'
)
type ContentType

string

param ContentType

[REQUIRED]

Describes the MIME file type of the attachment. For a list of supported file types, see Feature specifications in the Amazon Connect Administrator Guide .

type AttachmentSizeInBytes

integer

param AttachmentSizeInBytes

[REQUIRED]

The size of the attachment in bytes.

type AttachmentName

string

param AttachmentName

[REQUIRED]

A case-sensitive name of the attachment being uploaded.

type ClientToken

string

param ClientToken

[REQUIRED]

A unique case sensitive identifier to support idempotency of request.

This field is autopopulated if not provided.

type ConnectionToken

string

param ConnectionToken

[REQUIRED]

The authentication token associated with the participant's connection.

rtype

dict

returns

Response Syntax

{
    'AttachmentId': 'string',
    'UploadMetadata': {
        'Url': 'string',
        'UrlExpiry': 'string',
        'HeadersToInclude': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • AttachmentId (string) --

      A unique identifier for the attachment.

    • UploadMetadata (dict) --

      Fields to be used while uploading the attachment.

      • Url (string) --

        The pre-signed URL using which file would be downloaded from Amazon S3 by the API caller.

      • UrlExpiry (string) --

        The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

      • HeadersToInclude (dict) --

        The headers to be provided while uploading the file to the URL.

        • (string) --

          • (string) --

GetAttachment (new) Link ¶

Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts.

See also: AWS API Documentation

Request Syntax

client.get_attachment(
    AttachmentId='string',
    ConnectionToken='string'
)
type AttachmentId

string

param AttachmentId

[REQUIRED]

A unique identifier for the attachment.

type ConnectionToken

string

param ConnectionToken

[REQUIRED]

The authentication token associated with the participant's connection.

rtype

dict

returns

Response Syntax

{
    'Url': 'string',
    'UrlExpiry': 'string'
}

Response Structure

  • (dict) --

    • Url (string) --

      The pre-signed URL using which file would be downloaded from Amazon S3 by the API caller.

    • UrlExpiry (string) --

      The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

CompleteAttachmentUpload (new) Link ¶

Allows you to confirm that the attachment has been uploaded using the pre-signed URL provided in StartAttachmentUpload API.

See also: AWS API Documentation

Request Syntax

client.complete_attachment_upload(
    AttachmentIds=[
        'string',
    ],
    ClientToken='string',
    ConnectionToken='string'
)
type AttachmentIds

list

param AttachmentIds

[REQUIRED]

A list of unique identifiers for the attachments.

  • (string) --

type ClientToken

string

param ClientToken

[REQUIRED]

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

This field is autopopulated if not provided.

type ConnectionToken

string

param ConnectionToken

[REQUIRED]

The authentication token associated with the participant's connection.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetTranscript (updated) Link ¶
Changes (response)
{'Transcript': {'Attachments': [{'AttachmentId': 'string',
                                 'AttachmentName': 'string',
                                 'ContentType': 'string',
                                 'Status': 'APPROVED | REJECTED | '
                                           'IN_PROGRESS'}],
                'Type': {'ATTACHMENT',
                         'CHAT_ENDED',
                         'PARTICIPANT_JOINED',
                         'PARTICIPANT_LEFT',
                         'TRANSFER_FAILED',
                         'TRANSFER_SUCCEEDED',
                         'TYPING'}}}

Retrieves a transcript of the session, including details about any attachments. Note that ConnectionToken is used for invoking this API instead of ParticipantToken.

The Amazon Connect Participant Service APIs do not use Signature Version 4 authentication .

See also: AWS API Documentation

Request Syntax

client.get_transcript(
    ContactId='string',
    MaxResults=123,
    NextToken='string',
    ScanDirection='FORWARD'|'BACKWARD',
    SortOrder='DESCENDING'|'ASCENDING',
    StartPosition={
        'Id': 'string',
        'AbsoluteTime': 'string',
        'MostRecent': 123
    },
    ConnectionToken='string'
)
type ContactId

string

param ContactId

The contactId from the current contact chain for which transcript is needed.

type MaxResults

integer

param MaxResults

The maximum number of results to return in the page. Default: 10.

type NextToken

string

param NextToken

The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.

type ScanDirection

string

param ScanDirection

The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is provided, FORWARD with StartPosition.

type SortOrder

string

param SortOrder

The sort order for the records. Default: DESCENDING.

type StartPosition

dict

param StartPosition

A filtering option for where to start.

  • Id (string) --

    The ID of the message or event where to start.

  • AbsoluteTime (string) --

    The time in ISO format where to start.

    It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

  • MostRecent (integer) --

    The start position of the most recent message where you want to start.

type ConnectionToken

string

param ConnectionToken

[REQUIRED]

The authentication token associated with the participant's connection.

rtype

dict

returns

Response Syntax

{
    'InitialContactId': 'string',
    'Transcript': [
        {
            'AbsoluteTime': 'string',
            'Content': 'string',
            'ContentType': 'string',
            'Id': 'string',
            'Type': 'TYPING'|'PARTICIPANT_JOINED'|'PARTICIPANT_LEFT'|'CHAT_ENDED'|'TRANSFER_SUCCEEDED'|'TRANSFER_FAILED'|'MESSAGE'|'EVENT'|'ATTACHMENT'|'CONNECTION_ACK',
            'ParticipantId': 'string',
            'DisplayName': 'string',
            'ParticipantRole': 'AGENT'|'CUSTOMER'|'SYSTEM',
            'Attachments': [
                {
                    'ContentType': 'string',
                    'AttachmentId': 'string',
                    'AttachmentName': 'string',
                    'Status': 'APPROVED'|'REJECTED'|'IN_PROGRESS'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • InitialContactId (string) --

      The initial contact ID for the contact.

    • Transcript (list) --

      The list of messages in the session.

      • (dict) --

        An item - message or event - that has been sent.

        • AbsoluteTime (string) --

          The time when the message or event was sent.

          It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

        • Content (string) --

          The content of the message or event.

        • ContentType (string) --

          The type of content of the item.

        • Id (string) --

          The ID of the item.

        • Type (string) --

          Type of the item: message or event.

        • ParticipantId (string) --

          The ID of the sender in the session.

        • DisplayName (string) --

          The chat display name of the sender.

        • ParticipantRole (string) --

          The role of the sender. For example, is it a customer, agent, or system.

        • Attachments (list) --

          Provides information about the attachments.

          • (dict) --

            The case-insensitive input to indicate standard MIME type that describes the format of the file that will be uploaded.

            • ContentType (string) --

              Describes the MIME file type of the attachment. For a list of supported file types, see Feature specifications in the Amazon Connect Administrator Guide .

            • AttachmentId (string) --

              A unique identifier for the attachment.

            • AttachmentName (string) --

              A case-sensitive name of the attachment being uploaded.

            • Status (string) --

              Status of the attachment.

    • NextToken (string) --

      The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set of results.