UpdateContentCommand

Updates information about the content.

Example Syntax

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

import { QConnectClient, UpdateContentCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, UpdateContentCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // UpdateContentRequest
  knowledgeBaseId: "STRING_VALUE", // required
  contentId: "STRING_VALUE", // required
  revisionId: "STRING_VALUE",
  title: "STRING_VALUE",
  overrideLinkOutUri: "STRING_VALUE",
  removeOverrideLinkOutUri: true || false,
  metadata: { // ContentMetadata
    "<keys>": "STRING_VALUE",
  },
  uploadId: "STRING_VALUE",
};
const command = new UpdateContentCommand(input);
const response = await client.send(command);
// { // UpdateContentResponse
//   content: { // ContentData
//     contentArn: "STRING_VALUE", // required
//     contentId: "STRING_VALUE", // required
//     knowledgeBaseArn: "STRING_VALUE", // required
//     knowledgeBaseId: "STRING_VALUE", // required
//     name: "STRING_VALUE", // required
//     revisionId: "STRING_VALUE", // required
//     title: "STRING_VALUE", // required
//     contentType: "STRING_VALUE", // required
//     status: "STRING_VALUE", // required
//     metadata: { // ContentMetadata // required
//       "<keys>": "STRING_VALUE",
//     },
//     tags: { // Tags
//       "<keys>": "STRING_VALUE",
//     },
//     linkOutUri: "STRING_VALUE",
//     url: "STRING_VALUE", // required
//     urlExpiry: new Date("TIMESTAMP"), // required
//   },
// };

UpdateContentCommand Input

See UpdateContentCommandInput for more details

Parameter
Type
Description
contentId
Required
string | undefined

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

knowledgeBaseId
Required
string | undefined

The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN

metadata
Record<string, string> | undefined

A key/value map to store attributes without affecting tagging or recommendations. For example, when synchronizing data between an external system and Amazon Q in Connect, you can store an external version identifier as metadata to utilize for determining drift.

overrideLinkOutUri
string | undefined

The URI for the article. If the knowledge base has a templateUri, setting this argument overrides it for this piece of content. To remove an existing overrideLinkOurUri, exclude this argument and set removeOverrideLinkOutUri to true.

removeOverrideLinkOutUri
boolean | undefined

Unset the existing overrideLinkOutUri if it exists.

revisionId
string | undefined

The revisionId of the content resource to update, taken from an earlier call to GetContent, GetContentSummary, SearchContent, or ListContents. If included, this argument acts as an optimistic lock to ensure content was not modified since it was last read. If it has been modified, this API throws a PreconditionFailedException.

title
string | undefined

The title of the content.

uploadId
string | undefined

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

UpdateContentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
content
ContentData | undefined

The content.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient access to perform this action.

PreconditionFailedException
client

The provided revisionId does not match, indicating the content has been modified since it was last read.

ResourceNotFoundException
client

The specified resource does not exist.

ValidationException
client

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

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