| title | Update sitePage |
|---|---|
| description | Update the properties of a sitePage object. |
| author | sangle7 |
| ms.localizationpriority | medium |
| ms.subservice | sharepoint |
| doc_type | apiPageType |
| ms.date | 04/12/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update the properties of a sitePage object.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
PATCH /sites/{sitesId}/pages/{sitePageId}/microsoft.graph.sitePage| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
Notes: : To ensure successful parsing of the request body, the
@odata.type=#microsoft.graph.sitePagemust be included in the request body.
[!INCLUDE table-intro]
These fields and be used in update requests.
| Property | Type | Description |
|---|---|---|
| description | String | Description of the site page. Optional. |
| thumbnailWebUrl | String | Url of the site page's thumbnail image. Optional. |
| title | String | Title of the site page. Optional. |
| showComments | Boolean | Boolean to determine whether or not to show comments at the bottom of the page. Optional. |
| showRecommendedPages | Boolean | Boolean to determine whether or not to show recommended pages at the bottom of the page. Optional. |
| promotionKind | PagePromotionType | Promotion kind of the SharePoint page. Optional. Only support promote a page (e.g from page to newsPost). Demote is not supported. |
| titleArea | titleArea | Title area on the site page. Optional. |
| canvasLayout | canvasLayout | The layout of the content in a page, including horizontal sections and vertical section. A content of the entire page layout needs to be provided, the update function does not support partial updates. Optional. |
If successful, this method returns a 200 OK response code and an updated sitePage object in the response body.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/sites/7f50f45e-714a-4264-9c59-3bf43ea4db8f/pages/df69e386-6c58-4df2-afc0-ab6327d5b202/microsoft.graph.sitePage
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sitePage",
"title": "sample",
"showComments": true,
"showRecommendedPages": false
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.sitePage",
"id": "0dd6ddd6-45bd-4acd-b683-de0e6e7231b7",
"name": "sample.aspx",
"webUrl": "https://contoso.sharepoint.com/SitePages/sample.aspx",
"title": "sample",
"pageLayout": "article",
"showComments": true,
"showRecommendedPages": false,
"createdBy": {
"user": {
"displayName": "Rahul Mittal",
"email": "rahmit@contoso.com"
}
},
"lastModifiedBy": {
"user": {
"displayName": "Rahul Mittal",
"email": "rahmit@contoso.com"
}
},
"publishingState": {
"level": "draft",
"versionId": "0.1"
},
"titleArea": {
"enableGradientEffect": true,
"imageWebUrl": "https://cdn.hubblecontent.osi.office.net/m365content/publish/005292d6-9dcc-4fc5-b50b-b2d0383a411b/image.jpg",
"layout": "colorBlock",
"showAuthor": true,
"showPublishedDate": false,
"showTextBlockAboveTitle": false,
"textAboveTitle": "TEXT ABOVE TITLE",
"textAlignment": "left",
"title": "sample",
"imageSourceType": 2
}
}