- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateAssistantAssociationCommand
Creates an association between an Amazon Q in Connect assistant and another resource. Currently, the only supported association is with a knowledge base. An assistant can have only a single association.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QConnectClient, CreateAssistantAssociationCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, CreateAssistantAssociationCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // CreateAssistantAssociationRequest
assistantId: "STRING_VALUE", // required
associationType: "STRING_VALUE", // required
association: { // AssistantAssociationInputData Union: only one key present
knowledgeBaseId: "STRING_VALUE",
},
clientToken: "STRING_VALUE",
tags: { // Tags
"<keys>": "STRING_VALUE",
},
};
const command = new CreateAssistantAssociationCommand(input);
const response = await client.send(command);
// { // CreateAssistantAssociationResponse
// assistantAssociation: { // AssistantAssociationData
// assistantAssociationId: "STRING_VALUE", // required
// assistantAssociationArn: "STRING_VALUE", // required
// assistantId: "STRING_VALUE", // required
// assistantArn: "STRING_VALUE", // required
// associationType: "STRING_VALUE", // required
// associationData: { // AssistantAssociationOutputData Union: only one key present
// knowledgeBaseAssociation: { // KnowledgeBaseAssociationData
// knowledgeBaseId: "STRING_VALUE",
// knowledgeBaseArn: "STRING_VALUE",
// },
// },
// tags: { // Tags
// "<keys>": "STRING_VALUE",
// },
// },
// };
CreateAssistantAssociationCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
assistantId Required | string | undefined | The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN. |
association Required | AssistantAssociationInputData | undefined | The identifier of the associated resource. |
associationType Required | AssociationType | undefined | The type of association. |
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 . |
tags | Record<string, string> | undefined | The tags used to organize, track, or control access for this resource. |
CreateAssistantAssociationCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
assistantAssociation | AssistantAssociationData | undefined | The assistant association. |
Throws
Name | Fault | Details |
---|
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 |
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. |