@wildix/wim-knowledge-base-client > UpdateDocumentCommand
UpdateDocumentCommand class
Update a document by its ID
Signature:
export declare class UpdateDocumentCommand extends UpdateDocumentCommand_base
Extends: UpdateDocumentCommand_base
Example
Use a bare-bones client and the command you need to make an API call.
import { KnowledgeBaseClient, UpdateDocumentCommand } from "@wildix/wim-knowledge-base-client"; // ES Modules import
// const { KnowledgeBaseClient, UpdateDocumentCommand } = require("@wildix/wim-knowledge-base-client"); // CommonJS import
const client = new KnowledgeBaseClient(config);
const input = { // UpdateDocumentInput
title: "STRING_VALUE",
url: "STRING_VALUE",
description: "STRING_VALUE",
content: "STRING_VALUE",
updatedAt: "STRING_VALUE",
companyId: "STRING_VALUE",
dataSourceId: "STRING_VALUE", // required
documentId: "STRING_VALUE", // required
};
const command = new UpdateDocumentCommand(input);
const response = await client.send(command);
// { // UpdateDocumentOutput
// document: { // DocumentItem
// title: "STRING_VALUE", // required
// url: "STRING_VALUE",
// content: "STRING_VALUE",
// description: "STRING_VALUE",
// originalFormat: "STRING_VALUE", // required
// originalName: "STRING_VALUE", // required
// originalId: "STRING_VALUE",
// id: "STRING_VALUE", // required
// companyId: "STRING_VALUE", // required
// dataSourceId: "STRING_VALUE", // required
// createdAt: "STRING_VALUE", // required
// updatedAt: "STRING_VALUE", // required
// status: "draft" || "pending" || "processing" || "completed" || "failed", // required
// chunksCount: Number("int"),
// convertingDuration: Number("int"),
// processingDuration: Number("int"),
// errorMessage: "STRING_VALUE",
// },
// };