Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/definitions/childdefinitions/add

Requires JWT

Add a child definition to a definition.

If you don't specify before_childdefinition (or the specified childdefinition isn't in the definition), the new childdefinition is added at the end.

Note: you cannot add working copies of a definition, only committed definition can be added.

Note: you cannot modify child definitions for an extended definition.

Request

POST /api/p/<project gid>/definitions/childdefinitions/add
Authorization: Bearer <JWT>

{
    "definition": "<definition gid>",
    "childdefinition": "<child definition gid>",
    "before_childdefinition": "<child definition gid>"
}

definition gid of the definition to add the childdefinition to
childdefinition gid of the child definition that is added

optional

before_childdefinition the added child definition is put before this child definition

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "definition": "<definition gid>"
    },
    "data": {
        "definitions": {
            "<definition gid>": {}
        },
        "layouts": {
            
        }
    }
}

result

definition the definition with the added child definition - this is a working copy.

data

definitions Definition info with name, classes, fields.
layouts Layout info with hierarchy, if the layout changed to a working copy.

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - can't work with this item