Create a content type
Creates a new content type resource.
POST /api/management/projects/{projectId}/contenttypes/
Parameters
Name | Parameter type | Type | Format | Description |
---|---|---|---|---|
projectId | path | string | The project identifier, e.g. "movieDb". Found in the project overview screen of the management console. |
Example request
POST: /api/management/projects/movieDb/contenttypes/
{
"id": "movie",
"projectId": "movieDb",
"name": {
"en-GB": "Movie"
},
"description": {
"en-GB": "A movie type"
},
"entryTitleField": "title",
"entryDescriptionField": "overview",
"fields": [
{
"id": "title",
"name": {
"en-GB": "Title"
},
"dataType": "string",
"editor": {
"id": "text",
"instructions": {
"en-GB": "The title of the movie"
},
"properties": {
"placeholderText": {
"en-GB": "Enter the full title of the movie appropriate to the region"
}
}
}
},
{
"id": "tagline",
"name": {
"en-GB": "Tagline"
},
"dataType": "string",
},
{
"id": "overview",
"name": {
"en-GB": "Overview"
},
"dataType": "string",
"dataFormat": "html"
},
{
"id": "releaseDate",
"name": {
"en-GB": "Release Date"
},
"dataType": "dateTime",
"validations": null
},
{
"id": "actors",
"name": {
"en-GB": "Actors"
},
"dataType": "objectArray",
"dataFormat": "entry",
"validations": {
"contentType": {
"contentType": "actor"
}
}
}
],
"defaultLanguage": "en-GB",
"supportedLanguages": [
"en-GB",
"fr-FR",
"de-DE",
"es"
],
"workflowId": "ContensisMultilingual",
"dataFormat": "entry"
}
Response message
HTTP status code | Reason | Response model |
---|---|---|
201 | Created | Content Type |
401 | Unauthorized | Error |
404 | NotFound | Error |
409 | Conflict | Error |
422 | ValidationError | Error |
500 | InternalServerError | Error |
TODO: Add validation responses
Validations
Type | Description |
---|---|
Project does not exist | A project must exist to be able to create content types. |
Non-unique id | The content type must be unique for the project. |
Remarks
If the defaultLanguage value is not included in the supportedLanguages array then it will automatically added by the service when the project is created. Additionally, if the defaultLanguage is not specified then the project primaryLanguage will be automatically set as the value by the service.