0

我正在尝试创建使用提供程序托管应用程序打开自定义文件的文件处理程序添加。

我已经在 heroku 中托管了应用程序,直到现在我从共享点打开文件时,我的应用程序中的请求正文如下所示。

{
  resourceid: "https://{tenant}.sharepoint.com",
  culturename: "en-US",
  fileget: "https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}/contents?access_token={token}",
  fileput: "https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}/contents?access_token={token}",
  fileid: "{fileid}",
  client: "SharePoint"
}

但是当我请求使用filegeturl 获取文件内容时。它会引发 500 错误消息 The URL is invalid for the current user or application.

访问文件内容的方式可能是什么。

4

1 回答 1

0

URL 似乎是正确的。您可以做的是通过请求查看文件的 URL 属性CheckFileInfo

例子:

GET https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}?access_token={token}

看看DownloadUrlFileUrl。如果设置了任何属性,请使用它们下载文件。

于 2018-05-09T06:25:17.160 回答