无法使用Onedrive的MS Graph API移动文件.200响应包含旧的父ID



所以我非常喜欢从我的服务器管理Onedrive的Graph API。现在我正在尝试使用图形API将文件从一个目录移动到另一个目录,下面是这里的文档。

现在为了做到这一点,我发送(PATCH)以下内容到https://graph.microsoft.com/v1.0/me/drive/items/01A2ASUEXPG7EKMCTPDJDY7L5YMVTNWHMO:

{'parentReference': {'id': '01A2ASUEVXTMODEW6HIJC3MSXT5JJ4JLRK'}}

我收到:

{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('b9dc908f-6c6f-463b-a568-9361fabdc995')/drive/items/$entity",
"@microsoft.graph.downloadUrl":"xxxx",
"createdDateTime":"2022-04-20T08:46:12Z",
"eTag":""{A6C837EF-6F0A-471A-8FAF-B86566DB1D8E},1"",
"id":"01A2ASUEXPG7EKMCTPDJDY7L5YMVTNWHMO",
"lastModifiedDateTime":"2022-04-20T08:46:12Z",
"name":"IMG.png",
"webUrl":"https://xxxx-my.sharepoint.com/personal/xxxx-uitzendbureau_nl/Documents/Loonstroken%20(alleen%20voor%20toevoegen)/xxxx/IMG.png",
"cTag":""c:{A6C837EF-6F0A-471A-8FAF-B86566DB1D8E},1"",
"size":382692,
"createdBy":{
"user":{
"email":"Online@xxxx.nl",
"id":"b9dc908f-6c6f-463b-a568-9361fabdc995",
"displayName":"Online beheer"
}
},
"lastModifiedBy":{
"user":{
"email":"Online@xxxxx.nl",
"id":"b9dc908f-6c6f-463b-a568-9361fabdc995",
"displayName":"Online beheer"
}
},
"parentReference":{
"driveType":"business",
"driveId":"b!u2WpOb6qnkS_6foMbPUq90TwxghBinBMhj9DwokQnQefs7rIOSQYS5kmJNV5uSJ7",
"id":"01A2ASUEWGZQX5GCGE2RFL6J3WBIW2LTUC",
"path":"/drive/root:/Loonstroken (alleen voor toevoegen)/xxxxxx"
},
"file":{
"mimeType":"image/png",
"hashes":{
"quickXorHash":"Yk0eRqT2ThqJHamo0AMLstI0CBI="
}
},
"fileSystemInfo":{
"createdDateTime":"2022-04-20T08:46:12Z",
"lastModifiedDateTime":"2022-04-20T08:46:12Z"
},
"image":{

},
"shared":{
"scope":"users"
}
}

如你所见:

'parentReference': {'driveType': 'business', 'driveId': 'xxx', 'id': '01A2ASUEWGZQX5GCGE2RFL6J3WBIW2LTUC', 'path': '/drive/root:/Loonstroken (alleen voor toevoegen)/xxxxxx'}

parentReference ID没有更改为请求中提供的ID,但仍然返回200。而且文件显然没有被移动。

你知道这里可能有什么问题吗?

回答我自己的问题

似乎这是微软方面的问题。现在我在响应中得到了一个正确的parentReference。

最新更新