Skip to content

UI Config

API for setup and use configuration for UI components.

Permissions

Permissions for UI Config can be checked by:

ContextEndpointLocationAvailable perms
Global scopeGET /api/users/permissions/ui_configview, create

POST /ui-config/component/

Creates or update UI Config for given component. In case that UI Config already exists for given component, existing component content will be overridden by sent payload.

Permissions

Requires authentication and ui_config.create permission.

Request

  • URL parameters
KeyTypeNotes
componentstrUnique component name. Value is case insensitive.

In case the component name will contain big letters, all phrase will be saved as lowercase.

  • Body parameters
KeyTypeNotes
contentstrContent must be a JSON compatible.
custom_componentsarrayCustom Components ids used in UI configuration.
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /ui-config/`component`/

{
    "content": "{"key": {"value": "value", "value2": "value2"}}",
    "custom_components": [1, 2, 3],
    "upload_component": [
        {
            "object_class": 564,
            "class_field": 12
        }
    ]
}
<json>

Validations

  • component
    • Max length: 50
    • contains only latin letters, digits and dash (a-z0-9-)
  • custom_components
    • is a integer
    • is optional
    • values are unique
    • max length: 100
  • upload_component
    • is optional
    • max length: 10
    • object_class
      • is required
      • is integer
      • exists in DB
    • class_field
      • is required
      • is integer
      • exists in DB
      • belongs to given object_class
      • is of type 'document'

Response

KeyTypeNotes
contentstrContain the same payload which was sent in request.
  • Successful status 201 Created
  • Response body schema
json
{"key": {"value": "value", "value2": "value2"}}

Errors

CauseResponse codeMessage
Incorrect component in URL400 Bad Request"component": ["Enter a valid value."]
Max length 50 cars of component exceeded400 Bad Request'component': ["Ensure this field has no more than 50 characters."]
Invalid payload format400 Bad Request"detail": "JSON parse error - <error_text>"
Null value in payload400 Bad Request"content": ["This field may not be null."]
Size of payload JSON > 65K characters400 Bad Request"content": ["Ensure this value has at most 65000 characters (it has <len(json)>)."]
Number of components > 100400 Bad Request"detail": ["Limit of 100 UI Config has been exceeded."]
custom_components.component missing400 Bad Request"custom_components": {"component": ["This field is required."]}
custom_components.component is empty400 Bad Request"custom_components": {"component": ["This field may not be blank."]}
custom_components.component is null400 Bad Request"custom_components": {"component": ["This field may not be null."]}
custom_components.component doesn't exists400 Bad Request"custom_components": {"component": ["Invalid pk "99900" - object does not exist."]}
custom_components.component is not enabled400 Bad Request"custom_components": ["Custom component 1 - object not enabled.",]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
object_class is invalid400 Bad Request"object_class": ["Invalid pk "99999" - object does not exist."]
object_class is not int400 Bad Request"object_class": ["Incorrect type. Expected pk value, received str."]
object_class is required400 Bad Request"object_class": ["This field is required."]
object_class is empty400 Bad Request"object_class": ["This field may not be null."]
object_class_field is invalid400 Bad Request"object_class_field": ["Invalid pk "99999" - object does not exist."]
object_class_field is not int400 Bad Request"object_class_field": ["Incorrect type. Expected pk value, received str."]
object_class_field is required400 Bad Request"object_class_field": ["This field is required."]
object_class_field is empty400 Bad Request"object_class_field": ["This field may not be null."]
object_class_field is not document type400 Bad Request"object_class_field": ["Invalid type - field "field name" is not Document type."]
object_class_field does not belong to object_class400 Bad Request"details": ["Object Class Field ID "field_id" does not belong to Object Class ID "class_id"."]
upload component list has duplicatest400 Bad Request"non_field_errors": ["The fields object_class, object_class_field must make a unique set."]

GET /ui-config/component/

Returns UI Config for given component.

Permissions

Requires authentication and ui_config.view permission. Some component names are public and don't require any authentication.

  • Public component

    • theme

Request

  • URL parameters
KeyTypeNotes
componentstrCase insensitive component name
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /ui-config/`component`/

Response

  • Successful status 200 OK
  • Response body schema:
json
<json>

Errors

ErrorResponse codeMessage
Undefined component in URL404 Not Found"detail": "Not found."
Missing component in URL (wrong url)403 Forbidden"detail": "You do not have permission to perform this action."
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."