Skip to main content
Browse Documentation
HTTP - Management

Create a component

Created by Contensis product team, last modified by zengenti on 22 Sep 2020

Creates a new component resource.

POST/api/management/projects/{projectId}/components/

Parameter

NameParameter typeTypeDescriptionExampleRequired
projectIdpathstringThe project identifier found in the project overview screen of the management consolemovieDbtrue

Example

POST: /api/management/projects/movieDb/components/

{
    "id": "movieRole",
    "projectId": "website",
    "name": {
        "en-GB": "Movie role"
    },
    "description": {
        "en-GB": "A Persons role within a movie"
    },
    "fields": [
        {
            "id": "person",
            "name": {
            "en-GB": "Person"
            },
            "dataType": "object",
            "dataFormat": "entry",
            "description": {
                "en-GB": "The actor or crew member"
            },
            "default": {},
            "validations": {
                "allowedContentTypes": {
                    "contentTypes": ["person"]
                }
            },
            "editor": {
                "id": "entry",
                "instructions": {
                    "en-GB": ""
                },
                "properties": {
                    "placeholderText": {
                        "en-GB": ""
                    }
                }
            }
        },
        {
            "id": "role",
            "name": {
                "en-GB": "Role"
            },
            "dataType": "String",
            "dataFormat": null,
            "description": {},
            "default": {},
            "validations": null,
            "editor": null
        }
    ],
    "workflowId": "ContensisDefault",
    "dataFormat": "component",
    "version": {
        "createdBy": "s.derrickson",
        "created": "2016-10-12T09:29:18.5144641+01:00",
        "modifiedBy": "b.cumberbatch",
        "modified": "2016-10-13T10:15:12.1973648+01:00",
        "publishedBy": "b.cumberbatch",
        "published": "2016-10-13T10:15:12.1973648+01:00",
        "versionNo": "0.2"
    }
}

Responses

HTTP status codeReasonModel
201CreatedComponent
401UnauthorizedError
404Component not foundError
409Resource already existsError
422Validation errorError
500Internal server errorError