Appearance
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
| Parameter | Type | Description |
|---|---|---|
client | Client | The Microsoft Graph client instance. |
options | { siteId: string; driveId: string; } | The site and drive identifiers. |
options.siteId | string | The SharePoint site ID. |
options.driveId | string | The 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));