有没有办法使用 Microsoft Graph API 创建(Excel 工作簿)文件,但不能通过上传 [英] Is there a way to create a (Excel workbook) File using Microsoft Graph API, but not by uploading

查看:71
本文介绍了有没有办法使用 Microsoft Graph API 创建(Excel 工作簿)文件,但不能通过上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做类似的事情

https://graph.microsoft.com/v1.0/me/drive/items/workbook/add

或类似的,这将创建一个与 OneDrive Web 界面中的新建"->工作簿"菜单相同的新工作簿.

or similar which will create a new workbook identical to what the New -> Workbook menu does in the OneDrive Web interface.

我无法在本地创建文件,因此无法选择上传.

I can't create the file locally so upload is not an option.

推荐答案

Microsoft Graph API 仅允许读取和修改此时已存在的工作簿.

The Microsoft Graph APIs only allow reading and modifying workbooks that already exist at this time.

我意识到您的问题表明您无法在本地创建文件.但是,像 js-xlsx 这样的库能够在内存中创建工作簿,然后您可以使用图形 API 推送到 OneDrive.您可以使用这样的库来创建一个空白工作簿,推送它,然后使用 Graph API 对其进行操作.

I realize that your question stated you were not able to create the file locally. However, a library like js-xlsx has the ability to create workbooks in-memory that you could then push up into OneDrive using the Graph APIs. You could use a library like that to create a blank workbook, push it, then manipulate it using the Graph APIs.

这篇关于有没有办法使用 Microsoft Graph API 创建(Excel 工作簿)文件,但不能通过上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆