GetContentCommand

Retrieves content, including a pre-signed URL to download the content.

Example Syntax

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

import { QConnectClient, GetContentCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, GetContentCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // GetContentRequest
  contentId: "STRING_VALUE", // required
  knowledgeBaseId: "STRING_VALUE", // required
};
const command = new GetContentCommand(input);
const response = await client.send(command);
// { // GetContentResponse
//   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
//   },
// };

GetContentCommand Input

See GetContentCommandInput 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. URLs cannot contain the ARN.

GetContentCommand Output

See GetContentCommandOutput for details

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.

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.