SP.ContentType.id property (sp.js)

Gets a value that specifies an identifier for the content type.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value = SP.ContentType.get_id ()

Return value

Type: SP.ContentTypeId

Remarks

The ContentTypeId type is the identifier for the specified content type. The identifier is a string composed of hexadecimal characters. The identifier must be unique relative to the current site collection and site, and must follow the pattern of prefixing a ContentTypeId with its parent ContentTypeId.

REST resource endpoint

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes(contenttypeid)/id

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes(contenttypeid)/id

GET syntax

GET http://<sitecollection>/<site>/_api/web/lists(listid)/contenttypes(contenttypeid)/id