Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Get one or more classes.

A class specifies a set of fields to be added to a definition as a whole.

Request

You get a class either by specifying the gid in class or classes.

If you provide both class and classes parameters, we use parameter matching to guess what you meant. The first action that matches the parameters is performed, the rest is ignored. Parameter matching happens in the order given below:

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

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

or

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

{
    "classes": ["<class gid>", ]
}

Success response

If you request a single class, you'll get a single result.

Authorization: <JWT>

{
    "success": true,
    "result": {
        "class": "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74"
    },
    "data": {
        "classes": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            },
            
        }
    }
}

If you requested multiple classes, you'll get a list of results.

Authorization: <JWT>

{
    "success": true,
    "result": {
        "classes": [
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74",
            "549c77cd-3cc7-41c9-beb5-76080b72a1b7",
            "84914db7-8d67-447a-9b17-afaa2f183687"
        ]
    },
    "data": {
        "classes": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            },
            
        }
    }
}

result

class the requested class, if a single class was asked for.
classes the requested classes, if multiple classes were asked for.

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 - class not found