SP.Site object

Represents a collection of sites in a Web application, including a top-level Web site and all its subsites.

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

var object = new SP.Site()

Members

The Site object has the following members.

Constructor

The Site object has the following constructor.

Constructor

Description

Site

Initializes a new instance of the SP.Site object.

Methods

The Site object has the following methods.

Method

Description

createPreviewSPSite

Creates a temporary evaluation SPSite for this SPSite, for the purposes of determining whether an upgrade is likely to be successful.

extendUpgradeReminderDate

Extend the upgrade reminder date for this SPSite by the days specified at WebApplication.UpgradeReminderDelay.

getCatalog

Specifies the list template gallery, site template gallery, Web Part gallery, master page gallery, or other galleries from the site collection, including custom galleries that are defined by users.

getChanges

Specifies the collection of the site collection changes from the change log that have occurred within the scope of the site collection, based on the specified query.

getCustomListTemplates

Specifies the collection of custom list templates for a given site.

getWebTemplates

Returns the collection of site definitions that are available for creating Web sites within the site collection.

initPropertiesFromJson

invalidate

Invalidates cached upgrade information about the site collection so that this information will be recomputed the next time it is needed.

needsUpgradeByType

true if the object needs to be upgraded; otherwise, false.

openWeb

Returns the site at the specified URL.

openWebById

Returns the site with the specified GUID.

runHealthCheck

Runs a health check as follows. (The health rules referenced below perform an implementation-dependent check on the health of a site collection)

runUpgradeSiteSession

Either runs a site collection upgrade, or schedules it to be run in the future, depending on available system resources and the value of the queueOnly parameter.The user executing this method MUST be a farm administrator or a site collection administrator.

updateClientObjectModelUseRemoteAPIsPermissionSetting

Sets whether the client-side object model (CSOM) requests that are made in the context of any site inside the site collection require UseRemoteAPIs permission.

Properties

The Site object has the following properties.

Property

Description

allowDesigner

Gets or sets a value that specifies whether a designer can be used on this site collection.

allowMasterPageEditing

Gets or sets a value that specifies whether master page editing is allowed on this site collection.

allowRevertFromTemplate

Gets or sets a value that specifies whether this site collection can be reverted to its base template.

allowSelfServiceUpgrade

Whether version to version upgrade is allowed on this site.

allowSelfServiceUpgradeEvaluation

Whether upgrade evaluation site collection is allowed.

canUpgrade

Property indicating whether or not this object can be upgraded.

compatibilityLevel

Gets the major version of this site collection for purposes of major version-level compatibility checks.

eventReceivers

Provides event receivers for events that occur at the scope of the site collection.

features

Gets a value that specifies the collection of the site collection features for the site collection that contains the site.

id

Gets the GUID that identifies the site collection.

lockIssue

Gets or sets the comment that is used in locking a site collection.

maxItemsPerThrottledOperation

Gets a value that specifies the maximum number of list items allowed per operation before throttling will occur.

owner

Gets or sets the owner of the site collection. (Read-only in sandboxed solutions.)

primaryUri

Specifies the primary URI of this site collection, including the host name, port number, and path.

readOnly

Gets or sets a Boolean value that specifies whether the site collection is read-only, locked, and unavailable for write access.

recycleBin

Gets a value that specifies the collection of recycle bin items for the site collection.

rootWeb

Gets a value that returns the top-level site of the site collection.

serverRelativeUrl

Gets the server-relative URL of the root Web site in the site collection.

shareByLinkEnabled

Property that indicates whether users will be able to share links to documents that can be accessed without logging in.

showUrlStructure

Gets or sets a value that specifies whether the URL structure of this site collection is viewable.

uiVersionConfigurationEnabled

Gets or sets a value that specifies whether the Visual Upgrade UI of this site collection is displayed.

upgradeInfo

Specifies the upgrade information of this site collection.

upgradeReminderDate

Specifies a date, after which site collection administrators will be reminded to upgrade the site collection.

upgrading

Specifies whether the site is currently upgrading.

url

Gets the full URL to the root Web site of the site collection, including host name, port number, and path.

usage

Gets a value that specifies usage information about the site, including bandwidth, storage, and the number of visits to the site collection.

userCustomActions

Gets a value that specifies the collection of user custom actions for the site collection.

Remarks

Each Site object, or site collection, is represented within a SiteCollection object that consists of the collection of all site collections in the Web application.

The Usage property is not included in the default scalar property set for this type.

REST resource endpoint

Endpoint URI structure

http://<sitecollection>/<site>/_api/site

HTTP requests

This resource supports the following HTTP commands:

POST syntax

POST http://<sitecollection>/<site>/_api/site