Skip to content

create_content_association

create_content_association(
    knowledge_base_id: UuidOrArn,
    content_id: UuidOrArn,
    association_type: ContentAssociationType,
    association: ContentAssociationContents,
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[Tags] = None,
) -> CreateContentAssociationResponse

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 Connect Customer Administrator Guide.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    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.

  • knowledge_base_id (UuidOrArn) –

    The identifier of the knowledge base.

  • content_id (UuidOrArn) –

    The identifier of the content.

  • association_type (ContentAssociationType) –

    The type of association.

  • association (ContentAssociationContents) –

    The identifier of the associated resource.

  • tags (Optional[Tags], default: None ) –

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

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    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 –

    The specified resource does not exist.

  • ServiceQuotaExceededException –

    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 –

    The throttling limit has been exceeded.

  • UnauthorizedException –

    You do not have permission to perform this action.

  • ValidationException –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_qconnect/_services/q_connect.py
def create_content_association(
    self,
    knowledge_base_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    content_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    association_type: "capo_qconnect.types.content_association_type.ContentAssociationType",
    association: "capo_qconnect.types.content_association_contents.ContentAssociationContents",
    *,
    config_overrides: Optional[QConnectClientConfig] = None,
    client_token: Optional["capo_qconnect.types.client_token.ClientToken"] = None,
    tags: Optional["capo_qconnect.types.tags.Tags"] = None,
) -> "capo_qconnect.types.create_content_association_response.CreateContentAssociationResponse":
    """<p>Creates an association between a content resource in a knowledge base and <a href="https://docs.aws.amazon.com/connect/latest/adminguide/step-by-step-guided-experiences.html">step-by-step guides</a>. 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. </p> <p>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.</p> <p>Note the following limitations:</p> <ul> <li> <p>You can create only one content association for each content resource in a knowledge base.</p> </li> <li> <p>You can associate a step-by-step guide with multiple content resources.</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/integrate-q-with-guides.html">Integrate Amazon Q in Connect with step-by-step guides</a> in the <i>Connect Customer Administrator Guide</i>. </p>

    Args:
        client_token: <p>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 <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
        knowledge_base_id: <p>The identifier of the knowledge base.</p>
        content_id: <p>The identifier of the content.</p>
        association_type: <p>The type of association.</p>
        association: <p>The identifier of the associated resource.</p>
        tags: <p>The tags used to organize, track, or control access for this resource.</p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. For example, if you're using a <code>Create</code> API (such as <code>CreateAssistant</code>) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.</p>
        capo_qconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>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.</p>
        capo_qconnect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_qconnect.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_qconnect.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_qconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_qconnect.types.create_content_association_request.CreateContentAssociationRequest]",
    ) -> OperationResponse[
        "capo_qconnect.types.create_content_association_response.CreateContentAssociationResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.create_content_association

        output, http_response = (
            capo_qconnect._operations.wisdom_service.create_content_association.create_content_association(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContentAssociation")
    )
    input_: capo_qconnect.types.create_content_association_request.CreateContentAssociationRequest = {
        "knowledge_base_id": knowledge_base_id,
        "content_id": content_id,
        "association_type": association_type,
        "association": association,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output