StartImportJobCommand

Start an asynchronous job to import Amazon Q in Connect resources from an uploaded source file. Before calling this API, use StartContentUpload  to upload an asset that contains the resource data.

  • For importing Amazon Q in Connect quick responses, you need to upload a csv file including the quick responses. For information about how to format the csv file for importing quick responses, see Import quick responses .

Example Syntax

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

import { QConnectClient, StartImportJobCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, StartImportJobCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // StartImportJobRequest
  knowledgeBaseId: "STRING_VALUE", // required
  importJobType: "STRING_VALUE", // required
  uploadId: "STRING_VALUE", // required
  clientToken: "STRING_VALUE",
  metadata: { // ContentMetadata
    "<keys>": "STRING_VALUE",
  },
  externalSourceConfiguration: { // ExternalSourceConfiguration
    source: "STRING_VALUE", // required
    configuration: { // Configuration Union: only one key present
      connectConfiguration: { // ConnectConfiguration
        instanceId: "STRING_VALUE",
      },
    },
  },
};
const command = new StartImportJobCommand(input);
const response = await client.send(command);
// { // StartImportJobResponse
//   importJob: { // ImportJobData
//     importJobId: "STRING_VALUE", // required
//     knowledgeBaseId: "STRING_VALUE", // required
//     uploadId: "STRING_VALUE", // required
//     knowledgeBaseArn: "STRING_VALUE", // required
//     importJobType: "STRING_VALUE", // required
//     status: "STRING_VALUE", // required
//     url: "STRING_VALUE", // required
//     failedRecordReport: "STRING_VALUE",
//     urlExpiry: new Date("TIMESTAMP"), // required
//     createdTime: new Date("TIMESTAMP"), // required
//     lastModifiedTime: new Date("TIMESTAMP"), // required
//     metadata: { // ContentMetadata
//       "<keys>": "STRING_VALUE",
//     },
//     externalSourceConfiguration: { // ExternalSourceConfiguration
//       source: "STRING_VALUE", // required
//       configuration: { // Configuration Union: only one key present
//         connectConfiguration: { // ConnectConfiguration
//           instanceId: "STRING_VALUE",
//         },
//       },
//     },
//   },
// };

StartImportJobCommand Input

See StartImportJobCommandInput for more details

Parameter
Type
Description
importJobType
Required
ImportJobType | undefined

The type of the import job.

  • For importing quick response resource, set the value to QUICK_RESPONSES.

knowledgeBaseId
Required
string | undefined

The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • For importing Amazon Q in Connect quick responses, this should be a QUICK_RESPONSES type knowledge base.

uploadId
Required
string | undefined

A pointer to the uploaded asset. This value is returned by StartContentUpload .

clientToken
string | undefined

The tags used to organize, track, or control access for this resource.

externalSourceConfiguration
ExternalSourceConfiguration | undefined

The configuration information of the external source that the resource data are imported from.

metadata
Record<string, string> | undefined

The metadata fields of the imported Amazon Q in Connect resources.

StartImportJobCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
importJob
ImportJobData | undefined

The import job.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient access to perform this action.

ConflictException
client

The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create API (such as CreateAssistant) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.

ResourceNotFoundException
client

The specified resource does not exist.

ServiceQuotaExceededException
client

You've exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use service quotas to request a service quota increase.

ValidationException
client

The input fails to satisfy the constraints specified by a service.

QConnectServiceException
Base exception class for all service exceptions from QConnect service.