I've been stumbling on this issue for a while. I'm trying to copy file which is located at OneDrive's folder into another folder within the same account. (i.e: from user's root folder to one of it's subfolder).
According to OneDrive Copy API, I need to call this REST API:
where {item-id} is the file's id which I want to copy. For this request, I've using this content:
This http call was work just fine. I've got the desired result which is:
When I following the link at Location header, I got the async job status which is:
The problem is, no matter how many times I wait and call this link, it gives the exact response, which it's status was notStarted. I also try to reproduce this using OneDrive's API Console and it shows exact behaviors. I don't have any problem when copying an empty folder. This problem only occurs on files. Does anyone know why? Is there anything I should do to start that async job?
Note: I also asking this question at stackoverflow. I'll update this thread when that question is answered.
According to OneDrive Copy API, I need to call this REST API:
Code:
POST /drive/items/{item-id}/action.copy
where {item-id} is the file's id which I want to copy. For this request, I've using this content:
Code:
{
"parentReference": {
"id": [destination-folder-id]
}
}
This http call was work just fine. I've got the desired result which is:
Code:
HTTP/1.1 202 Accepted
Location: https://onedrive.com/monitor/[generated-alphanumeric-characters]
When I following the link at Location header, I got the async job status which is:
Code:
{
"operation": "ItemCopy",
"percentageComplete": 0,
"status": "notStarted",
"statusDescription": "Completed 0/0 files; 0/0 bytes"
}
The problem is, no matter how many times I wait and call this link, it gives the exact response, which it's status was notStarted. I also try to reproduce this using OneDrive's API Console and it shows exact behaviors. I don't have any problem when copying an empty folder. This problem only occurs on files. Does anyone know why? Is there anything I should do to start that async job?
Note: I also asking this question at stackoverflow. I'll update this thread when that question is answered.