0

I have a Folder whose folder structure must be cloned to another folder in another document library.

Is it possible to do something like using file/folder REST API

/_api/web/getfolderbyserverrelativeurl('{0}')/folder/copyto(destinationpath)

or List REST API

/_api/web/lists(guid'{0}')/items({1})/copyto(destiation list/item)
0

I haven`t tested the complete code but seems should work for your scenario.

<<web url>>/_api/web/getfilebyserverrelativeurl('/subsite/Shared%20Documents/sample.txt')/copyTo('/subsite/Shared%20Documents/sample1.txt')

The above one is POST end point.

I don`t see any CopyTo end point for folder.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/dff2a79e-c041-4f7a-9890-d0955705a1ed/problem-copying-file-using-rest-api-method-copyto?forum=sharepointdevelopment

MSDN reference for Folder and File end points

https://msdn.microsoft.com/en-us/library/office/dn450841.aspx#bk_Folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.