Skip to main content

Actions

The ballerinax/microsoft.sharepoint.sites package exposes the following client:

ClientPurpose
ClientManage SharePoint sites, lists, content types, columns, drives, items, permissions, analytics, long-running operations, and term stores through the Microsoft Graph v1.0 API

Client

Provides operations to manage SharePoint sites, lists, content types, columns, drives, items, permissions, analytics, long-running operations, and term stores through the Microsoft Graph v1.0 API.

Configuration

ConnectionConfig

FieldTypeDefaultDescription
authOAuth2ClientCredentialsGrantConfig|http:BearerTokenConfig|OAuth2RefreshTokenGrantConfigRequiredConfigurations related to client authentication
httpVersionhttp:HttpVersionhttp:HTTP_2_0The HTTP version understood by the client
http1Settingshttp:ClientHttp1Settings{}Configurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2Settings{}Configurations related to HTTP/2 protocol
timeoutdecimal30The maximum time to wait (in seconds) for a response before closing the connection
forwardedstring"disable"The choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsConfigurations associated with redirection
poolConfighttp:PoolConfigurationConfigurations associated with request pooling
cachehttp:CacheConfig{}HTTP caching related configurations
compressionhttp:Compressionhttp:COMPRESSION_AUTOSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigConfigurations associated with retrying
cookieConfighttp:CookieConfigConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigs{}Configurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketSSL/TLS-related options
proxyhttp:ProxyConfigProxy server related options
socketConfighttp:ClientSocketConfig{}Provides settings related to client socket configuration
validationbooleantrueEnables the inbound payload validation functionality provided by the constraint package
laxDataBindingbooleantrueEnables relaxed data binding on the client side

OAuth2ClientCredentialsGrantConfig (extends http:OAuth2ClientCredentialsGrantConfig)

FieldTypeDefaultDescription
tokenUrlstringhttps://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/tokenThe token endpoint URL for OAuth2 client credentials grant

Initializing the client

import ballerinax/microsoft.sharepoint.sites;

sites:ConnectionConfig config = {
auth: {
clientId: "<clientId>",
clientSecret: "<clientSecret>",
tokenUrl: "https://login.microsoftonline.com/<tenantId>/oauth2/v2.0/token",
scopes: ["https://graph.microsoft.com/.default"]
}
};
sites:Client sharepointClient = check new (config);

Operations

Site

listSite

Lists SharePoint sites accessible to the application across the tenant.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListSiteQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: SiteCollectionResponse|error

Sample code:

sites:SiteCollectionResponse result = check client->listSite();

Sample response:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"id": "contoso.sharepoint.com,site-id",
"name": "Marketing",
"displayName": "Marketing Team Site",
"webUrl": "https://contoso.sharepoint.com/sites/marketing",
"createdDateTime": "2024-01-15T10:00:00Z",
"lastModifiedDateTime": "2024-06-01T08:30:00Z"
}
]
}
getSite

Retrieves the metadata of a SharePoint site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetSiteQueriesNoOData query parameters ($select, $expand)

Returns: Site|error

Sample code:

sites:Site result = check client->getSite("site-id");

Sample response:

{
"id": "contoso.sharepoint.com,site-id",
"name": "Marketing",
"displayName": "Marketing Team Site",
"webUrl": "https://contoso.sharepoint.com/sites/marketing",
"createdDateTime": "2024-01-15T10:00:00Z",
"lastModifiedDateTime": "2024-06-01T08:30:00Z"
}
updateSite

Updates a SharePoint site with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadSiteYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:Site payload = {displayName: "Updated Marketing Site"};
check client->updateSite("site-id", payload);

Analytics

getAnalytics

Retrieves the item analytics resource for a site, summarizing access and activity statistics.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetAnalyticsQueriesNoOData query parameters ($select, $expand)

Returns: ItemAnalytics|error

Sample code:

sites:ItemAnalytics result = check client->getAnalytics("site-id");

Sample response:

{
"id": "analytics-id",
"allTime": {
"access": { "actionCount": 120, "actorCount": 25 }
},
"lastSevenDays": {
"access": { "actionCount": 18, "actorCount": 6 }
}
}
deleteAnalytics

Deletes the item analytics navigation property of a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersDeleteAnalyticsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->deleteAnalytics("site-id");
updateAnalytics

Updates the item analytics navigation property of a site with new values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadItemAnalyticsYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ItemAnalytics payload = {};
check client->updateAnalytics("site-id", payload);
analyticsGetAllTime

Retrieves the all-time aggregated activity statistics for a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsGetAllTimeQueriesNoOData query parameters ($select, $expand)

Returns: ItemActivityStat|error

Sample code:

sites:ItemActivityStat result = check client->analyticsGetAllTime("site-id");

Sample response:

{
"id": "allTime",
"startDateTime": "2018-01-01T00:00:00Z",
"endDateTime": "2024-06-01T00:00:00Z",
"access": { "actionCount": 120, "actorCount": 25 }
}
analyticsListItemActivityStats

Lists the item activity statistics for a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsListItemActivityStatsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ItemActivityStatCollectionResponse|error

Sample code:

sites:ItemActivityStatCollectionResponse result = check client->analyticsListItemActivityStats("site-id");

Sample response:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site-id')/analytics/itemActivityStats",
"value": [
{
"id": "stat-id-1",
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 10, "actorCount": 3 }
}
]
}
analyticsCreateItemActivityStats

Creates a new item activity stat under a site's analytics.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadItemActivityStatYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ItemActivityStat|error

Sample code:

sites:ItemActivityStat payload = {
startDateTime: "2024-06-01T00:00:00Z",
endDateTime: "2024-06-02T00:00:00Z"
};
sites:ItemActivityStat result = check client->analyticsCreateItemActivityStats("site-id", payload);

Sample response:

{
"id": "stat-id-new",
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z"
}
analyticsGetItemActivityStats

Retrieves a single item activity stat by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsGetItemActivityStatsQueriesNoOData query parameters ($select, $expand)

Returns: ItemActivityStat|error

Sample code:

sites:ItemActivityStat result = check client->analyticsGetItemActivityStats("site-id", "stat-id");

Sample response:

{
"id": "stat-id",
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 10, "actorCount": 3 }
}
analyticsDeleteItemActivityStats

Deletes an item activity stat from a site's analytics.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
headersAnalyticsDeleteItemActivityStatsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->analyticsDeleteItemActivityStats("site-id", "stat-id");
analyticsUpdateItemActivityStats

Updates an item activity stat with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
payloadItemActivityStatYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ItemActivityStat payload = {};
check client->analyticsUpdateItemActivityStats("site-id", "stat-id", payload);
analyticsItemActivityStatsListActivities

Lists the item activities recorded under a specific item activity stat.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsListActivitiesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ItemActivityCollectionResponse|error

Sample code:

sites:ItemActivityCollectionResponse result = check client->analyticsItemActivityStatsListActivities("site-id", "stat-id");

Sample response:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site-id')/analytics/itemActivityStats('stat-id')/activities",
"value": [
{
"id": "activity-id-1",
"action": { "view": {} },
"actor": { "user": { "displayName": "Adele Vance" } }
}
]
}
analyticsItemActivityStatsCreateActivities

Creates a new item activity under an item activity stat.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
payloadItemActivityYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ItemActivity|error

Sample code:

sites:ItemActivity payload = {};
sites:ItemActivity result = check client->analyticsItemActivityStatsCreateActivities("site-id", "stat-id", payload);

Sample response:

{
"id": "activity-id-new",
"action": { "edit": {} }
}
analyticsItemActivityStatsGetActivities

Retrieves a specific item activity by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsGetActivitiesQueriesNoOData query parameters ($select, $expand)

Returns: ItemActivity|error

Sample code:

sites:ItemActivity result = check client->analyticsItemActivityStatsGetActivities("site-id", "stat-id", "activity-id");

Sample response:

{
"id": "activity-id",
"action": { "view": {} },
"actor": { "user": { "displayName": "Adele Vance" } }
}
analyticsItemActivityStatsDeleteActivities

Deletes an item activity from an item activity stat.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
headersAnalyticsItemActivityStatsDeleteActivitiesHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->analyticsItemActivityStatsDeleteActivities("site-id", "stat-id", "activity-id");
analyticsItemActivityStatsUpdateActivities

Updates an item activity with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
payloadItemActivityYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ItemActivity payload = {};
check client->analyticsItemActivityStatsUpdateActivities("site-id", "stat-id", "activity-id", payload);
analyticsItemActivityStatsActivitiesGetDriveItem

Retrieves the drive item associated with an item activity.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsActivitiesGetDriveItemQueriesNoOData query parameters ($select, $expand)

Returns: DriveItem|error

Sample code:

sites:DriveItem result = check client->analyticsItemActivityStatsActivitiesGetDriveItem("site-id", "stat-id", "activity-id");

Sample response:

{
"id": "drive-item-id",
"name": "Report.docx",
"size": 24576,
"webUrl": "https://contoso.sharepoint.com/sites/marketing/Documents/Report.docx"
}
analyticsItemActivityStatsActivitiesGetDriveItemContent

Retrieves the binary content of the drive item associated with an item activity.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsActivitiesGetDriveItemContentQueriesNoOData query parameters ($format)

Returns: byte[]|error

Sample code:

byte[] result = check client->analyticsItemActivityStatsActivitiesGetDriveItemContent("site-id", "stat-id", "activity-id");
analyticsItemActivityStatsActivitiesUpdateDriveItemContent

Updates the binary content of the drive item associated with an item activity.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
itemActivityIdstringYesThe unique identifier of the itemActivity
payloadbyte[]YesNew binary content
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

byte[] payload = [];
check client->analyticsItemActivityStatsActivitiesUpdateDriveItemContent("site-id", "stat-id", "activity-id", payload);
analyticsItemActivityStatsActivitiesGetCount972d

Gets the total count of activities under an item activity stat.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
itemActivityStatIdstringYesThe unique identifier of the itemActivityStat
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsActivitiesGetCount972dQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->analyticsItemActivityStatsActivitiesGetCount972d("site-id", "stat-id");

Sample response:

"12"
analyticsItemActivityStatsGetCountC4ac

Gets the total count of item activity stats under a site's analytics.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsItemActivityStatsGetCountC4acQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->analyticsItemActivityStatsGetCountC4ac("site-id");

Sample response:

"7"
analyticsGetLastSevenDays

Retrieves the aggregated activity statistics for the last seven days for a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*AnalyticsGetLastSevenDaysQueriesNoOData query parameters ($select, $expand)

Returns: ItemActivityStat|error

Sample code:

sites:ItemActivityStat result = check client->analyticsGetLastSevenDays("site-id");

Sample response:

{
"id": "lastSevenDays",
"startDateTime": "2024-06-05T00:00:00Z",
"endDateTime": "2024-06-12T00:00:00Z",
"access": { "actionCount": 18, "actorCount": 6 }
}
getActivitiesByInterval96b0

Invokes the getActivitiesByInterval function on a site to return activity statistics aggregated using the default interval.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetActivitiesByInterval96b0QueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfItemActivityStat|error

Sample code:

sites:CollectionOfItemActivityStat result = check client->getActivitiesByInterval96b0("site-id");

Sample response:

{
"value": [
{
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 10, "actorCount": 3 }
}
]
}
getActivitiesByInterval9468

Invokes the getActivitiesByInterval function on a site with explicit startDateTime, endDateTime, and interval parameters.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
startDateTimestring?YesThe start date and time of the interval (startDateTime='{startDateTime}')
endDateTimestring?YesThe end date and time of the interval (endDateTime='{endDateTime}')
intervalstring?YesThe aggregation interval (interval='{interval}')
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetActivitiesByInterval9468QueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfItemActivityStat|error

Sample code:

sites:CollectionOfItemActivityStat result = check client->getActivitiesByInterval9468(
"site-id", "2024-06-01", "2024-06-08", "day");

Sample response:

{
"value": [
{
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 4, "actorCount": 2 }
}
]
}

Columns

listColumns

Lists the column definitions of a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListColumnsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->listColumns("site-id");

Sample response:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site-id')/columns",
"value": [
{
"id": "column-id-1",
"name": "Title",
"displayName": "Title",
"required": true,
"text": { "maxLength": 255 }
}
]
}
createColumns

Creates a new column definition on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadColumnDefinitionYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition payload = {
name: "Department",
displayName: "Department",
text: {}
};
sites:ColumnDefinition result = check client->createColumns("site-id", payload);

Sample response:

{
"id": "column-id-new",
"name": "Department",
"displayName": "Department",
"text": {}
}
getColumns

Retrieves a column definition by its identifier from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetColumnsQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->getColumns("site-id", "column-id");

Sample response:

{
"id": "column-id",
"name": "Title",
"displayName": "Title",
"required": true,
"text": { "maxLength": 255 }
}
deleteColumns

Deletes a column definition from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersDeleteColumnsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->deleteColumns("site-id", "column-id");
updateColumns

Updates a column definition with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
payloadColumnDefinitionYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ColumnDefinition payload = {displayName: "Renamed Column"};
check client->updateColumns("site-id", "column-id", payload);
columnsGetSourceColumn

Retrieves the source column from which a derived column inherits its definition.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ColumnsGetSourceColumnQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->columnsGetSourceColumn("site-id", "column-id");

Sample response:

{
"id": "source-column-id",
"name": "Title",
"displayName": "Title"
}
columnsGetCountA8bb

Gets the total count of column definitions on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ColumnsGetCountA8bbQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->columnsGetCountA8bb("site-id");

Sample response:

"8"

Content Types

listContentTypes

Lists the content types defined on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListContentTypesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ContentTypeCollectionResponse|error

Sample code:

sites:ContentTypeCollectionResponse result = check client->listContentTypes("site-id");

Sample response:

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site-id')/contentTypes",
"value": [
{
"id": "0x0101",
"name": "Document",
"description": "Create a new document.",
"group": "Document Content Types"
}
]
}
createContentTypes

Creates a new content type on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadContentTypeYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ContentType|error

Sample code:

sites:ContentType payload = {
name: "Press Release",
description: "Press release content type",
group: "Marketing"
};
sites:ContentType result = check client->createContentTypes("site-id", payload);

Sample response:

{
"id": "0x0101009A",
"name": "Press Release",
"description": "Press release content type",
"group": "Marketing"
}
getContentTypes

Retrieves a content type by its identifier from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetContentTypesQueriesNoOData query parameters ($select, $expand)

Returns: ContentType|error

Sample code:

sites:ContentType result = check client->getContentTypes("site-id", "content-type-id");

Sample response:

{
"id": "0x0101",
"name": "Document",
"description": "Create a new document.",
"group": "Document Content Types"
}
deleteContentTypes

Deletes a content type from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersDeleteContentTypesHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->deleteContentTypes("site-id", "content-type-id");
updateContentTypes

Updates a content type with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
payloadContentTypeYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ContentType payload = {description: "Updated description"};
check client->updateContentTypes("site-id", "content-type-id", payload);
contentTypesGetBase

Retrieves the parent (base) content type of a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetBaseQueriesNoOData query parameters ($select, $expand)

Returns: ContentType|error

Sample code:

sites:ContentType result = check client->contentTypesGetBase("site-id", "content-type-id");

Sample response:

{
"id": "0x0101",
"name": "Document",
"group": "Document Content Types"
}
contentTypesListBaseTypes

Lists the ancestor (base) content types of a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesListBaseTypesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ContentTypeCollectionResponse|error

Sample code:

sites:ContentTypeCollectionResponse result = check client->contentTypesListBaseTypes("site-id", "content-type-id");

Sample response:

{
"value": [
{ "id": "0x01", "name": "Item" },
{ "id": "0x0101", "name": "Document" }
]
}
contentTypesGetBaseTypes

Retrieves a specific ancestor content type of a content type by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
contentTypeId1stringYesThe unique identifier of the base contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetBaseTypesQueriesNoOData query parameters ($select, $expand)

Returns: ContentType|error

Sample code:

sites:ContentType result = check client->contentTypesGetBaseTypes("site-id", "content-type-id", "base-content-type-id");

Sample response:

{
"id": "0x01",
"name": "Item"
}
contentTypesBaseTypesGetCount6b07

Gets the total count of ancestor content types of a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesBaseTypesGetCount6b07QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->contentTypesBaseTypesGetCount6b07("site-id", "content-type-id");

Sample response:

"3"
contentTypesListColumnLinks

Lists the column links of a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesListColumnLinksQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnLinkCollectionResponse|error

Sample code:

sites:ColumnLinkCollectionResponse result = check client->contentTypesListColumnLinks("site-id", "content-type-id");

Sample response:

{
"value": [
{ "id": "column-link-1", "name": "Title" }
]
}
contentTypesCreateColumnLinks

Creates a new column link on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
payloadColumnLinkYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ColumnLink|error

Sample code:

sites:ColumnLink payload = {name: "Department"};
sites:ColumnLink result = check client->contentTypesCreateColumnLinks("site-id", "content-type-id", payload);

Sample response:

{
"id": "column-link-new",
"name": "Department"
}
contentTypesGetColumnLinks

Retrieves a column link of a content type by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnLinkIdstringYesThe unique identifier of the columnLink
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetColumnLinksQueriesNoOData query parameters ($select, $expand)

Returns: ColumnLink|error

Sample code:

sites:ColumnLink result = check client->contentTypesGetColumnLinks("site-id", "content-type-id", "column-link-id");

Sample response:

{
"id": "column-link-id",
"name": "Title"
}
contentTypesDeleteColumnLinks

Deletes a column link from a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnLinkIdstringYesThe unique identifier of the columnLink
headersContentTypesDeleteColumnLinksHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->contentTypesDeleteColumnLinks("site-id", "content-type-id", "column-link-id");
contentTypesUpdateColumnLinks

Updates a column link of a content type with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnLinkIdstringYesThe unique identifier of the columnLink
payloadColumnLinkYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ColumnLink payload = {name: "RenamedColumn"};
check client->contentTypesUpdateColumnLinks("site-id", "content-type-id", "column-link-id", payload);
contentTypesColumnLinksGetCount7bc1

Gets the total count of column links on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesColumnLinksGetCount7bc1QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->contentTypesColumnLinksGetCount7bc1("site-id", "content-type-id");

Sample response:

"5"
contentTypesListColumnPositions

Lists the column definitions in the order they appear on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesListColumnPositionsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->contentTypesListColumnPositions("site-id", "content-type-id");

Sample response:

{
"value": [
{ "id": "column-id-1", "name": "Title" },
{ "id": "column-id-2", "name": "Department" }
]
}
contentTypesGetColumnPositions

Retrieves a column at a specific position on a content type by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetColumnPositionsQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->contentTypesGetColumnPositions("site-id", "content-type-id", "column-id");

Sample response:

{
"id": "column-id",
"name": "Title",
"displayName": "Title"
}
contentTypesColumnPositionsGetCountDea9

Gets the total count of column positions on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesColumnPositionsGetCountDea9QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->contentTypesColumnPositionsGetCountDea9("site-id", "content-type-id");

Sample response:

"4"
contentTypesListColumns

Lists the columns of a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesListColumnsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->contentTypesListColumns("site-id", "content-type-id");

Sample response:

{
"value": [
{ "id": "column-id-1", "name": "Title", "displayName": "Title" }
]
}
contentTypesCreateColumns

Creates a new column on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
payloadColumnDefinitionYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition payload = {name: "Owner", displayName: "Owner", text: {}};
sites:ColumnDefinition result = check client->contentTypesCreateColumns("site-id", "content-type-id", payload);

Sample response:

{
"id": "column-id-new",
"name": "Owner",
"displayName": "Owner"
}
contentTypesGetColumns

Retrieves a column of a content type by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetColumnsQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->contentTypesGetColumns("site-id", "content-type-id", "column-id");

Sample response:

{
"id": "column-id",
"name": "Title",
"displayName": "Title"
}
contentTypesDeleteColumns

Deletes a column from a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersContentTypesDeleteColumnsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->contentTypesDeleteColumns("site-id", "content-type-id", "column-id");
contentTypesUpdateColumns

Updates a column of a content type with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
payloadColumnDefinitionYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ColumnDefinition payload = {displayName: "Renamed"};
check client->contentTypesUpdateColumns("site-id", "content-type-id", "column-id", payload);
contentTypesColumnsGetSourceColumn

Retrieves the source column from which a content type's column inherits its definition.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesColumnsGetSourceColumnQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->contentTypesColumnsGetSourceColumn("site-id", "content-type-id", "column-id");

Sample response:

{
"id": "source-column-id",
"name": "Title",
"displayName": "Title"
}
contentTypesColumnsGetCount896b

Gets the total count of columns on a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesColumnsGetCount896bQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->contentTypesColumnsGetCount896b("site-id", "content-type-id");

Sample response:

"6"
contentTypesContentTypeAssociateWithHubSites

Associates a content type with a list of hub sites, optionally propagating it to lists that already use it.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
payloadContentTypeIdAssociateWithHubSitesBodyYesList of hub site URLs and propagation flag
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ContentTypeIdAssociateWithHubSitesBody payload = {
hubSiteUrls: ["https://contoso.sharepoint.com/sites/hub"],
propagateToExistingLists: true
};
check client->contentTypesContentTypeAssociateWithHubSites("site-id", "content-type-id", payload);
contentTypesContentTypeCopyToDefaultContentLocation

Copies a file to the default content location for a content type.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
payloadContentTypeIdCopyToDefaultContentLocationBodyYesSource file reference and target destination file name
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ContentTypeIdCopyToDefaultContentLocationBody payload = {
sourceFile: {driveId: "drive-id", id: "item-id"},
destinationFileName: "Template.docx"
};
check client->contentTypesContentTypeCopyToDefaultContentLocation("site-id", "content-type-id", payload);
contentTypesContentTypeIsPublished

Indicates whether a content type is published to the content type hub.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: BooleanValueResponse|error

Sample code:

sites:BooleanValueResponse result = check client->contentTypesContentTypeIsPublished("site-id", "content-type-id");

Sample response:

{
"value": true
}
contentTypesContentTypePublish

Publishes a content type from the content type hub so it is available across sites.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->contentTypesContentTypePublish("site-id", "content-type-id");
contentTypesContentTypeUnpublish

Unpublishes a content type from the content type hub.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
contentTypeIdstringYesThe unique identifier of the contentType
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->contentTypesContentTypeUnpublish("site-id", "content-type-id");
contentTypesGetCount50aa

Gets the total count of content types on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetCount50aaQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->contentTypesGetCount50aa("site-id");

Sample response:

"15"
contentTypesAddCopy

Adds a copy of a content type from another location on the site collection to a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadContentTypesAddCopyBodyYesURL or identifier of the content type to copy
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ContentTypeOrNullResponse|error

Sample code:

sites:ContentTypesAddCopyBody payload = {contentType: "https://contoso.sharepoint.com/_cts/Document"};
sites:ContentTypeOrNullResponse result = check client->contentTypesAddCopy("site-id", payload);

Sample response:

{
"id": "0x0101009A",
"name": "Document",
"group": "Document Content Types"
}
contentTypesAddCopyFromContentTypeHub

Adds a copy of a content type from the content type hub to a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadContentTypesAddCopyFromContentTypeHubBodyYesIdentifier of the hub content type to copy
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ContentTypeOrNullResponse|error

Sample code:

sites:ContentTypesAddCopyFromContentTypeHubBody payload = {contentTypeId: "0x0101009A"};
sites:ContentTypeOrNullResponse result = check client->contentTypesAddCopyFromContentTypeHub("site-id", payload);

Sample response:

{
"id": "0x0101009A",
"name": "Press Release",
"group": "Marketing"
}
contentTypesGetCompatibleHubContentTypes

Lists the content types from the content type hub that are compatible with a site and can be added to it.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ContentTypesGetCompatibleHubContentTypesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfContentType|error

Sample code:

sites:CollectionOfContentType result = check client->contentTypesGetCompatibleHubContentTypes("site-id");

Sample response:

{
"value": [
{ "id": "0x0101009A", "name": "Press Release" }
]
}

Created By User

getCreatedByUser

Retrieves the user who created the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetCreatedByUserQueriesNoOData query parameters ($select, $expand)

Returns: User|error

Sample code:

sites:User result = check client->getCreatedByUser("site-id");

Sample response:

{
"id": "user-id",
"displayName": "Adele Vance",
"userPrincipalName": "[email protected]"
}
createdByUserGetMailboxSettings

Retrieves the mailbox settings of the user who created the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*CreatedByUserGetMailboxSettingsQueriesNoOData query parameters ($select)

Returns: MailboxSettings|error

Sample code:

sites:MailboxSettings result = check client->createdByUserGetMailboxSettings("site-id");

Sample response:

{
"timeZone": "Pacific Standard Time",
"language": { "locale": "en-US" }
}
createdByUserUpdateMailboxSettings

Updates the mailbox settings of the user who created the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadMailboxSettingsYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:MailboxSettings payload = {timeZone: "Eastern Standard Time"};
check client->createdByUserUpdateMailboxSettings("site-id", payload);
createdByUserListServiceProvisioningErrors

Lists the service provisioning errors for the user who created the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*CreatedByUserListServiceProvisioningErrorsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $count)

Returns: ServiceProvisioningErrorCollectionResponse|error

Sample code:

sites:ServiceProvisioningErrorCollectionResponse result = check client->createdByUserListServiceProvisioningErrors("site-id");

Sample response:

{
"value": []
}
createdByUserServiceProvisioningErrorsGetCountC398

Gets the total count of service provisioning errors for the user who created the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*CreatedByUserServiceProvisioningErrorsGetCountC398QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->createdByUserServiceProvisioningErrorsGetCountC398("site-id");

Sample response:

"0"

Drives

getDrive

Retrieves the default document library (drive) for a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetDriveQueriesNoOData query parameters ($select, $expand)

Returns: Drive|error

Sample code:

sites:Drive result = check client->getDrive("site-id");

Sample response:

{
"id": "drive-id",
"name": "Documents",
"driveType": "documentLibrary",
"webUrl": "https://contoso.sharepoint.com/sites/marketing/Shared%20Documents"
}
listDrives

Lists all document libraries (drives) available on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListDrivesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: DriveCollectionResponse|error

Sample code:

sites:DriveCollectionResponse result = check client->listDrives("site-id");

Sample response:

{
"value": [
{ "id": "drive-id-1", "name": "Documents", "driveType": "documentLibrary" }
]
}
getDrives

Retrieves a specific document library (drive) of a site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
driveIdstringYesThe unique identifier of the drive
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetDrivesQueriesNoOData query parameters ($select, $expand)

Returns: Drive|error

Sample code:

sites:Drive result = check client->getDrives("site-id", "drive-id");

Sample response:

{
"id": "drive-id",
"name": "Documents",
"driveType": "documentLibrary"
}
drivesGetCount5071

Gets the total count of drives on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*DrivesGetCount5071QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->drivesGetCount5071("site-id");

Sample response:

"2"

External Columns

listExternalColumns

Lists the externally provisioned column definitions of a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListExternalColumnsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->listExternalColumns("site-id");

Sample response:

{
"value": [
{ "id": "external-column-id-1", "name": "ExternalRef", "displayName": "External Reference" }
]
}
getExternalColumns

Retrieves an externally provisioned column definition by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
columnDefinitionIdstringYesThe unique identifier of the columnDefinition
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetExternalColumnsQueriesNoOData query parameters ($select, $expand)

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition result = check client->getExternalColumns("site-id", "column-id");

Sample response:

{
"id": "column-id",
"name": "ExternalRef",
"displayName": "External Reference"
}
externalColumnsGetCount3855

Gets the total count of external column definitions on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ExternalColumnsGetCount3855QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->externalColumnsGetCount3855("site-id");

Sample response:

"1"

Items

listItems

Lists the base items of a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListItemsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: BaseItemCollectionResponse|error

Sample code:

sites:BaseItemCollectionResponse result = check client->listItems("site-id");

Sample response:

{
"value": [
{ "id": "item-id-1", "name": "Document1", "webUrl": "https://contoso.sharepoint.com/sites/marketing/Document1" }
]
}
getItems

Retrieves a base item from a site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
baseItemIdstringYesThe unique identifier of the baseItem
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetItemsQueriesNoOData query parameters ($select, $expand)

Returns: BaseItem|error

Sample code:

sites:BaseItem result = check client->getItems("site-id", "item-id");

Sample response:

{
"id": "item-id",
"name": "Document1",
"webUrl": "https://contoso.sharepoint.com/sites/marketing/Document1"
}
itemsGetCount1b67

Gets the total count of base items on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ItemsGetCount1b67QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->itemsGetCount1b67("site-id");

Sample response:

"23"

Last Modified By User

getLastModifiedByUser

Retrieves the user who last modified the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetLastModifiedByUserQueriesNoOData query parameters ($select, $expand)

Returns: User|error

Sample code:

sites:User result = check client->getLastModifiedByUser("site-id");

Sample response:

{
"id": "user-id",
"displayName": "Megan Bowen",
"userPrincipalName": "[email protected]"
}
lastModifiedByUserGetMailboxSettings

Retrieves the mailbox settings of the user who last modified the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*LastModifiedByUserGetMailboxSettingsQueriesNoOData query parameters ($select)

Returns: MailboxSettings|error

Sample code:

sites:MailboxSettings result = check client->lastModifiedByUserGetMailboxSettings("site-id");

Sample response:

{
"timeZone": "Pacific Standard Time",
"language": { "locale": "en-US" }
}
lastModifiedByUserUpdateMailboxSettings

Updates the mailbox settings of the user who last modified the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadMailboxSettingsYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:MailboxSettings payload = {timeZone: "UTC"};
check client->lastModifiedByUserUpdateMailboxSettings("site-id", payload);
lastModifiedByUserListServiceProvisioningErrors

Lists the service provisioning errors for the user who last modified the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*LastModifiedByUserListServiceProvisioningErrorsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $count)

Returns: ServiceProvisioningErrorCollectionResponse|error

Sample code:

sites:ServiceProvisioningErrorCollectionResponse result = check client->lastModifiedByUserListServiceProvisioningErrors("site-id");

Sample response:

{
"value": []
}
lastModifiedByUserServiceProvisioningErrorsGetCount4573

Gets the total count of service provisioning errors for the user who last modified the site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*LastModifiedByUserServiceProvisioningErrorsGetCount4573QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->lastModifiedByUserServiceProvisioningErrorsGetCount4573("site-id");

Sample response:

"0"

Applicable Content Types For List

getApplicableContentTypesForList

Invokes the getApplicableContentTypesForList function to return the content types that are applicable to a specific list on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
listIdstringYesThe unique identifier of the list (listId='{listId}')
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetApplicableContentTypesForListQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfContentType|error

Sample code:

sites:CollectionOfContentType result = check client->getApplicableContentTypesForList("site-id", "list-id");

Sample response:

{
"value": [
{ "id": "0x0101", "name": "Document", "group": "Document Content Types" }
]
}

Site By Path

getByPath

Resolves a SharePoint site by its server-relative path under a site collection.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site (path='{path}')
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: SiteOrNullResponse|error

Sample code:

sites:SiteOrNullResponse result = check client->getByPath("site-id", "/sites/marketing");

Sample response:

{
"id": "contoso.sharepoint.com,collection-id,site-id",
"name": "Marketing",
"webUrl": "https://contoso.sharepoint.com/sites/marketing"
}
getByPathGetAnalytics

Retrieves the item analytics resource of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetAnalyticsQueriesNoOData query parameters ($select, $expand)

Returns: ItemAnalytics|error

Sample code:

sites:ItemAnalytics result = check client->getByPathGetAnalytics("site-id", "/sites/marketing");

Sample response:

{
"id": "analytics-id",
"allTime": { "access": { "actionCount": 120, "actorCount": 25 } }
}
getByPathDeleteAnalytics

Deletes the item analytics navigation property of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersGetByPathDeleteAnalyticsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->getByPathDeleteAnalytics("site-id", "/sites/marketing");
getByPathUpdateAnalytics

Updates the item analytics navigation property of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadItemAnalyticsYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:ItemAnalytics payload = {};
check client->getByPathUpdateAnalytics("site-id", "/sites/marketing", payload);
getByPathListColumns

Lists the column definitions of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListColumnsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->getByPathListColumns("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "column-id-1", "name": "Title", "displayName": "Title" }
]
}
getByPathCreateColumns

Creates a new column definition on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadColumnDefinitionYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ColumnDefinition|error

Sample code:

sites:ColumnDefinition payload = {name: "Department", displayName: "Department", text: {}};
sites:ColumnDefinition result = check client->getByPathCreateColumns("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "column-id-new",
"name": "Department",
"displayName": "Department"
}
getByPathListContentTypes

Lists the content types of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListContentTypesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ContentTypeCollectionResponse|error

Sample code:

sites:ContentTypeCollectionResponse result = check client->getByPathListContentTypes("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "0x0101", "name": "Document" }
]
}
getByPathCreateContentTypes

Creates a content type on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadContentTypeYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: ContentType|error

Sample code:

sites:ContentType payload = {name: "Press Release", group: "Marketing"};
sites:ContentType result = check client->getByPathCreateContentTypes("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "0x0101009A",
"name": "Press Release",
"group": "Marketing"
}
getByPathGetCreatedByUser

Retrieves the user who created a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetCreatedByUserQueriesNoOData query parameters ($select, $expand)

Returns: User|error

Sample code:

sites:User result = check client->getByPathGetCreatedByUser("site-id", "/sites/marketing");

Sample response:

{
"id": "user-id",
"displayName": "Adele Vance"
}
getByPathGetDrive

Retrieves the default document library (drive) of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetDriveQueriesNoOData query parameters ($select, $expand)

Returns: Drive|error

Sample code:

sites:Drive result = check client->getByPathGetDrive("site-id", "/sites/marketing");

Sample response:

{
"id": "drive-id",
"name": "Documents",
"driveType": "documentLibrary"
}
getByPathListDrives

Lists the document libraries (drives) of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListDrivesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: DriveCollectionResponse|error

Sample code:

sites:DriveCollectionResponse result = check client->getByPathListDrives("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "drive-id-1", "name": "Documents" }
]
}
getByPathListExternalColumns

Lists the externally provisioned column definitions of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListExternalColumnsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ColumnDefinitionCollectionResponse|error

Sample code:

sites:ColumnDefinitionCollectionResponse result = check client->getByPathListExternalColumns("site-id", "/sites/marketing");

Sample response:

{
"value": []
}
getByPathListItems

Lists the base items of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListItemsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: BaseItemCollectionResponse|error

Sample code:

sites:BaseItemCollectionResponse result = check client->getByPathListItems("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "item-id-1", "name": "Document1" }
]
}
getByPathGetLastModifiedByUser

Retrieves the user who last modified a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetLastModifiedByUserQueriesNoOData query parameters ($select, $expand)

Returns: User|error

Sample code:

sites:User result = check client->getByPathGetLastModifiedByUser("site-id", "/sites/marketing");

Sample response:

{
"id": "user-id",
"displayName": "Megan Bowen"
}
getByPathListLists

Lists the SharePoint lists on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListListsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: ListCollectionResponse|error

Sample code:

sites:ListCollectionResponse result = check client->getByPathListLists("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "list-id-1", "displayName": "Documents", "name": "Shared Documents" }
]
}
getByPathCreateLists

Creates a SharePoint list on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadListYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: List|error

Sample code:

sites:List payload = {displayName: "Announcements", list: {template: "announcements"}};
sites:List result = check client->getByPathCreateLists("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "list-id-new",
"displayName": "Announcements",
"name": "Announcements"
}
getByPathGetActivitiesByInterval96b0

Invokes the getActivitiesByInterval function on a site resolved by path using the default interval.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetActivitiesByInterval96b0QueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfItemActivityStat|error

Sample code:

sites:CollectionOfItemActivityStat result = check client->getByPathGetActivitiesByInterval96b0("site-id", "/sites/marketing");

Sample response:

{
"value": [
{
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 10, "actorCount": 3 }
}
]
}
getByPathGetActivitiesByInterval9468

Invokes the getActivitiesByInterval function on a site resolved by path with explicit startDateTime, endDateTime, and interval parameters.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
startDateTimestring?YesThe start date and time of the interval
endDateTimestring?YesThe end date and time of the interval
intervalstring?YesThe aggregation interval
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetActivitiesByInterval9468QueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfItemActivityStat|error

Sample code:

sites:CollectionOfItemActivityStat result = check client->getByPathGetActivitiesByInterval9468(
"site-id", "/sites/marketing", "2024-06-01", "2024-06-08", "day");

Sample response:

{
"value": [
{
"startDateTime": "2024-06-01T00:00:00Z",
"endDateTime": "2024-06-02T00:00:00Z",
"access": { "actionCount": 4, "actorCount": 2 }
}
]
}
getByPathGetApplicableContentTypesForList

Invokes the getApplicableContentTypesForList function on a site resolved by path, returning the content types applicable to a specific list.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
listIdstringYesThe unique identifier of the list
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetApplicableContentTypesForListQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfContentType|error

Sample code:

sites:CollectionOfContentType result = check client->getByPathGetApplicableContentTypesForList(
"site-id", "/sites/marketing", "list-id");

Sample response:

{
"value": [
{ "id": "0x0101", "name": "Document" }
]
}
getByPathGetOnenote

Retrieves the OneNote notebook resource attached to a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetOnenoteQueriesNoOData query parameters ($select, $expand)

Returns: Onenote|error

Sample code:

sites:Onenote result = check client->getByPathGetOnenote("site-id", "/sites/marketing");

Sample response:

{
"id": "onenote-id"
}
getByPathDeleteOnenote

Deletes the OneNote navigation property of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersGetByPathDeleteOnenoteHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->getByPathDeleteOnenote("site-id", "/sites/marketing");
getByPathUpdateOnenote

Updates the OneNote navigation property of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadOnenoteYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:Onenote payload = {};
check client->getByPathUpdateOnenote("site-id", "/sites/marketing", payload);
getByPathListOperations

Lists the long-running operations of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListOperationsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: RichLongRunningOperationCollectionResponse|error

Sample code:

sites:RichLongRunningOperationCollectionResponse result = check client->getByPathListOperations("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "operation-id-1", "status": "completed", "percentageComplete": 100 }
]
}
getByPathCreateOperations

Creates a long-running operation on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadRichLongRunningOperationYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: RichLongRunningOperation|error

Sample code:

sites:RichLongRunningOperation payload = {};
sites:RichLongRunningOperation result = check client->getByPathCreateOperations("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "operation-id-new",
"status": "notStarted"
}
getByPathListPages

Lists the site pages of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListPagesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: BaseSitePageCollectionResponse|error

Sample code:

sites:BaseSitePageCollectionResponse result = check client->getByPathListPages("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "page-id-1", "name": "home.aspx", "title": "Home" }
]
}
getByPathCreatePages

Creates a site page on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadBaseSitePageYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: BaseSitePage|error

Sample code:

sites:BaseSitePage payload = {name: "new-page.aspx", title: "New Page"};
sites:BaseSitePage result = check client->getByPathCreatePages("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "page-id-new",
"name": "new-page.aspx",
"title": "New Page"
}
getByPathListPermissions

Lists the permissions granted on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListPermissionsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: PermissionCollectionResponse|error

Sample code:

sites:PermissionCollectionResponse result = check client->getByPathListPermissions("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "permission-id-1", "roles": ["read"] }
]
}
getByPathCreatePermissions

Creates a permission on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadPermissionYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Permission|error

Sample code:

sites:Permission payload = {roles: ["read"]};
sites:Permission result = check client->getByPathCreatePermissions("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "permission-id-new",
"roles": ["read"]
}
getByPathListSites

Lists the subsites of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListSitesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: SiteCollectionResponse|error

Sample code:

sites:SiteCollectionResponse result = check client->getByPathListSites("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "subsite-id-1", "name": "Events", "webUrl": "https://contoso.sharepoint.com/sites/marketing/events" }
]
}
getByPathGetTermStore

Retrieves the default term store of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathGetTermStoreQueriesNoOData query parameters ($select, $expand)

Returns: TermStoreStore|error

Sample code:

sites:TermStoreStore result = check client->getByPathGetTermStore("site-id", "/sites/marketing");

Sample response:

{
"id": "term-store-id",
"defaultLanguageTag": "en-US"
}
getByPathDeleteTermStore

Deletes the default term store of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersGetByPathDeleteTermStoreHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->getByPathDeleteTermStore("site-id", "/sites/marketing");
getByPathUpdateTermStore

Updates the default term store of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadTermStoreStoreYesNew property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:TermStoreStore payload = {defaultLanguageTag: "en-US"};
check client->getByPathUpdateTermStore("site-id", "/sites/marketing", payload);
getByPathListTermStores

Lists the term stores of a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetByPathListTermStoresQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: TermStoreStoreCollectionResponse|error

Sample code:

sites:TermStoreStoreCollectionResponse result = check client->getByPathListTermStores("site-id", "/sites/marketing");

Sample response:

{
"value": [
{ "id": "term-store-id-1", "defaultLanguageTag": "en-US" }
]
}
getByPathCreateTermStores

Creates a term store on a site resolved by path.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site collection
pathstring?YesThe server-relative path of the site
payloadTermStoreStoreYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: TermStoreStore|error

Sample code:

sites:TermStoreStore payload = {defaultLanguageTag: "en-US"};
sites:TermStoreStore result = check client->getByPathCreateTermStores("site-id", "/sites/marketing", payload);

Sample response:

{
"id": "term-store-id-new",
"defaultLanguageTag": "en-US"
}

Operations

listOperations

Lists the long-running operations on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListOperationsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: RichLongRunningOperationCollectionResponse|error

Sample code:

sites:RichLongRunningOperationCollectionResponse result = check client->listOperations("site-id");

Sample response:

{
"value": [
{ "id": "operation-id-1", "status": "completed", "percentageComplete": 100 }
]
}
createOperations

Creates a long-running operation on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadRichLongRunningOperationYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: RichLongRunningOperation|error

Sample code:

sites:RichLongRunningOperation payload = {};
sites:RichLongRunningOperation result = check client->createOperations("site-id", payload);

Sample response:

{
"id": "operation-id-new",
"status": "notStarted"
}
getOperations

Retrieves a long-running operation on a site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
richLongRunningOperationIdstringYesThe unique identifier of the richLongRunningOperation
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetOperationsQueriesNoOData query parameters ($select, $expand)

Returns: RichLongRunningOperation|error

Sample code:

sites:RichLongRunningOperation result = check client->getOperations("site-id", "operation-id");

Sample response:

{
"id": "operation-id",
"status": "running",
"percentageComplete": 50
}
deleteOperations

Deletes a long-running operation from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
richLongRunningOperationIdstringYesThe unique identifier of the richLongRunningOperation
headersDeleteOperationsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->deleteOperations("site-id", "operation-id");
updateOperations

Updates a long-running operation on a site with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
richLongRunningOperationIdstringYesThe unique identifier of the richLongRunningOperation
payloadRichLongRunningOperationYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:RichLongRunningOperation payload = {status: "completed"};
check client->updateOperations("site-id", "operation-id", payload);
operationsGetCount71b0

Gets the total count of long-running operations on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*OperationsGetCount71b0QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->operationsGetCount71b0("site-id");

Sample response:

"3"

Permissions

listPermissions

Lists the permissions granted on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListPermissionsQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: PermissionCollectionResponse|error

Sample code:

sites:PermissionCollectionResponse result = check client->listPermissions("site-id");

Sample response:

{
"value": [
{ "id": "permission-id-1", "roles": ["read"] }
]
}
createPermissions

Creates a permission on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
payloadPermissionYesNew navigation property
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Permission|error

Sample code:

sites:Permission payload = {roles: ["write"]};
sites:Permission result = check client->createPermissions("site-id", payload);

Sample response:

{
"id": "permission-id-new",
"roles": ["write"]
}
getPermissions

Retrieves a permission on a site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
permissionIdstringYesThe unique identifier of the permission
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetPermissionsQueriesNoOData query parameters ($select, $expand)

Returns: Permission|error

Sample code:

sites:Permission result = check client->getPermissions("site-id", "permission-id");

Sample response:

{
"id": "permission-id",
"roles": ["read"]
}
deletePermissions

Deletes a permission from a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
permissionIdstringYesThe unique identifier of the permission
headersDeletePermissionsHeadersNoHeaders to be sent with the request (supports If-Match ETag)

Returns: error?

Sample code:

check client->deletePermissions("site-id", "permission-id");
updatePermissions

Updates a permission on a site with new property values.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
permissionIdstringYesThe unique identifier of the permission
payloadPermissionYesNew navigation property values
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

sites:Permission payload = {roles: ["write"]};
check client->updatePermissions("site-id", "permission-id", payload);
permissionsPermissionGrant

Grants an existing permission to additional drive recipients and roles.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
permissionIdstringYesThe unique identifier of the permission
payloadPermissionIdGrantBodyYesRecipients and roles to grant the permission to
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CollectionOfPermission|error

Sample code:

sites:PermissionIdGrantBody payload = {
recipients: [{email: "[email protected]"}],
roles: ["read"]
};
sites:CollectionOfPermission result = check client->permissionsPermissionGrant("site-id", "permission-id", payload);

Sample response:

{
"value": [
{ "id": "permission-granted-id", "roles": ["read"] }
]
}
permissionsGetCount511e

Gets the total count of permissions on a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*PermissionsGetCount511eQueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->permissionsGetCount511e("site-id");

Sample response:

"4"

Subsites

listSites

Lists the subsites of a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*ListSitesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: SiteCollectionResponse|error

Sample code:

sites:SiteCollectionResponse result = check client->listSites("site-id");

Sample response:

{
"value": [
{ "id": "subsite-id-1", "name": "Events" }
]
}
getSites

Retrieves a specific subsite of a site by its identifier.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site
id1stringYesThe unique identifier of the subsite
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetSitesQueriesNoOData query parameters ($select, $expand)

Returns: Site|error

Sample code:

sites:Site result = check client->getSites("site-id", "subsite-id");

Sample response:

{
"id": "subsite-id",
"name": "Events",
"webUrl": "https://contoso.sharepoint.com/sites/marketing/events"
}
getCountF499

Gets the total count of subsites under a site.

Parameters:

NameTypeRequiredDescription
siteIdstringYesThe unique identifier of the parent site
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetCountF499QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->getCountF499("site-id");

Sample response:

"2"
getCount6254

Gets the total count of sites accessible to the application across the tenant.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetCount6254QueriesNoOData query parameters ($filter, $search)

Returns: string|error

Sample code:

string result = check client->getCount6254();

Sample response:

"42"
getAllSites

Invokes the getAllSites function to return all sites in the tenant, including subsites.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queries*GetAllSitesQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count)

Returns: CollectionOfSite|error

Sample code:

sites:CollectionOfSite result = check client->getAllSites();

Sample response:

{
"value": [
{ "id": "site-id-1", "name": "Marketing" },
{ "id": "site-id-2", "name": "Sales" }
]
}

Add / Delta / Remove

add

Adds (follows) a collection of sites to the application's site collection.

Parameters:

NameTypeRequiredDescription
payloadAddBodyYesArray of SharePoint sites to be added
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CollectionOfSite|error

Sample code:

sites:AddBody payload = {
value: [{id: "site-id-1"}, {id: "site-id-2"}]
};
sites:CollectionOfSite result = check client->add(payload);

Sample response:

{
"value": [
{ "id": "site-id-1", "name": "Marketing" }
]
}
delta

Invokes the delta function to track changes to sites in the tenant.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request
queries*DeltaQueriesNoOData query parameters ($top, $skip, $filter, $search, $orderby, $select, $expand, $count, $deltaToken, $skipToken)

Returns: CollectionOfSite1|error

Sample code:

sites:CollectionOfSite1 result = check client->delta();

Sample response:

{
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/sites/delta?token=abc",
"value": [
{ "id": "site-id-1", "name": "Marketing" }
]
}
remove

Removes (unfollows) a collection of sites from the application's site collection.

Parameters:

NameTypeRequiredDescription
payloadAddBodyYesArray of SharePoint sites to be removed
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: CollectionOfSite|error

Sample code:

sites:AddBody payload = {
value: [{id: "site-id-1"}]
};
sites:CollectionOfSite result = check client->remove(payload);

Sample response:

{
"value": [
{ "id": "site-id-1", "name": "Marketing" }
]
}