Unicat API Reference

Up - API Reference - Home


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

Requires JWT

Get one or more layouts.

A layout defines how fields are displayed in the record worksheet user interface. They are tied to classes and definitions.

Request

You get a layout either by specifying the gid in layout or layouts.

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

{
    "layout": "<layout gid>"
}

or

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

{
    "layouts": ["<layout gid>", ]
}

Success response

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

Authorization: <JWT>

{
    "success": true,
    "result": {
        "layout": "a8b7b2e0-2ec4-4985-956c-1eedcb506db9"
    },
    "data": {
        "layouts": {
            "a8b7b2e0-2ec4-4985-956c-1eedcb506db9": {
                
            },
            
        }
    }
}

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

Authorization: <JWT>

{
    "success": true,
    "result": {
        "layouts": [
            "a8b7b2e0-2ec4-4985-956c-1eedcb506db9",
            "549c77cd-3cc7-41c9-beb5-76080b72a1b7",
            "84914db7-8d67-447a-9b17-afaa2f183687"
        ]
    },
    "data": {
        "layouts": {
            "a8b7b2e0-2ec4-4985-956c-1eedcb506db9": {
                
            },
            
        }
    }
}

result

layout the requested layout, if a single layout was asked for.
layouts the requested layouts, if multiple layouts were asked for.

data

layouts Layout info with hierarchy.

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