Share via


SP.File.publish Method (sp.js)

Submits the file for content approval with the specified comment.

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

SP.File.publish()

Parameters

  • comment
    Specifies the comment.

    Type: String

    Its length must be equal to or less than 1023.

Return value

Undefined

REST resource endpoint

See File resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/publish(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)/publish(comment)

Resource parameters

  • comment