Function getListItems

  • Retrieves the items from a specified SharePoint list.

    Parameters

    • client: Client

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

    • options: {
          listId: string;
          siteId: string;
      }

      An object containing the site ID and list ID.

      • listId: string

        The ID of the SharePoint list.

      • siteId: string

        The ID of the SharePoint site.

    Returns Promise<any>

    A promise that resolves to an array of list items.

    const client = await getSharePointClient(opt);
    const options = { siteId: 'your-site-id', listId: 'your-list-id' };
    const items = await getListItems(client, options);
    console.log(items);