小编All*_*lan的帖子

在OneDrive图形api上为特殊AppFolder创建createUploadSession时出错

我试图使用Graph API在我的OneDrive应用的特殊应用文件夹中创建一个上传会话。我的应用程序具有以下权限:

Files.ReadWrite 
Files.ReadWrite.AppFolder 
offline_access 
Run Code Online (Sandbox Code Playgroud)

请求看起来像这样

https://graph.microsoft.com/v1.0/users/xxxxxx96-2e02-4300-8ab0-a05d73xxxxxx/drive/special/approot:/documentname.docx:/createUploadSession
Run Code Online (Sandbox Code Playgroud)

给出以下错误:

{
  "error": {
    "code": "itemNotFound",
    "message": "The resource could not be found.",
    "innerError": {
      "request-id": "7447aa01-6685-4af0-998a-64abc9b14825",
      "date": "2017-04-06T10:07:46"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我可以在普通根文件夹上创建一个上传会话,而不会出现任何错误:

graph.microsoft.com/v1.0/users/xxxxxx96-2e02-4300-8ab0-a05d73xxxxxx/drive/root:/documentname.docx:/createUploadSession  
Run Code Online (Sandbox Code Playgroud)

结果:

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.uploadSession",
  "expirationDateTime": "2017-04-06T10:32:48.5252565Z",
  "nextExpectedRanges": [
    "0-"
  ],
  "uploadUrl": "......."
}
Run Code Online (Sandbox Code Playgroud)

onedrive microsoft-graph

5
推荐指数
1
解决办法
595
查看次数

标签 统计

microsoft-graph ×1

onedrive ×1