简体   繁体   中英

Copy file bug on OneDrive (REST API)

I have been using for long time the copy request action as described here: ( https://dev.onedrive.com/items/copy.htm ) - POST /drive/items/{item-id}/copy?access_token=... (There is a small bug however, as it is a little bit different: POST /drive/items/{item-id}/action.copy?access_token=...) is the correct one.

From the Copy - POST request I was getting a url from Location response header: https:// onedrive.com/monitor/{monitor-id-...} to monitor the copy progress and when the status was completed, there was a response with the metadata of the new resource (eg data.id, name, createdTime etc). I was doing a GET url request to get all these monitor details.

2 days ago I noticed there are some differences on the response of the API.

  • The url has a different format https://onedrive.com/monitor/ {monitor-id-...}?access_token=..... When I am trying to make a GET using the url, I am receiving an API not found message.
  • When I am removing the access_token from the url and doing the GET request again, the new response is 200, but it is missing the data response with information about the newly created item.

To solve that issue, I need to getItem for the new item and get the metadata which adds more requests and more time for the copy action. Any ideas why/ what happened exactly? Thanks

Updated
This issue should now be resolved.

Original
This looks like a newly introduced bug in the service - as long as auth is provided the request to the monitor to 303 to a valid URL for the created resource. What's happening in this case appears to be a redirect to an invalid URL:

https://api.onedrive.com/v1.0/drives('me')/items('')?access_token=foo

We'll work on getting this fixed ASAP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM