我有一个使用 knockoutJS 的 Sharepoint 框架项目 (SPFx),其中应用程序将尝试使用 Excel Rest API 从存储在 Sharepoint 在线站点的 sharepoint 文档库中的 Excel 文件读取数据。
我遇到了几个文档,但它没有给我一个关于如何做到这一点的具体工作示例。
https://learn.microsoft.com/en-us/sharepoint/dev/general-development/excel-services-rest-api
我无法获取具有此 URL 的文档列表。
http:///_vti_bin/ExcelRest.aspx/Documents/Book1.xlsx
我相信我需要创建一些身份验证方法,以便应用程序用户可以在阅读文档之前访问该文档。
我之前没有在 Sharepoint Framework (SPFx) 应用中使用过 Excel Rest API 和 Microsoft Graph。
有人可以帮我解决这个问题吗?我希望看到在 sharepoint 在线文档库中读取 excel 文件的完整工作示例。
最佳答案
对于SharePoint online,您需要使用Microsoft graph api从SharePoint online访问excel文件。
示例端点:
https://graph.microsoft.com/v1.0/sites/domain.sharepoint.com,id,id/drives/drive id/items/item id/workbook
您可以查看该线程以了解更多详细信息。
关于excel - 如何在 Sharepoint 框架 (SPFx) 应用程序中使用 Excel Rest API 访问存储在 Sharepoint 在线文档库中的 Excel 数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49596144/