Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Get one or more definitions.

A definition is a set of classes and fields that define records.

Request

You get a definition either by specifying the gid in definition or definitions.

If you provide both definition and definitions 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>/definitions/get
Authorization: Bearer <JWT>

{
    "definition": "<definition gid>"
}

or

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

{
    "definitions": ["<definition gid>", ]
}

Success response

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

Authorization: <JWT>

{
    "success": true,
    "result": {
        "definition": "a279eaa3-efe7-4873-b4a5-64fb741c048f"
    },
    "data": {
        "definitions": {
            "a279eaa3-efe7-4873-b4a5-64fb741c048f": {
                
            },
            
        }
    }
}

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

Authorization: <JWT>

{
    "success": true,
    "result": {
        "definitions": [
            "a279eaa3-efe7-4873-b4a5-64fb741c048f",
            "549c77cd-3cc7-41c9-beb5-76080b72a1b7",
            "84914db7-8d67-447a-9b17-afaa2f183687"
        ]
    },
    "data": {
        "definitions": {
            "a279eaa3-efe7-4873-b4a5-64fb741c048f": {
                
            },
            
        }
    }
}

result

definition the requested definition, if a single definition was asked for.
definitions the requested definitions, if multiple definitions were asked for.

data

definitions Definition info with name, classes, 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 - definition not found