| author | Yadong1106 |
|---|---|
| description | Get the collection of pageTemplate objects from the page templates in a site. All page templates in the site are returned. |
| title | List pageTemplate |
| ms.localizationpriority | medium |
| ms.subservice | sharepoint |
| doc_type | apiPageType |
| ms.date | 10/24/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get the collection of pageTemplate objects in a site site. All page templates in the site are returned (with pagination), sorted alphabetically by name in ascending order.
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]
GET /sites/{site-id}/pageTemplates/microsoft.graph.pageTemplateThis method supports the $count, $expand, $filter, $orderby, $select, and $top OData query parameters to help customize the response.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
Don't supply a request body for this method.
If successful, this method returns a 200 and a list of pageTemplate object in the response body.
The following example shows a request.
GET /sites/dd00d52e-0db7-4d5f-8269-90060ac688d1/pageTemplates/microsoft.graph.pageTemplate
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id": "08f48aa6-02e3-407c-bbcb-ff61cec653fa",
"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": "1.1",
"checkedOutBy": {
"user": {
"displayName": "Rahul Mittal",
"email": "rahmit@contoso.com"
}
}
},
"reactions": {
"commentCount": 4,
"likeCount": 2
},
"titleArea": {
"enableGradientEffect": true,
"imageWebUrl": "https://cdn.contoso.osi.office.net/m365content/publish/005292d6-9dcc-4fc5-b50b-b2d0383a411b/image.jpg",
"layout": "imageAndTitle",
"showAuthor": false,
"showPublishedDate": false,
"showTextBlockAboveTitle": false,
"textAboveTitle": "",
"textAlignment": "left",
"imageSourceType": 2,
"title": "sample"
}
},
{
"id": "7d87eee1-7c77-46b5-b2c4-ad6e4e432a8e",
"name": "Home.aspx",
"webUrl": "https://contoso.sharepoint.com/SitePages/Templates/Home.aspx",
"title": "Home",
"pageLayout": "home",
"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": "1.1",
"checkedOutBy": {
"user": {
"displayName": "Rahul Mittal",
"email": "rahmit@contoso.com"
}
}
},
"reactions": {
"commentCount": 1
},
"titleArea": {
"enableGradientEffect": true,
"imageWebUrl": "https://cdn.contoso.osi.office.net/m365content/publish/005292d6-9dcc-4fc5-b50b-b2d0383a411b/image.jpg",
"layout": "imageAndTitle",
"showAuthor": true,
"showPublishedDate": false,
"showTextBlockAboveTitle": false,
"textAboveTitle": "Text Above Title",
"textAlignment": "left",
"imageSourceType": 2,
"title": "Home",
"hasTitleBeenCommitted": true
}
}
]
}