Skip to content

Function: getDriveItems()

ts
function getDriveItems(client: Client, options: {
  siteId: string;
  driveId: string;
}): Promise<any>;

Defined in: src/ms-graph/sharepointGraph.ts:129

Get all root-level items (files and folders) from a drive.

Parameters

ParameterTypeDescription
clientClientThe Microsoft Graph client instance.
options{ siteId: string; driveId: string; }The site and drive identifiers.
options.siteIdstringThe SharePoint site ID.
options.driveIdstringThe drive ID.

Returns

Promise<any>

An array of drive items at the root level.

Example

ts
const client = await getMsGraphClient(creds);
const items = await getDriveItems(client, { siteId: 'site-id', driveId: 'drive-id' });
items.forEach((item: any) => console.log(item.name, item.size));

Matterway Assistant SDK Documentation