Düzenle

Aracılığıyla paylaş


site resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

The site resource provides metadata and relationships for a SharePoint site.

Methods

Method REST Path
Get root site GET /sites/root
Get site GET /sites/{site-id}
Get site by path GET /sites/{hostname}:/{site-path}
Get site for a group GET /groups/{group-id}/sites/root
Get analytics GET /sites/{site-id}/analytics
Get activities by interval GET /sites/{site-id}/getActivitiesByInterval
List pages GET /sites/{site-id}/pages
List page templates GET /sites/{site-id}/pageTemplates/microsoft.graph.pageTemplate
List root sites GET /sites?filter=root ne null&select=siteCollection,webUrl
List sites across geographies GET /site/getAllSites
List subsites for a site GET /sites/{site-id}/sites
Search for sites GET /sites?search={query}
Follow site POST /users/{user-id}/followedSites/add
Unfollow site POST /users/{user-id}/followedSites/remove
List followed sites GET /me/followedSites
Get permission GET /sites/{site-id}/permissions/{permission-id}
List permissions GET /sites/{site-id}/permissions
Create permissions POST /sites/{site-id}/permissions
Delete permission DELETE /sites/{site-id}/permissions/{permission-id}
Update permission PATCH /sites/{site-id}/permissions/{permission-id}
List content types GET /sites/{site-id}/contentTypes
Create contentType POST /sites/{site-id}/contentTypes
List columns GET /sites/{site-id}/columns
Create column POST /sites/{site-id}/columns
Create document processing job POST /sites/{site-id}/documentProcessingJobs
List operations GET /sites/{site-id}/operations
Get site settings GET /sites/{site-id}/settings
Get delta GET /sites/delta

Properties

Property Type Description
id string The unique identifier of the item. Read-only.
createdDateTime DateTimeOffset The date and time the item was created. Read-only.
description string The descriptive text for the site.
eTag string ETag for the item. Read-only.
displayName string The full title for the site. Read-only.
lastModifiedDateTime DateTimeOffset The date and time the item was last modified. Read-only.
name string The name/title of the item.
root root If present, provides the root site in the site collection. Read-only.
settings siteSettings The settings on this site. Read-only.
sharepointIds sharepointIds Returns identifiers useful for SharePoint REST compatibility. Read-only.
siteCollection siteCollection Provides details about the site's site collection. Available only on the root site. Read-only.
webUrl string (url) URL that displays the item in the browser. Read-only.

id property

A site is identified by a unique ID that is a composite of the following values:

  • Site collection hostname (contoso.sharepoint.com)
  • Site collection unique ID (GUID)
  • Site unique ID (GUID)

The root identifier always references the root site for a given target, as follows:

  • /sites/root: The tenant root site.
  • /groups/{group-id}/sites/root: The group's team site.

Relationships

Relationship Type Description
analytics itemAnalytics Analytics about the view activities that took place on this site.
columns columnDefinition collection The collection of column definitions reusable across lists under this site.
contentModels contentModel collection The collection of content models applied to this site.
contentTypes contentType collection The collection of content types defined for this site.
drive drive The default drive (document library) for this site.
documentProcessingJobs documentProcessingJob collection The document processing jobs running on this site.
drives drive collection The collection of drives (document libraries) under this site.
externalColumns columnDefinition collection The collection of column definitions available in the site that is referenced from the sites in the parent hierarchy of the current site.
items baseItem collection Used to address any item contained in this site. This collection can't be enumerated.
lists list collection The collection of lists under this site.
operations richLongRunningOperation collection The collection of long running operations for the site.
pages baseSitePage collection The collection of pages in the baseSitePages list on this site.
pageTemplates pageTemplate collection The collection of page templates on this site.
permissions permission collection The permissions associated with the site. Nullable.
recycleBin recycleBin A container for a collection of recycleBinItem resources in this site.
sites site collection The collection of the sub-sites under this site.
termStore microsoft.graph.termStore.store The termStore under this site.

JSON representation

The following JSON representation shows the resource type.

The site resource is derived from baseItem and inherits properties from that resource.

{
  "displayName": "string",
  "id": "string",
  "root": { "@odata.type": "microsoft.graph.root" },
  "settings": { "@odata.type": "microsoft.graph.sitesettings" },
  "sharepointIds": { "@odata.type": "microsoft.graph.sharepointIds" },
  "siteCollection": {"@odata.type": "microsoft.graph.siteCollection"},

  /* relationships */
  "analytics": { "@odata.type": "microsoft.graph.itemAnalytics" },
  "columns": [ { "@odata.type": "microsoft.graph.columnDefinition" }],
  "contentTypes": [ { "@odata.type": "microsoft.graph.contentType" }],
  "externalColumns": [ { "@odata.type": "microsoft.graph.columnDefinition" }],
  "drive": { "@odata.type": "microsoft.graph.drive" },
  "drives": [ { "@odata.type": "microsoft.graph.drive" }],
  "items": [ { "@odata.type": "microsoft.graph.baseItem" }],
  "lists": [ { "@odata.type": "microsoft.graph.list" }],
  "permissions": [ { "@odata.type": "microsoft.graph.permission" }],
  "sites": [ { "@odata.type": "microsoft.graph.site"} ],
  "termStore": { "@odata.type": "microsoft.graph.termStore.store" },

  /* inherited from baseItem */
  "createdDateTime": "datetime",
  "description": "string",
  "eTag": "string",
  "lastModifiedDateTime": "datetime",
  "name": "string",
  "webUrl": "url"
}