Copy or move

You can copy or move single or multiple content at once. With copy the system creates a new content, a copy of the chosen item(s) in a chosen target container and keeps the original one(s) as well. Using move lets you move a content(s) to another container.

 

Copy a single content

The following example will copy the content that the action is called on to the given target container:

Copy
url: "/OData.svc/Root/Content/IT/Document_Library/Chicago('100Pages.pdf')/CopyTo",
type: 'POST',
data: "models=[" + JSON.stringify({
    'targetPath': '/Root/Content/IT/Document_Library/Munich'
  }) + "]",

Copy multiple content

The next examples shows how to copy multiple documents into another folder:

Copy
url: "/OData.svc/Root/Content/IT/Document_Library/Chicago/CopyBatch",
type: 'POST',
data: "models=[" + JSON.stringify({
    'targetPath': '/Root/Content/IT/Document_Library/Munich',
    'paths': [
      '/Root/Content/IT/Document_Library/Chicago/100Pages.pdf',
      '/Root/Content/IT/Document_Library/Chicago/400Pages.pdf'
    ]
  }) + "]",

Move a single content

The following example shows how to move a content to a given target folder:

Copy
url: "/OData.svc/Root/Content/IT/Document_Library/Chicago('100Pages.pdf')/MoveTo",
type: 'POST',
data: "models=[" + JSON.stringify({
    'targetPath': '/Root/Content/IT/Document_Library/Munich'
  }) + "]",

Move multiple content

Next example shows how to move multiple documents into another target folder:

Copy
url: "/OData.svc/Root/Content/IT/Document_Library/Chicago/MoveBatch",
type: 'POST',
data: "models=[" + JSON.stringify({
    'targetPath': '/Root/Content/IT/Document_Library/Munich',
    'paths': [
      '/Root/Content/IT/Document_Library/Chicago/100Pages.pdf',
      '/Root/Content/IT/Document_Library/Chicago/400Pages.pdf'
    ]
  }) + "]",