简体   繁体   中英

Get Document Library document Templates

Once you defined additional document Templates within a Sharepoint document Library, how can they be retrieved through MS Graph?

Regarding MS documentation Templates are stored within a Folder called "Forms" ( https://support.microsoft.com/en-us/office/set-a-custom-template-for-a-sharepoint-library-8e0177eb-46bd-4346-9998-330c32733c25 ). But this folder is neither listed through ms graph nor it can be browsed by path with ms graph. So my Question is how to access these document Templates?

SharePoint site and list has relationship to contentType .

ContentType resource type has property documentTemplate which should be what you are looking for.

Maybe the best way to start is to call Graph API and get contentType for your site or list.

GET https://graph.microsoft.com/v1.0/sites/{site_id}/contentTypes
GET https://graph.microsoft.com/v1.0/sites/{site_id}/contentTypes?$select=id,documentSet,documentTemplate
GET https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/contentTypes
GET https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/contentTypes?$select=id,documentSet,documentTemplate

Resources:

Content type

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM