Skip to main content

@wildix/wim-knowledge-base-client > GetDocumentCommand

GetDocumentCommand class

Get a document by its ID

Signature:

export declare class GetDocumentCommand extends GetDocumentCommand_base 

Extends: GetDocumentCommand_base

Example

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

import { KnowledgeBaseClient, GetDocumentCommand } from "@wildix/wim-knowledge-base-client"; // ES Modules import
// const { KnowledgeBaseClient, GetDocumentCommand } = require("@wildix/wim-knowledge-base-client"); // CommonJS import
const client = new KnowledgeBaseClient(config);
const input = { // GetDocumentInput
companyId: "STRING_VALUE",
dataSourceId: "STRING_VALUE", // required
documentId: "STRING_VALUE", // required
};
const command = new GetDocumentCommand(input);
const response = await client.send(command);
// { // GetDocumentOutput
// 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",
// },
// };