CopyMove REST Web Service

Top  Previous  Next

CopyMove also features a REST Web service that remote clients can call. The service is available at URLs constructed from the following pattern:

<protocol>://<Web application>/<Context Site>/_vti_bin/CopyMoveRest.svc

where the protocol can be HTTP or HTTPS depending on the SharePoint Web application setup. For example:

https://server/_vti_bin/CopyMoveRest.svc or https://server/sites/site/_vti_bin/CopyMoveRest.svc

The service is sensitive to the SharePoint site context and it is therefore important to always connect with the proper SharePoint site url address. The input/output format is always XML regardless of the HTTP Accept header. To work with JSON data instead of XML, simply use the equivalent CopyMoveJSON.svc REST service. The XML service has these seven end points:

Name

Method

Url

Copy

POST

~site/_vti_bin/CopyMoveRest.svc/Copy

Move

POST

~site/_vti_bin/CopyMoveRest.svc/Move

Result

GET

~site/_vti_bin/CopyMoveRest.svc/Result/{transactionid}

Status

GET

~site/_vti_bin/CopyMoveRest.svc/Status/{transactionid}

SampleItemTransaction

GET

~site/_vti_bin/CopyMoveRest.svc/SampleItemTransaction

Settings

GET

~site/_vti_bin/CopyMoveRest.svc/Settings

Version

GET

~site/_vti_bin/CopyMoveRest.svc/Version

The JSON service has the same end points:

Name

Method

Url

Copy

POST

~site/_vti_bin/CopyMoveJSON.svc/Copy

Move

POST

~site/_vti_bin/CopyMoveJSON.svc/Move

Result

GET

~site/_vti_bin/CopyMoveJSON.svc/Result/{transactionid}

Status

GET

~site/_vti_bin/CopyMoveJSON.svc/Status/{transactionid}

SampleItemTransaction

GET

~site/_vti_bin/CopyMoveJSON.svc/SampleItemTransaction

Settings

GET

~site/_vti_bin/CopyMoveJSON.svc/Settings

Version

GET

~site/_vti_bin/CopyMoveJSON.svc/Version

Use the SampleItemTransaction endpoint to request a sample XML / JSON structure accepted by the Copy and Move end points.

CopyMoveRestService_GetSampleItemTransaction

Copying a single file only requires a few XML tags as shown in the screen shot below. It shows how to quickly build and test a web request with the Postman app for Google Chrome.

Postman_CopyFileXml

The next Postman screen shot shows how to copy multiple files using the Items XML element.

Postman_CopyFilesXml