Skip to main content

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

ListDocumentsCommand class

List all documents for a data source by its ID

Signature:

export declare class ListDocumentsCommand extends ListDocumentsCommand_base 

Extends: ListDocumentsCommand_base

Example

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

import { KnowledgeBaseClient, ListDocumentsCommand } from "@wildix/wim-knowledge-base-client"; // ES Modules import
// const { KnowledgeBaseClient, ListDocumentsCommand } = require("@wildix/wim-knowledge-base-client"); // CommonJS import
const client = new KnowledgeBaseClient(config);
const input = { // ListDocumentsInput
companyId: "STRING_VALUE",
limit: Number("int"),
offset: Number("int"),
sort: "STRING_VALUE",
dataSourceId: "STRING_VALUE", // required
search: "STRING_VALUE",
originalId: "STRING_VALUE",
status: "draft" || "pending" || "processing" || "completed" || "failed",
};
const command = new ListDocumentsCommand(input);
const response = await client.send(command);
// { // ListDocumentsOutput
// documents: [ // DocumentList // required
// { // 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",
// },
// ],
// metadata: { // PaginationMetadata
// total: Number("int"), // required
// limit: Number("int"),
// offset: Number("int"),
// },
// };