CreateContentAssociationCommand

Creates an association between a content resource in a knowledge base and step-by-step guides . Step-by-step guides offer instructions to agents for resolving common customer issues. You create a content association to integrate Amazon Q in Connect and step-by-step guides.

After you integrate Amazon Q and step-by-step guides, when Amazon Q provides a recommendation to an agent based on the intent that it's detected, it also provides them with the option to start the step-by-step guide that you have associated with the content.

Note the following limitations:

  • You can create only one content association for each content resource in a knowledge base.

  • You can associate a step-by-step guide with multiple content resources.

For more information, see Integrate Amazon Q in Connect with step-by-step guides  in the Amazon Connect Administrator Guide.

Example Syntax

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

import { QConnectClient, CreateContentAssociationCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, CreateContentAssociationCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // CreateContentAssociationRequest
  clientToken: "STRING_VALUE",
  knowledgeBaseId: "STRING_VALUE", // required
  contentId: "STRING_VALUE", // required
  associationType: "STRING_VALUE", // required
  association: { // ContentAssociationContents Union: only one key present
    amazonConnectGuideAssociation: { // AmazonConnectGuideAssociationData
      flowId: "STRING_VALUE",
    },
  },
  tags: { // Tags
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateContentAssociationCommand(input);
const response = await client.send(command);
// { // CreateContentAssociationResponse
//   contentAssociation: { // ContentAssociationData
//     knowledgeBaseId: "STRING_VALUE", // required
//     knowledgeBaseArn: "STRING_VALUE", // required
//     contentId: "STRING_VALUE", // required
//     contentArn: "STRING_VALUE", // required
//     contentAssociationId: "STRING_VALUE", // required
//     contentAssociationArn: "STRING_VALUE", // required
//     associationType: "STRING_VALUE", // required
//     associationData: { // ContentAssociationContents Union: only one key present
//       amazonConnectGuideAssociation: { // AmazonConnectGuideAssociationData
//         flowId: "STRING_VALUE",
//       },
//     },
//     tags: { // Tags
//       "<keys>": "STRING_VALUE",
//     },
//   },
// };

CreateContentAssociationCommand Input

Parameter
Type
Description
association
Required
ContentAssociationContents | undefined

The identifier of the associated resource.

associationType
Required
ContentAssociationType | undefined

The type of association.

contentId
Required
string | undefined

The identifier of the content.

knowledgeBaseId
Required
string | undefined

The identifier of the knowledge base.

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.

CreateContentAssociationCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
contentAssociation
ContentAssociationData | undefined

The association between Amazon Q in Connect content and another resource.

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.

ThrottlingException
client

The throttling limit has been exceeded.

ValidationException
client

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

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