Connect / Client / create_attached_file

create_attached_file

Connect.Client.create_attached_file(**kwargs)

Creates an attached file for a completed voice contact by copying a recording from a source S3 URI into Connect Customer managed storage. Use this API to attach voice recordings to contacts for downstream processing such as conversational analytics.

Warning

The AssociatedResourceArn must be the ARN of a completed voice contact, FileUseCaseType must be set to VOICE_RECORDING, and FileSourceUri must be a valid S3 URI.

Note

For example, you can call CreateContact, then CreateAttachedFile, then StartContactConversationalAnalyticsJob to create a contact, attach a recording, and run post-call analytics.

See also: AWS API Documentation

Request Syntax

response = client.create_attached_file(
    ClientToken='string',
    InstanceId='string',
    FileUseCaseType='CONTACT_ANALYSIS'|'EMAIL_MESSAGE'|'EMAIL_MESSAGE_PLAIN_TEXT'|'EMAIL_MESSAGE_REDACTED'|'EMAIL_MESSAGE_PLAIN_TEXT_REDACTED'|'ATTACHMENT'|'VOICE_RECORDING',
    FileSourceUri='string',
    AssociatedResourceArn='string',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • ClientToken (string) –

    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.

  • InstanceId (string) –

    [REQUIRED]

    The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

  • FileUseCaseType (string) –

    [REQUIRED]

    The use case for the file.

    Warning

    Only VOICE_RECORDING is supported.

  • FileSourceUri (string) –

    [REQUIRED]

    The S3 URI of the file to be attached. Only S3 source URIs are supported.

  • AssociatedResourceArn (string) –

    [REQUIRED]

    The ARN of the completed voice contact to attach the file to. Only voice contacts with Telephony subtype are supported.

    Note

    This value must be a valid ARN.

  • Tags (dict) –

    The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'FileArn': 'string',
    'FileId': 'string',
    'CreationTime': 'string',
    'FileStatus': 'APPROVED'|'REJECTED'|'PROCESSING'|'FAILED'
}

Response Structure

  • (dict) – Response from CreateAttachedFile API.

    • FileArn (string) –

      The unique identifier of the attached file resource (ARN).

    • FileId (string) –

      The unique identifier of the attached file resource.

    • CreationTime (string) –

      The time of Creation of the file resource as an ISO timestamp. It’s specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2024-05-03T02:41:28.172Z.

    • FileStatus (string) –

      The current status of the attached file. Valid values: PROCESSING | APPROVED | REJECTED | FAILED.

Exceptions