Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Save all changes to the class as a new, original class.

We used a copy to keep track of the changes; we now make those changes official.

Afterwards, the class is no longer a working copy.

The accompanying layout is saved too.

Note: if there are no changes, nothing is saved either.

Request

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

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

class the class to save as new

Success response

Authorization: <JWT>

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

result

class the newly saved class.

data

classes Class info with name, fields.

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