Share via


SP.File.approve Method (sp.js)

Approves the file submitted for content approval with the specified comment.

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

SP.File.approve(comment)

Parameters

  • comment

Exceptions

SPException

The item associated with the SPFile or the SPModerationInformation for the item is null .

Exception

An error occurs when updating the item.

Remarks

Only documents in a list for which content approval has been enabled can be approved.

REST resource endpoint

See File resource for more information.

Endpoint URI structure

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

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

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

Resource parameters

  • comment