Content type
Log in to add to favouritesA 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
Name | Type | Format | Description |
---|---|---|---|
id | string | A unique content type identifier | |
projectId | string | The project identifier, e.g. "movieDb". Found in the project overview screen of the management console | |
name | object | Localized value | The friendly name given to a content type |
description | object | Localized value | The description text given to a content type |
entryTitleField | string | The id of the field which should be used as the title in entry listings | |
fields | object […] | Field | A collection of fields that form the schema for an entry |
enabled | boolean | ||
defaultLanguage | string | Language code | |
supportedLanguages | string […] | Language code | |
workflowId | string | The workflow that derived entries will | |
dataFormat | string | Either entry or asset | |
previewUrl | string | The URL where an example of an entry based on the content type can be viewed | |
version | object | Version | Version information about the content type |
includeInDelivery | boolean | If 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
Name | Type | Format | Description |
---|---|---|---|
id | string | A unique field identifier | |
name | object | Localized value | A friendly name for the field |
description | object | Localized value | The description for the field's purpose |
dataType | string | Data type | The field data type |
dataFormat | string | Data type | The field data format |
default | object | Localized value | The default value for the field if no value is provided by an editor |
validations | object | The validations that will be performed on the field when the entry is either created or updated | |
editor | object | Editor | Configuration 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
// Using TypeScript, or ES Module await syntax
const contentType = await client.contentTypes.get('<content-type-id>');
console.log(contentType.name['en-GB']);
// Using Common JS promise callback syntax
client.contentTypes.get('<content-type-id>')
.then(function (contentType) {
console.log(contentType.name['en-GB']);
});