BatchPutContactCommand

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.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ConnectClient, BatchPutContactCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, BatchPutContactCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // BatchPutContactRequest
  ClientToken: "STRING_VALUE",
  InstanceId: "STRING_VALUE", // required
  ContactDataRequestList: [ // ContactDataRequestList // required
    { // ContactDataRequest
      SystemEndpoint: { // Endpoint
        Type: "TELEPHONE_NUMBER" || "VOIP" || "CONTACT_FLOW" || "CONNECT_PHONENUMBER_ARN" || "EMAIL_ADDRESS",
        Address: "STRING_VALUE",
      },
      CustomerEndpoint: {
        Type: "TELEPHONE_NUMBER" || "VOIP" || "CONTACT_FLOW" || "CONNECT_PHONENUMBER_ARN" || "EMAIL_ADDRESS",
        Address: "STRING_VALUE",
      },
      RequestIdentifier: "STRING_VALUE",
      QueueId: "STRING_VALUE",
      Attributes: { // Attributes
        "<keys>": "STRING_VALUE",
      },
      Campaign: { // Campaign
        CampaignId: "STRING_VALUE",
      },
    },
  ],
};
const command = new BatchPutContactCommand(input);
const response = await client.send(command);
// { // BatchPutContactResponse
//   SuccessfulRequestList: [ // SuccessfulRequestList
//     { // SuccessfulRequest
//       RequestIdentifier: "STRING_VALUE",
//       ContactId: "STRING_VALUE",
//     },
//   ],
//   FailedRequestList: [ // FailedRequestList
//     { // FailedRequest
//       RequestIdentifier: "STRING_VALUE",
//       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_VALUE",
//     },
//   ],
// };

BatchPutContactCommand Input

See BatchPutContactCommandInput for more details

Parameter
Type
Description
ContactDataRequestList
Required
ContactDataRequest[] | undefined

List of individual contact requests.

InstanceId
Required
string | undefined

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

ClientToken
string | undefined

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 .

BatchPutContactCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
FailedRequestList
FailedRequest[] | undefined

List of requests for which contact creation failed.

SuccessfulRequestList
SuccessfulRequest[] | undefined

List of requests for which contact was successfully created.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient permissions to perform this action.

IdempotencyException
client

An entity with the same name already exists.

InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidRequestException
client

The request is not valid.

LimitExceededException
client

The allowed limit for the resource has been exceeded.

ResourceNotFoundException
client

The specified resource was not found.

ConnectServiceException
Base exception class for all service exceptions from Connect service.