Skip to main content

A content type resource can be retrieved from the Delivery API to understand the schema of an entry. Entries are constructed and validated using the information defined in the fields collection.

Properties

NameTypeFormatDescription
idstringA unique content type identifier
projectIdstringThe project identifier, e.g. "movieDb". Found in the project overview screen of the management console
nameobjectLocalized valueThe friendly name given to a content type
descriptionobjectLocalized valueThe description text given to a content type
entryTitleFieldstringThe id of the field which should be used as the title in entry listings
fieldsobject […]FieldA collection of fields that form the schema for an entry
enabledboolean
defaultLanguagestringLanguage code
supportedLanguagesstring […]Language code
workflowIdstringThe workflow that derived entries will
dataFormatstringEither entry or asset
previewUrlstringThe URL where an example of an entry based on the content type can be viewed
versionobjectVersionVersion information about the content type
includeInDeliverybooleanIf set to 'false', no entries for the content type will be returned in delivery and will instead result in a HTTP status of 403 Forbidden. Any entry that is included in delivery that has a link to an item that is not included in delivery will still have the link returned, however no further data will be returned if the entry is retrieved with a link depth.

Field

The field object is the definition of a field within an entry. The field also contains the validations and editor configuration that is used within the Contensis UI and services.

Properties

NameTypeFormatDescription
idstringA unique field identifier
nameobjectLocalized valueA friendly name for the field
descriptionobjectLocalized valueThe description for the field's purpose
dataTypestringData typeThe field data type
dataFormatstringData typeThe field data format
defaultobjectLocalized valueThe default value for the field if no value is provided by an editor
validationsobjectThe validations that will be performed on the field when the entry is either created or updated
editorobjectEditorConfiguration for the Contensis entry editor

Localized value

A localized value is an object that has values that are keyed by language codes which allows multilingual variations of a specific property.

Example

TypeScript
// Using TypeScript, or ES Module await syntax
const contentType = await client.contentTypes.get('<content-type-id>');

console.log(contentType.name['en-GB']);
JavaScript
// Using Common JS promise callback syntax
client.contentTypes.get('<content-type-id>')
  .then(function (contentType) {
    console.log(contentType.name['en-GB']);
  });

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request