1

This question keeps being asked with respect to different SharePoint versions. In my case I want copy a document from a 'working library' ( not searchable) to a published versions library, once it has been approved. I also want to ensure that the copied version preservers the major version and any history. My first thought was to do this with a web service

https://tenant.sharepoint.com/teamsite/_vti_bin/_vti_aut/author.dll

The request headers would be

X-Vermeer-Content-Type=application/x-www-form-urlencoded
Content-Type=application/x-www-form-urlencoded

The request body (POST) might look this

copy+document:15.0.0.4420&service_name=/&oldUrl=‎‏'https://tenant.sharepoint.com/teamsite/lib1/doc1.doc'‌&newUrl=‎‏'https://tenant.sharepoint.com/allcompany/lib2/doc1.doc'‌&url_list=[]&rename_option=findbacklinks&put_option=overwrite,migrationsemantics

Anyway, I have tried the call using an HTTP Web Service Action in Nintex Workflow for Office 365 and also the Postman tool but I am getting an access denied error ( even with a HTTP 200). If there is another way of getting my desired outcome please let me know.

1

I had in past used Copy.CopyIntoItems service referenced at https://msdn.microsoft.com/en-us/library/websvccopy.copy.copyintoitems(v=office.15).aspx to copy major version of file from one library to another library while preserving version history on target. This worked for SharePoint 2010.

I used below code.

        CopyService.Copy copySvc = new CopyService.Copy();
        copySvc.Url = https://abc/sites/abc/_vti_bin/Copy.asmx;
        copySvc.Credentials = new NetworkCredential(userName, password, "windows");
        uint cr = copySvc.CopyIntoItems(fileName, desPath, info, fileByte, out copyResult);
        if (cr.ToString() == "0")
            {                       
               result = "Version uploaded successfully.";
            }
            else
            {                       
                result = "Version upload fails.";
            }
  • Thanks for your reply. Unfortunately, I can see from the outset I cannot used this approach: 1) versions supported doesn't mention SP online, 2) as with most w/fs I really need to use inbuilt actions or Web Services. Now there must be an API out there to do this because we can move from docs from ODFB to SharePoint Online as announced at ignite. – westerdaled Oct 5 '16 at 8:01

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.