Skip to content

Latest commit

 

History

History
154 lines (121 loc) · 4.68 KB

File metadata and controls

154 lines (121 loc) · 4.68 KB
title Update pageTemplate
description Update the properties of a pageTemplate object.
author Yadong1106
ms.localizationpriority medium
ms.subservice sharepoint
doc_type apiPageType
ms.date 10/30/2024

Update pageTemplate

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Update the properties of a pageTemplate object.

Permissions

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]

HTTP request

PATCH /sites/{site-id}/pageTemplates/{page-template-id}/microsoft.graph.pageTemplate

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

Note:: You must include @odata.type=#microsoft.graph.pageTemplate in the request body. The @odata.type=#microsoft.graph.pageTemplate is a property in the HTTP request body for the Microsoft Graph API that specifies the page template type for SharePoint.

[!INCLUDE table-intro]

Property Type Description
description String The description of the page template. Optional.
thumbnailWebUrl String The URL of the page template's thumbnail image. Optional.
title String The title of the page template. Optional.
titleArea titleArea The title area on the page template. Optional.
canvasLayout canvasLayout The layout of the content in a page template, including horizontal sections and vertical section. The content of the entire page layout must be provided, because the update function doesn't support partial updates. Optional.

Response

If successful, this method returns a 200 OK response code and an updated pageTemplate object in the response body.

Examples

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/sites/dd00d52e-0db7-4d5f-8269-90060ac688d1/pageTemplates/8fbff3f5-0e5d-49e7-89c7-2b042b3bfaa6/microsoft.graph.pageTemplate
Content-Type: application/json

{
  "@odata.type": "#microsoft.graph.pageTemplate",
  "title": "sample",
  "showRecommendedPages": false
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

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.pageTemplate",
  "id": "0dd6ddd6-45bd-4acd-b683-de0e6e7231b7",
  "name": "sample.aspx",
  "webUrl": "https://contoso.sharepoint.com/SitePages/Templates/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": "checkout",
    "versionId": "0.1",
    "checkedOutBy": {
      "user": {
        "displayName": "Rahul Mittal",
        "email": "rahmit@contoso.com"
      }
    }
  },
  "titleArea": {
    "enableGradientEffect": true,
    "imageWebUrl": "https://cdn.contoso.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
  }
}