Amazon Connect Service

2023/11/06 - Amazon Connect Service - 1 new 1 updated api methods

Changes  Added new API that allows Amazon Connect Outbound Campaigns to create contacts in Amazon Connect when ingesting your dial requests.

BatchPutContact (new) Link ¶

Note

Only the Amazon Connect outbound campaigns service principal is allowed to assume a role in your account and call this API.

Allows you to create a batch of contacts in Amazon Connect. The outbound campaigns capability ingests dial requests via the PutDialRequestBatch API. It then uses BatchPutContact to create contacts corresponding to those dial requests. If agents are available, the dial requests are dialed out, which results in a voice call. The resulting voice call uses the same contactId that was created by BatchPutContact.

See also: AWS API Documentation

Request Syntax

client.batch_put_contact(
    ClientToken='string',
    InstanceId='string',
    ContactDataRequestList=[
        {
            'SystemEndpoint': {
                'Type': 'TELEPHONE_NUMBER'|'VOIP'|'CONTACT_FLOW',
                'Address': 'string'
            },
            'CustomerEndpoint': {
                'Type': 'TELEPHONE_NUMBER'|'VOIP'|'CONTACT_FLOW',
                'Address': 'string'
            },
            'RequestIdentifier': 'string',
            'QueueId': 'string',
            'Attributes': {
                'string': 'string'
            },
            'Campaign': {
                'CampaignId': 'string'
            }
        },
    ]
)
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 InstanceId

string

param InstanceId

[REQUIRED]

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

type ContactDataRequestList

list

param ContactDataRequestList

[REQUIRED]

List of individual contact requests.

  • (dict) --

    Request object with information to create a contact.

    • SystemEndpoint (dict) --

      Endpoint associated with the Amazon Connect instance from which outbound contact will be initiated for the campaign.

      • Type (string) --

        Type of the endpoint.

      • Address (string) --

        Address of the endpoint.

    • CustomerEndpoint (dict) --

      Endpoint of the customer for which contact will be initiated.

      • Type (string) --

        Type of the endpoint.

      • Address (string) --

        Address of the endpoint.

    • RequestIdentifier (string) --

      Identifier to uniquely identify individual requests in the batch.

    • QueueId (string) --

      The identifier of the queue associated with the Amazon Connect instance in which contacts that are created will be queued.

    • Attributes (dict) --

      List of attributes to be stored in a contact.

      • (string) --

        • (string) --

    • Campaign (dict) --

      Structure to store information associated with a campaign.

      • CampaignId (string) --

        A unique identifier for a campaign.

rtype

dict

returns

Response Syntax

{
    'SuccessfulRequestList': [
        {
            'RequestIdentifier': 'string',
            'ContactId': 'string'
        },
    ],
    'FailedRequestList': [
        {
            'RequestIdentifier': 'string',
            'FailureReasonCode': 'INVALID_ATTRIBUTE_KEY'|'INVALID_CUSTOMER_ENDPOINT'|'INVALID_SYSTEM_ENDPOINT'|'INVALID_QUEUE'|'MISSING_CAMPAIGN'|'MISSING_CUSTOMER_ENDPOINT'|'MISSING_QUEUE_ID_AND_SYSTEM_ENDPOINT'|'REQUEST_THROTTLED'|'IDEMPOTENCY_EXCEPTION'|'INTERNAL_ERROR',
            'FailureReasonMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • SuccessfulRequestList (list) --

      List of requests for which contact was successfully created.

      • (dict) --

        Request for which contact was successfully created.

        • RequestIdentifier (string) --

          Request identifier provided in the API call in the ContactDataRequest to create a contact.

        • ContactId (string) --

          The contactId of the contact that was created successfully.

    • FailedRequestList (list) --

      List of requests for which contact creation failed.

      • (dict) --

        Request for which contact failed to be generated.

        • RequestIdentifier (string) --

          Request identifier provided in the API call in the ContactDataRequest to create a contact.

        • FailureReasonCode (string) --

          Reason code for the failure.

        • FailureReasonMessage (string) --

          Why the request to create a contact failed.

StopContact (updated) Link ¶
Changes (request)
{'DisconnectReason': {'Code': 'string'}}

Ends the specified contact. This call does not work for voice contacts that use the following initiation methods:

  • DISCONNECT

  • TRANSFER

  • QUEUE_TRANSFER

Chat and task contacts, however, can be terminated in any state, regardless of initiation method.

See also: AWS API Documentation

Request Syntax

client.stop_contact(
    ContactId='string',
    InstanceId='string',
    DisconnectReason={
        'Code': 'string'
    }
)
type ContactId

string

param ContactId

[REQUIRED]

The ID of the contact.

type InstanceId

string

param InstanceId

[REQUIRED]

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

type DisconnectReason

dict

param DisconnectReason

The reason a contact can be disconnected. Only Amazon Connect outbound campaigns can provide this field.

  • Code (string) --

    A code that indicates how the contact was terminated.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --