SP.FileVersionCollection object

Represents a collection of SP.FileVersion objects.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var object = new SP.FileVersionCollection()

Members

The FileVersionCollection object has the following members.

Constructor

The FileVersionCollection object has the following constructor.

Constructor

Description

FileVersionCollection

This member is reserved for internal use and is not intended to be used directly from your code.

Methods

The FileVersionCollection object has the following methods.

Method

Description

deleteAll

Deletes all the file version objects in the collection.

deleteByID

Deletes the specified version of the file.

deleteByLabel

Deletes the file version object with the specified version label.

getById

itemAt

Gets the file version at the specified index in the collection.

restoreByLabel

Creates a new file version from the file specified by the version label.

Properties

The FileVersionCollection object has the following properties.

Property

Description

childItemType

item

Gets the file version at the specified index in the collection.

REST resource endpoint

See FileVersionCollection resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/versions

HTTP requests

This resource supports the following HTTP commands:

GET syntax

GET http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/versions

POST syntax

POST http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/versions