contentType resource type
Namespace: microsoft.graph
Represents a content type in SharePoint. Content types allow you to define a set of columns that must be present on every listItem in a list.
Methods
Method | Return type | Description |
---|---|---|
List contentTypes in a site | contentType collection | Get a list of the contentType objects and their properties in a site. |
List contentTypes in a list | contentType collection | Get a list of the contentType objects and their properties in a list. |
Create contentType for a site | contentType | Create a new contentType object in a site. |
Get contentType | contentType | Read the properties and relationships of a contentType object. |
Update contentType | contentType | Update the properties of a contentType object. |
Delete contentType | None | Delete a contentType object. |
isPublished | Boolean | Indicates whether the contentType is published. |
publish | contentType | Publish a contentType. |
unpublish | contentType | Unpublish a contentType. |
addCopy | contentType | Add copy of a contentType from a site to a list. |
associateWithHubSites | contentType | Associate a contentType with a list of hub sites. |
copyToDefaultContentLocation | contentType | Copy a file to default content location in a contentType. |
List columns | columnDefinition collection | Get a collection of columns, represented as columnDefinition resources, in a contentType. |
Create column | columnDefinition | Add a column to a content type in a site or list. |
getCompatibleHubContentTypes | contentType collection | Get a list of compatible content types from the content type hub that can be added to a target site or a list. |
addCopyFromContentTypeHub | contentType | Add or sync a copy of a published content type from the content type hub to a target site or a list. |
Properties
Property | Type | Description |
---|---|---|
associatedHubsUrls | String collection | List of canonical URLs for hub sites with which this content type is associated to. This will contain all hub sites where this content type is queued to be enforced or is already enforced. Enforcing a content type means that the content type is applied to the lists in the enforced sites. |
description | string | The descriptive text for the item. |
documentSet | documentSet | Document Set metadata. |
documentTemplate | documentSetContent | Document template metadata. To make sure that documents have consistent content across a site and its subsites, you can associate a Word, Excel, or PowerPoint template with a site content type. |
group | string | The name of the group this content type belongs to. Helps organize related content types. |
hidden | Boolean | Indicates whether the content type is hidden in the list's 'New' menu. |
id | string | The unique identifier of the content type. |
inheritedFrom | itemReference | If this content type is inherited from another scope (like a site), provides a reference to the item where the content type is defined. |
isBuiltIn | Boolean | Specifies if a content type is a built-in content type. |
name | string | The name of the content type. |
order | contentTypeOrder | Specifies the order in which the content type appears in the selection UI. |
parentId | string | The unique identifier of the content type. |
propagateChanges | Boolean | If true , any changes made to the content type are pushed to inherited content types and lists that implement the content type. |
readOnly | Boolean | If true , the content type can't be modified unless this value is first set to false . |
sealed | Boolean | If true , the content type can't be modified by users or through push-down operations. Only site collection administrators can seal or unseal content types. |
Relationships
Relationship | Type | Description |
---|---|---|
base | contentType | Parent contentType from which this content type is derived. |
baseTypes | contentType collection | The collection of content types that are ancestors of this content type. |
columnLinks | columnLink collection | The collection of columns that are required by this content type. |
columnPositions | columnDefinition collection | Column order information in a content type. |
columns | columnDefinition collection | The collection of column definitions for this content type. |
For more information, see Introduction to content types and content type publishing.
JSON representation
The following JSON representation shows the resource type.
{
"associatedHubsUrls" : ["string"],
"base": { "@type": "microsoft.graph.contentType" },
"baseTypes" : [{ "@type": "microsoft.graph.contentType" }],
"columns" : [{ "@type": "microsoft.graph.columnDefinition" }],
"columnLinks": [{ "@type": "microsoft.graph.columnLink" }],
"columnPositions" : [{ "@type": "microsoft.graph.columnDefinition" }],
"description": "string",
"documentSet" : { "@type": "microsoft.graph.documentSet" },
"documentTemplate" : { "@type": "microsoft.graph.documentSetContent" },
"group": "string",
"hidden": "Boolean",
"id": "string",
"inheritedFrom": { "@type": "microsoft.graph.itemReference" },
"isBuiltIn" : "Boolean",
"name": "string",
"order": { "@type": "microsoft.graph.contentTypeOrder" },
"parentId": "string",
"propagateChanges" : "Boolean",
"readOnly": "Boolean",
"sealed": "Boolean"
}