- 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.
StartContentUploadCommand
Get a URL to upload content to a knowledge base. To upload content, first make a PUT request to the returned URL with your file, making sure to include the required headers. Then use CreateContent to finalize the content creation process or UpdateContent to modify an existing resource. You can only upload content to a knowledge base of type CUSTOM.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QConnectClient, StartContentUploadCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
// const { QConnectClient, StartContentUploadCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
const client = new QConnectClient(config);
const input = { // StartContentUploadRequest
knowledgeBaseId: "STRING_VALUE", // required
contentType: "STRING_VALUE", // required
presignedUrlTimeToLive: Number("int"),
};
const command = new StartContentUploadCommand(input);
const response = await client.send(command);
// { // StartContentUploadResponse
// uploadId: "STRING_VALUE", // required
// url: "STRING_VALUE", // required
// urlExpiry: new Date("TIMESTAMP"), // required
// headersToInclude: { // Headers // required
// "<keys>": "STRING_VALUE",
// },
// };
StartContentUploadCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
contentType Required | string | undefined | The type of content to upload. |
knowledgeBaseId Required | string | undefined | The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN. |
presignedUrlTimeToLive | number | undefined | The expected expiration time of the generated presigned URL, specified in minutes. |
StartContentUploadCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
headersToInclude Required | Record<string, string> | undefined | The headers to include in the upload. |
uploadId Required | string | undefined | The identifier of the upload. |
url Required | string | undefined | The URL of the upload. |
urlExpiry Required | Date | undefined | The expiration time of the URL as an epoch timestamp. |
Throws
Name | Fault | Details |
---|
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. |