Node.js 使用FileGetURL访问文件

Node.js 使用FileGetURL访问文件,node.js,sharepoint,filehandler,ms-wopi,Node.js,Sharepoint,Filehandler,Ms Wopi,我正在尝试创建文件处理程序加载项,该加载项使用提供商托管的应用程序打开自定义文件 我在heroku中托管了应用程序,直到现在,当我从sharepoint打开文件时,我在应用程序中获得了如下请求体 { resourceid: "https://{tenant}.sharepoint.com", culturename: "en-US", fileget: "https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}

我正在尝试创建文件处理程序加载项,该加载项使用提供商托管的应用程序打开自定义文件

我在heroku中托管了应用程序,直到现在,当我从sharepoint打开文件时,我在应用程序中获得了如下请求体

{
  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"
}
但是当我请求使用
fileget
url获取文件内容时。它抛出500个错误消息
URL对于当前用户或应用程序无效。


访问文件内容的方法是什么。

URL似乎是正确的。 您可以通过请求
CheckFileInfo
查看

例如:

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

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

Hi Rocky,当我如上所述向url发送请求时。它抛出错误<代码>{“错误描述”:“引发了类型为“Microsoft.IdentityModel.Tokens.AudienceEurivalidationFailedException”的异常。”}。我使用的是PostMany,您可能需要使用WOPI客户端实例的。它可能与上面的稍有不同。确保您拥有正确的端点(=正确的应用程序名称,正确的操作)。另外,您是否也尝试过按照我的建议查看DownloadUrl和FileUrl?除了上面所述的属性之外,我没有获得任何其他属性。我对sharepoint非常陌生,无法获得您实际指出的内容。我在遵循filehandler文档,应该按照描述获取激活参数