Function getDriveFolderItems

  • Retrieves the items within a specified folder in a SharePoint drive.

    Parameters

    • client: Client

      The Microsoft Graph client instance used to make the API call.

    • options: {
          driveId: string;
          itemId: string;
      }

      An object containing the following properties:

      • driveId: string

        The ID of the drive containing the folder.

      • itemId: string

        The ID of the folder whose items are to be retrieved.

    Returns Promise<any>

    A promise that resolves to an array of items within the specified folder.

    const client = await getSharePointClient(opt);
    const options = { itemId: 'folderId', driveId: 'driveId' };
    const items = await getDriveFolderItems(client, options);
    console.log(items);