Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/classes/commit

Requires JWT

Commit a class.

We used a copy to keep track of the changes; now we need to apply those changes to the original, and remove the copy.

Afterwards, the class is no longer a working copy. All places where this class is used will now work with the newly committed class - this includes records that use this class and now have new or removed fields.

Note: record data can be lost if you commit a class!

The accompanying layout is committed too.

Request

POST /api/p/<project gid>/classes/commit
Authorization: Bearer <JWT>

{
    "class": "<class gid>"
}

class the class to commit

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "class": "<class gid>"
    },
    "data": {
        "classes": {
            "<class gid>": {}
        },
        "layouts": {
            
        }
    }
}

result

class the class is no longer a working copy.

data

classes Class info with name, fields.
layouts Layout info with hierarchy, for the committed class.

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