我正在将文件从一个驱动器复制到另一个驱动器。作为正文请求的一部分,我还提供了冲突行为作为重命名(也尝试了替换),但副本失败了。
POST: https://graph.microsoft.com/beta/users/{user-id}/drive/items/{item-id}/copy
Body:
{
"parentReference": {"id": {folder-id-to-copy}, "driveId": {drive-id},
"@microsoft.graph.conflictBehavior": "rename"
}
执行上述命令后,正如预期的那样,我得到一个 202 并在标题中查看位置。查询监视器 URL 时,我看到以下错误:
{
"@odata.context": "https://{host-name}/_api/v2.1/$metadata#drives('default')/operations/$entity",
"id": "7a0decd4-df2f-4717-8eee-b7c2cd131009",
"createdDateTime": "0001-01-01T00:00:00Z",
"lastActionDateTime": "0001-01-01T00:00:00Z",
"status": "failed",
"error": {
"code": "nameAlreadyExists",
"message": "Name already exists"
}
}
复制时要通过什么来重命名/替换现有文件