Object Classes
This technical design describes implementation and API for Object Classes.
POST /api/object-classes/
Creates object class.
Permissions
Requires authentication and object_classes.create permission.
Request
- Body parameters
| Key | Type | Notes |
|---|---|---|
| name | string | |
| description | string | |
| display_configuration | Json | UI configuration |
| custom_components | Json | Custom Components used in UI configuration. |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/object-classes/
{
"name": "class_name",
"description": "Some class description",
"display_configuration": {"key": "value"},
"custom_components": [
{"component_id": 1, "used_in": "object_class_create_forms" },
{"component_id": 2, "used_in": "object_class_summary_forms" }
]
}Validations
- name
- is string
- is required
- is unique
- max length is 100
- first sign of name must be a letter.
- description
- is string
- is optional
- max length is 500
- display_configuration
- is a Json
- is optional
- has not duplicated keys
- custom_components
- is a Json
- is optional
- component_id
- is integer
- is required
- is a valid component id
- used_in
- is string
- is required
- is a valid form type
Restrictions
- Up to 10000 Object Classes can be added, limit is configurable per build.
Response
| Key | Type | Notes |
|---|---|---|
| id | pk | Automatically generated by the backend. |
| name | string | Name of the object class |
| description | string | Description of the object class |
| identifier | Object | Object record identifier |
| display_configuration | Json | Object class UI configuration |
| created_at | datetime | |
| created_by | user | |
| modified_at | datetime | |
| modified_by | user | |
| record_count | int | Number of records for a given Object Class |
| object_models | Array | List of Object Models ids in which a given class is used |
| _meta.permissions | Object | Object describing permissions. |
Response identifier object
| Key | Type | Notes |
|---|---|---|
| id | pk | |
| label | string | |
| alias | string | |
| type | enum | Field type |
| is_unique | bool | |
| is_identifier | bool | |
| has_duplicates | bool | |
| order | int | |
| extras | Json |
- Successful status
201 Created - Response body:
{
"id": 18,
"name": "class_name",
"description": "Some class description",
"identifier": {
"id": null,
"label": "ALX ID",
"alias": "id",
"type": "int",
"is_unique": false,
"is_identifier": false,
"has_duplicates": false,
"order": null,
"extras": {}
},
"display_configuration": {
"key": "value"
},
"created_at": "2023-08-23T14:52:14.172073+02:00",
"created_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"modified_at": "2023-08-23T14:52:14.172098+02:00",
"modified_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"record_count": 0,
"object_models": [],
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true,
"edit_owners": true,
"edit_perm_sets": true,
"object_records": {
"create": true
},
"object_class_forms": {
"list": true,
"view": true,
"edit": true,
"create": true,
"delete": true
}
}
}
}Errors
| Cause | Response status code | Response message |
|---|---|---|
| name missing | 400 Bad Request | "name": ["This field is required."] |
| name is empty | 400 Bad Request | "name": [ "This field may not be blank." ] |
| name is null | 400 Bad Request | "name": [ "This field may not be null." ] |
| name not unique | 400 Bad Request | "name": ["This field must be unique."] |
| name too long | 400 Bad Request | "name": ["Ensure this field has no more than 100 characters."] |
| first sign not a letter | 400 Bad Request | "name": ["First sign of name must be a letter."] |
| description too long | 400 Bad Request | "description": ["Ensure this field has no more than 500 characters."] |
| description is null | 400 Bad Request | "description": ["This field may not be null."] |
| key is duplicated | 400 Bad Request | "display_configuration": ["JSON key "key" is duplicated."] |
| template_file is null | 400 Bad Request | "template_file": [ "This field may not be null." ] |
| template_file not docx | 400 Bad Request | "template_file": ["Invalid file type."] |
| custom_components.component missing | 400 Bad Request | "custom_components": {"component": ["This field is required."]} |
| custom_components.component is empty | 400 Bad Request | "custom_components": {"component": ["This field may not be blank."]} |
| custom_components.component is null | 400 Bad Request | "custom_components": {"component": ["This field may not be null."]} |
| custom_components.component doesn't exists | 400 Bad Request | "custom_components": {"component": ["Invalid pk "99900" - object does not exist."]} |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
OPTIONS /api/object-classes/
Permissions
Requires authentication only.
Request
- Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/object-classes/
Authorization: JWT access_tokenResponse
- Successful status
200 OK - Response body:
{
"list": {
"columns": [
{
"alias": "id",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "name",
"type": "string",
"predicates": [
"exact",
"iexact",
"contains",
"icontains",
"startswith",
"istartswith",
"endswith",
"iendswith"
],
"sort_ok": true
},
{
"alias": "description",
"type": "string",
"predicates": [],
"sort_ok": false
},
{
"alias": "created_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "created_by",
"type": "user",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
{
"alias": "modified_at",
"type": "datetime",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range"
],
"sort_ok": true
},
{
"alias": "modified_by",
"type": "user",
"predicates": [
"exact",
"in"
],
"sort_ok": false,
"autocomplete": "/api/users/autocomplete/?text__icontains="
},
{
"alias": "owners",
"type": "owners",
"predicates": [
"exact",
"in",
"isnull"
],
"sort_ok": false
},
{
"alias": "record_count",
"type": "int",
"predicates": [],
"sort_ok": false
}
]
},
"details": {
"schema": [
{
"alias": "name",
"type": "string",
"required": true,
"validators": [
{
"type": "min_length",
"length": 1
},
{
"type": "max_length",
"length": 100
}
]
},
{
"alias": "description",
"type": "string",
"required": false,
"validators": [
{
"type": "max_length",
"length": 500
}
]
}
]
},
"restrictions": {
"limit_items": 10000
}
}GET /api/object-classes/
Returns list of Object Classes.
Permissions
Requires authentication and object_classes.list permission.
Request example
- Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of results visible to the user (based on permissions). |
| filtered_count | int | Number of results visible to the user (based on permissions) with filters applied. |
| next | url | Next page URL (null if there is no next page) |
| previous | url | Previous page URL (null if there is no previous page) |
| results | Array | List of results. Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| id | pk | Automatically generated by the backend. |
| name | string | Name of the object class |
| description | string | Description of the object class |
| created_at | datetime | |
| created_by | user | |
| modified_at | datetime | |
| modified_by | user | |
| record_count | int | Number of records for a given Object Class |
| has_system_fields | bool | |
| owners | Object | |
| _meta.permissions | Object |
Response owners object
| Key | Type | Notes |
|---|---|---|
| total_number | int | |
| first | user |
- Successful status
200 OK - Response body schema
{
"limit": 50,
"offset": 0,
"filtered_count": 2,
"total_count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 17,
"name": "123456",
"description": "",
"created_at": "2022-11-10T14:32:14.645313+01:00",
"created_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"modified_at": "2022-11-10T14:32:14.645340+01:00",
"modified_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"has_system_fields": false,
"owners": {
"total_number": 1,
"first": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
}
},
"record_count": 0,
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true,
"edit_owners": true,
"edit_perm_sets": true
}
}
},
{
"id": 18,
"name": "class_name",
"description": "Some class description",
"created_at": "2023-08-23T14:52:14.172073+02:00",
"created_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"modified_at": "2023-08-23T14:52:14.172098+02:00",
"modified_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"has_system_fields": true,
"owners": {
"total_number": 1,
"first": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
}
},
"record_count": 10,
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true,
"edit_owners": true,
"edit_perm_sets": true
}
}
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| id | /api/object-classes/?ordering=id | Ascending |
| id | /api/object-classes/?ordering=-id | Descending (-) |
| name | /api/object-classes/?ordering=name | Ascending |
| name | /api/object-classes/?ordering=-name | Descending (-) |
| created_at | /api/object-classes/?ordering=created_at | Ascending |
| created_at | /api/object-classes/?ordering=-created_at | Descending (-) |
| modified_at | /api/object-classes/?ordering=modified_at | Ascending |
| modified_at | /api/object-classes/?ordering=-modified_at | Descending (-) |
Filtering
Please check ALX API standards for predicates available per type.
| Parameter | Type |
|---|---|
| id | int |
| name | string |
| created_at | datetime |
| created_by | user |
| modified_at | datetime |
| modified_by | user |
| owners | user |
GET /api/object-classes/id
Returns single Object Class by id.
Permissions
Requires authentication and object_classes.view permission.
URL parameters
| Key | Type | Notes |
|---|---|---|
| id | id |
Request example
- Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/18/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| id | pk | Automatically generated by the backend. |
| name | string | Name of the object class |
| description | string | Description of the object class |
| identifier | Object | Object record identifier |
| display_configuration | Json | Object class UI configuration |
| created_at | datetime | |
| created_by | user | |
| modified_at | datetime | |
| modified_by | user | |
| record_count | int | Number of records for a given Object Class |
| object_models | Array | List of Object Models ids in which a given class is used |
| has_system_fields | bool | |
| _meta.permissions | Object | Object describing permissions. |
Response identifier object
| Key | Type | Notes |
|---|---|---|
| id | pk | |
| label | string | |
| alias | string | |
| type | enum | Field type |
| is_unique | bool | |
| is_identifier | bool | |
| has_duplicates | bool | |
| order | int | |
| description | string | |
| extras | Json |
- Successful status
200 OK - Response body schema:
{
"id": 18,
"name": "class_name",
"description": "Some class description",
"identifier": {
"id": null,
"label": "ALX ID",
"alias": "id",
"type": "int",
"is_unique": false,
"is_identifier": false,
"has_duplicates": false,
"order": null,
"description": "",
"extras": {}
},
"display_configuration": {
"key": "value"
},
"created_at": "2023-08-23T14:52:14.172073+02:00",
"created_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"modified_at": "2023-08-23T14:52:14.172098+02:00",
"modified_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"has_system_fields": false,
"record_count": 0,
"object_models": [],
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true,
"edit_owners": true,
"edit_perm_sets": true,
"object_records": {
"create": true
},
"object_class_forms": {
"list": true,
"view": true,
"edit": true,
"create": true,
"delete": true
}
}
}
}Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Sequence with "id" does not exist | 404 Not Found | "detail": "Not found." |
PATCH /api/object-classes/id/
Updates single Object Class.
Permissions
Requires authentication and sobject_classes.edit permission.
Allowed parameters
| Key | Type | Notes |
|---|---|---|
| name | string | |
| description | string | |
| display_configuration | Json | UI configuration |
| custom_components | Json | Custom Components used in UI configuration. |
Any parameter not listed above are silently ignored if passed.
Request
- Headers
Request Method: PATCH
Content-Type: application/json
Location: /api/object-classes/1/
Authorization: JWT access_token- Sample request body
{
"name": "class_name",
"description": "Some class description",
"display_configuration": {"key": "value"},
"custom_components": [
{"component_id": 1, "used_in": "object_class_create_forms },
{"component_id": 2, "used_in": "object_class_summary_forms }
]
}Response
| Key | Type | Notes |
|---|---|---|
| id | pk | Automatically generated by the backend. |
| name | string | Name of the object class |
| description | string | Description of the object class |
| identifier | Object | Object record identifier |
| display_configuration | Json | Object class UI configuration |
| created_at | datetime | |
| created_by | user | |
| modified_at | datetime | |
| modified_by | user | |
| record_count | int | Number of records for a given Object Class |
| object_models | Array | List of Object Models ids in which a given class is used |
| _meta.permissions | Object | Object describing permissions. |
Response identifier object
| Key | Type | Notes |
|---|---|---|
| id | pk | |
| label | string | |
| alias | string | |
| type | enum | Field type |
| is_unique | bool | |
| is_identifier | bool | |
| has_duplicates | bool | |
| order | int | |
| extras | Json |
- Successful status
200 OK - Response body schema:
{
"id": 1,
"name": "class_name",
"description": "Some class description",
"identifier": {
"id": null,
"label": "ALX ID",
"alias": "id",
"type": "int",
"is_unique": false,
"is_identifier": false,
"has_duplicates": false,
"order": null,
"extras": {}
},
"display_configuration": {
"key": "value"
},
"created_at": "2023-08-23T14:52:14.172073+02:00",
"created_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"modified_at": "2023-08-23T14:52:14.172098+02:00",
"modified_by": {
"id": 2,
"first_name": "ALX",
"last_name": "Developer",
"username": "alx.dev@autologyx.com",
"company_name": "",
"is_deleted": false,
"account_type": "super_admin"
},
"record_count": 0,
"object_models": [],
"_meta": {
"permissions": {
"list": true,
"view": true,
"create": true,
"edit": true,
"delete": true,
"edit_owners": true,
"edit_perm_sets": true,
"object_records": {
"create": true
},
"object_class_forms": {
"list": true,
"view": true,
"edit": true,
"create": true,
"delete": true
}
}
}
}Errors
| Cause | Response status code | Response message |
|---|---|---|
| name missing | 400 Bad Request | "name": ["This field is required."] |
| name is empty | 400 Bad Request | "name": [ "This field may not be blank." ] |
| name is null | 400 Bad Request | "name": [ "This field may not be null." ] |
| name not unique | 400 Bad Request | "name": ["This field must be unique."] |
| name too long | 400 Bad Request | "name": ["Ensure this field has no more than 100 characters."] |
| first sign not a letter | 400 Bad Request | "name": ["First sign of name must be a letter."] |
| description too long | 400 Bad Request | "description": ["Ensure this field has no more than 500 characters."] |
| description is null | 400 Bad Request | "description": ["This field may not be null."] |
| key is duplicated | 400 Bad Request | "display_configuration": ["JSON key "key" is duplicated."] |
| template_file is null | 400 Bad Request | "template_file": [ "This field may not be null." ] |
| template_file not docx | 400 Bad Request | "template_file": ["Invalid file type."] |
| custom_components.component missing | 400 Bad Request | "custom_components": {"component": ["This field is required."]} |
| custom_components.component is empty | 400 Bad Request | "custom_components": {"component": ["This field may not be blank."]} |
| custom_components.component is null | 400 Bad Request | "custom_components": {"component": ["This field may not be null."]} |
| custom_components.component doesn't exists | 400 Bad Request | "custom_components": {"component": ["Invalid pk "99900" - object does not exist."]} |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
DELETE /api/object-classes/object_class_id/
Remove a Object Class with checking if no used anywhere.
Permissions
Requires authentication and object_class.delete permission.
Request example
- Headers
Request Method: DELETE
Location: /api/object-classes/1/
Authorization: JWT access_tokenResponse example
- Status
204 No Content - Body
Errors
| Error | Response code | Message |
|---|---|---|
| Object class in use | 400 Forbidden | "detail": "Class is in use by Sequences." |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Task template does not exist | 404 Forbidden | "detail": "Not found" |
GET /api/object-classes/autocomplete/
List of Object Classes based on query parameters for autocomplete widgets.
Permissions
Requires authentication and object_classes.list permission.
Request example
- Headers
Request Method: GET
Location: /api/object-classes/autocomplete/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | URL / null | Next page URL (null if there is no next page) |
| previous | URL / null | Previous page URL (null if there is no previous page) |
| results | Array | Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| value | int | Object Class ID |
| text | str | Object Class name |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 1,
"total_count": 20,
"next": null,
"previous": null,
"results": [
{
"value": 12,
"tesst": "Some class name"
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| name | {build}/api/object-classes/?ordering=name | Ascending |
| name | {build}/api/object-classes/?ordering=-name | Descending (-) |
| text | {build}/api/object-classes/?ordering=text | Ascending |
| text | {build}/api/object-classes/?ordering=-text | Descending (-) |
Filtering
For the full description of standard predicates see ALX API standards - Developers guide.
| Parameter | Predicates | Example | Values |
|---|---|---|---|
| text | standard string | {build}/api/object-classes/?text__icontains=template |
Errors
| Error | Response code | Message |
|---|---|---|
| Wrong ordering value | 400 Bad Request | "ordering": ["Select a valid choice. {value} is not one of the available choices."] |
GET /api/object-classes/autocomplete/owned/
List of Object Classes owned by user based on query parameters for autocomplete widgets.
Permissions
Requires authentication and object_classes.list permission.
Request example
- Headers
Request Method: GET
Location: /api/object-classes/autocomplete/owned/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of forms visible to the user (based on permissions). |
| filtered_count | int | Number of forms visible to the user (based on permissions) with filters applied. |
| next | URL / null | Next page URL (null if there is no next page) |
| previous | URL / null | Previous page URL (null if there is no previous page) |
| results | Array | Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| value | int | Object Class ID |
| text | str | Object Class name |
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 1,
"total_count": 20,
"next": null,
"previous": null,
"results": [
{
"value": 12,
"tesst": "Some class name"
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| name | {build}/api/object-classes/?ordering=name | Ascending |
| name | {build}/api/object-classes/?ordering=-name | Descending (-) |
| text | {build}/api/object-classes/?ordering=text | Ascending |
| text | {build}/api/object-classes/?ordering=-text | Descending (-) |
Filtering
For the full description of standard predicates see ALX API standards - Developers guide.
| Parameter | Predicates | Example | Values |
|---|---|---|---|
| text | standard string | {build}/api/object-classes/?text__icontains=template |
Errors
| Error | Response code | Message |
|---|---|---|
| Wrong ordering value | 400 Bad Request | "ordering": ["Select a valid choice. {value} is not one of the available choices."] |
GET /api/object-classes/object_class_id/usage/
Permissions
Requires authentication and object_class.view permission.
Request example
- Headers
Request Method: GET
Location: /api/object-classes/1/usage/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| num_of_records | int | |
| sequences | array | |
| num_of_sequences | int | |
| task_group_templates | array | |
| num_of_task_group_templates | int | |
| task_templates | array | |
| num_of_task_templates | int | |
| object_models | array | |
| num_of_object_models | int | |
| num_of_upload_components | int |
Response sequences array
| Key | Type | Notes |
|---|---|---|
| id | int | Sequence id |
| name | str | Name of sequence |
Response task_group_templates array
| Key | Type | Notes |
|---|---|---|
| id | int | Task Group Template id |
| name | str | Name of Task Group Template |
Response task_templates array
| Key | Type | Notes |
|---|---|---|
| id | int | Task Template id |
| name | str | Name of Task Template |
Response object_models array
| Key | Type | Notes |
|---|---|---|
| id | int | Object Model id |
| name | str | Name of Object Model |
Response example
- Status
200 OK - Body
{
"num_of_records": 0,
"sequences": [
{
"id": 1,
"name": "sequence1"
},
{
"id": 7,
"name": "sequence_test"
}
],
"num_of_sequences": 2,
"task_group_templates": [],
"num_of_task_group_templates": 0,
"task_templates": [],
"num_of_task_templates": 0,
"object_models": [
{
"id": 17,
"name": "some_name"
}
],
"num_of_object_models": 1,
"num_of_upload_components": 1
}Errors
| Error | Response code | Message |
|---|---|---|
id is invalid | 404 Bad Request | 'detail': "Not found." |
| Unauthorized API call | 403 Bad Request | 'detail': "You do not have permission to perform this action." |
POST /api/object-classes/object_class_id/fields/
Creates object class field.
Permissions
Requires authentication and object_classes.edit permission.
Request
- Body general parameters
| Key | Type | Notes |
|---|---|---|
| alias | string | |
| type | enum | |
| label | string | |
| is_identifier | bool | |
| is_unique | bool | Field value is unique in Object Class scope |
| is_system | bool | |
| order | int | |
| description | string |
- Additional body parameters for
inttype
| Key | Type | Notes |
|---|---|---|
| default_value | int | |
| min_value | int | |
| max_value | int |
- Additional body parameters for
floattype
| Key | Type | Notes |
|---|---|---|
| default_value | float | |
| min_value | float | |
| max_value | float |
- Additional body parameters for
booltype
| Key | Type | Notes |
|---|---|---|
| required_value | bool |
- Additional body parameters for
stringtype
| Key | Type | Notes |
|---|---|---|
| max_length | int |
- Additional body parameters for
enumtype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| default_value | string |
- Additional body parameters for
settype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| min_values | int | |
| max_values | int |
- Additional body parameters for
documenttype
| Key | Type | Notes |
|---|---|---|
| max_num_of_files | enum |
- Additional body parameters for
usertype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| min_users_values | int | |
| max_users_values | int | |
| min_groups_values | int | |
| max_groups_values | int | |
| allow_sync | bool | |
| allow_members_selection | bool |
- Parameter
optionsarray
- Parameter
| Key | Type | Notes |
|---|---|---|
| users | list | |
| user_groups | list |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
POST /api/object-classes/1/fields/
{
"alias": "some_field",
"type": "int",
"min_value": 4,
"label": "field description",
"is_identifier": false,
"order": 3
}Validations
- General
- alias
- is string
- is required
- is not null
- is not blank
- is unique in the Object Class scope
- max length is 50
- first sign is not
_
- type
- is one of:
int,float,bool,string,enum,set,email,phone,date,time,datetime,url,json,document,user - is required
- is one of:
- label
- is string
- is required
- is not null
- is not blank
- is unique in the Object Class scope
- max length is 100
- is_identifier
- is bool
- is_unique
- is bool
- is_system
- is bool
- order
- is int
- is greater or equal 0
- description
- is string
- is not null
- max length is 500
inttype
- default_value
- is int
- is between
min_valueandmax_value
- max_value
- is int
- is greater or equal than
min_value
- min_value
- is int
- is less or equal than
max_value
floattype
- default_value
- is float
- is between
min_valueandmax_value
- max_value
- is float
- is greater or equal than
min_value
- min_value
- is float
- is less or equal than
max_value
booltype
- required_value
- is bool
stringtype
- max_length
- is int
- is less or equal than
255ifis_identifieris true - is less or equal
5000 - is greater than 1
enumtype
- options
- is list
- is not empty
- is not null
- list values are unique
- number of items is less or equal than 100
- default_value
- is one of the options
settype
- options
- is list
- is not empty
- is not null
- list values are unique
- number of items is less or equal than 100
- min_values
- is int
- is greater or equal than
max_values - is greater or equal than numer of options
- max_values
- is int
- is less or equal than
min_values - is greater or equal than numer of options
documenttype
- max_num_of_files
- is required
- is greater or equal than
1 - is less or equal than
100
usertype
- options
- is dict
- is not empty
- is not null
- contains only
usersanduser_groupskeys
- min_users_values
- is int
- is greater or equal than
max_users_values - is greater or equal than numer of options
- max_users_values
- is int
- is less or equal than
min_users_values - is greater or equal than numer of options
- min_groups_values
- is int
- is greater or equal than
max_groups_values - is greater or equal than numer of options
- max_groups_values
- is int
- is less or equal than
min_groups_values - is greater or equal than numer of options
- allow_sync
- is bool
- allow_members_selection
- is bool
Restrictions
- Up to 2000 Fields can be added per given Object Class, limit is configurable per build.
Response
- General keys
| Key | Type | Notes |
|---|---|---|
| id | int | |
| label | str | |
| type | str | |
| alias | str | |
| is_unique | bool | |
| is_identifier | bool | |
| is_system | bool | |
| has_duplicates | bool | |
| extras | array | |
| order | int | |
| description | str | |
| _meta | array | only for user type fields |
Response _meta array
| Key | Type | Notes |
|---|---|---|
| is_min_users_fulfilled | bool | Determine if the current User Type field configuration meets the minimum requirements |
| users | array | Users representation array |
| user_groups | array | User Groups representation array |
Additional keys depends on field type and are described in
ValidatorssectionSuccessful status
201 CreatedResponse body:
{
"id": 18,
"label": "field description",
"alias": "some_field",
"type": "int",
"is_unique": false,
"is_identifier": false,
"is_system": false,
"has_duplicates": false,
"order": 3,
"description": "",
"extras": {
"default_value": null,
"min_value": 4,
"max_value": null
},
"default_value": null,
"min_value": 4,
"max_value": null
}Errors
| Cause | Response status code | Response message |
|---|---|---|
| alias missing | 400 Bad Request | "alias": ["This field is required."] |
| alias is empty | 400 Bad Request | "alias": [ "This field may not be blank." ] |
| alias is null | 400 Bad Request | "alias": [ "This field may not be null." ] |
| alias not unique | 400 Bad Request | "alias": ["This field must be unique."] |
| alias too long | 400 Bad Request | "alias": ["Ensure this field has no more than 50 characters."] |
| alias invalid name | 400 Bad Request | "alias": ["Object Field of alias _ cannot be set."] |
| type missing | 400 Bad Request | "type": ["This field is required."] |
| type invalid choice | 400 Bad Request | "type": [""aaa" is not a valid choice."] |
| label missing | 400 Bad Request | "label": ["This field is required."] |
| label is empty | 400 Bad Request | "label": [ "This field may not be blank." ] |
| label is null | 400 Bad Request | "label": [ "This field may not be null." ] |
| label not unique | 400 Bad Request | "label": ["This field must be unique."] |
| label too long | 400 Bad Request | "label": ["Ensure this field has no more than 100 characters."] |
| order invalid | 400 Bad Request | "order": ["Ensure this value is greater than or equal to 0.'"] |
| description is null | 400 Bad Request | "description": ["This field may not be null."] |
| description too long | 400 Bad Request | "description": ["Ensure this field has no more than 500 characters."] |
| options is empty | 400 Bad Request | "options": ["This list may not be empty."] |
| options is null | 400 Bad Request | "options": ["This field may not be null."] |
| options is required | 400 Bad Request | "options": ["This field is required."] |
| options is blank | 400 Bad Request | "options": ["This list may not be blank."] |
| option too long | 400 Bad Request | "options": ["Ensure this field has no more than 100 characters."] |
| options not unique | 400 Bad Request | "options": ["Ensure options are unique."] |
| options required for user | 400 Bad Request | "options": ["At least one users or user groups must be selected."] |
| options required for user invalid type | 400 Bad Request | "options": ["Expected a dictionary of items but got type "type"."] |
| options for user null | 400 Bad Request | "options": ["This field may not be null."] |
| options for user required | 400 Bad Request | "options": ["This field is required."] |
| user_groups options for user greater than 10 | 400 Bad Request | "options": {"user_groups": ["Ensure this list has at most 10 items."]} |
| users insufficient permissions | 400 Bad Request | "options": {"users": ["You do not have permission to select user "user_id" as a user-type field option."]} |
| user_groups insufficient permissions | 400 Bad Request | "options": {"user_groups": ["You do not have permission to select user group "group_id" as a user-type field option."]} |
| user_groups options for user bool params required | 400 Bad Request | "options": ["At least one of allow_sync or allow_members_selection must be set to true when group IDs are provided."] |
| user_groups options for user bool params values | 400 Bad Request | "options": ["allow_sync and allow_members_selection parameters can only be set to true when group IDs are provided."] |
| default_value invalid | 400 Bad Request | "default_value": ["The default value should be one of options."] |
| max_value invalid | 400 Bad Request | "max_value": ["A valid integer is required."] |
| min_value invalid | 400 Bad Request | "min_value": ["A valid integer is required."] |
| max_value < min_value | 400 Bad Request | "detail": ["Max value cannot be smaller than min value."] |
| max_users_value invalid | 400 Bad Request | "max_users_value": ["A valid integer is required."] |
| min_users_value invalid | 400 Bad Request | "min_users_value": ["A valid integer is required."] |
| max_users_value < min_users_value | 400 Bad Request | "detail": ["Users max value cannot be smaller than min value."] |
| max_users_value and min_users_value with conditions | 400 Bad Request | "options": ["min_users_values and max_users_values can be specified only when user IDs are provided or group IDs are provided with allow_members_selection set to true."] |
| max_groups_value invalid | 400 Bad Request | "max_groups_value": ["A valid integer is required."] |
| min_groups_value invalid | 400 Bad Request | "min_groups_value": ["A valid integer is required."] |
| max_groups_value < min_groups_value | 400 Bad Request | "detail": ["Groups max value cannot be smaller than min value."] |
| max_groups_value and min_groups_value with allow_sync | 400 Bad Request | "options": ["min_groups_values and max_groups_values can be passed only when allow_sync is set to true."] |
| default_value < min_value | 400 Bad Request | "detail": ["Default value cannot be smaller than min value."] |
| default_value > max_value | 400 Bad Request | "detail": ["Default value cannot be bigger than max value."] |
| required_value invalid | 400 Bad Request | "required_value": ["Only boolean or null values are allowed."] |
| max_num_of_files is required | 400 Bad Request | "max_num_of_files": ["This field is required."] |
| max_num_of_files is null | 400 Bad Request | "max_num_of_files": ["This field may not be null."] |
| max_num_of_files invalid type | 400 Bad Request | "max_num_of_files": ["A valid integer is required."] |
| max_num_of_files invalid valuer | 400 Bad Request | "max_num_of_files": ["Ensure this value is greater than or equal to 1."] |
| max_length is null | 400 Bad Request | "max_length": ["This field may not be null."] |
| max_length invalid | 400 Bad Request | "max_length": ["A valid integer is required."] |
| is_identifier forbidden type | 400 Bad Request | "is_identifier": ["Object Field of type "type" cannot be set as identifier."] |
| allow_sync is set to null | 400 Bad Request | "allow_sync": ["This field may not be null."] |
| allow_members_selection is set to null | 400 Bad Request | "allow_members_selection": ["This field may not be null."] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
PATCH /api/object-classes/object_class_id/fields/id or alias/
Updates single Object Field identified by either id or alias.
Permissions
Requires authentication and object_classes.edit permission.
Allowed parameters
- Body general parameters
| Key | Type | Notes |
|---|---|---|
| label | string | |
| is_identifier | bool | |
| is_unique | bool | Field value is unique in Object Class scope |
| is_system | bool | |
| order | int | |
| description | string |
- Additional body parameters for
inttype
| Key | Type | Notes |
|---|---|---|
| default_value | int | |
| min_value | int | |
| max_value | int |
- Additional body parameters for
floattype
| Key | Type | Notes |
|---|---|---|
| default_value | float | |
| min_value | float | |
| max_value | float |
- Additional body parameters for
booltype
| Key | Type | Notes |
|---|---|---|
| required_value | bool |
- Additional body parameters for
stringtype
| Key | Type | Notes |
|---|---|---|
| max_length | int |
- Additional body parameters for
enumtype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| default_value | string |
- Additional body parameters for
settype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| min_values | int | |
| max_values | int |
- Additional body parameters for
documenttype
| Key | Type | Notes |
|---|---|---|
| max_num_of_files | enum |
- Additional body parameters for
usertype
| Key | Type | Notes |
|---|---|---|
| options | enum | |
| min_users_values | int | |
| max_users_values | int | |
| min_groups_values | int | |
| max_groups_values | int | |
| allow_sync | bool | |
| allow_members_selection | bool |
- Parameter
optionsarray
- Parameter
| Key | Type | Notes |
|---|---|---|
| users | list | |
| user_groups | list |
- Headers
Content-Type: application/json
Authorization: JWT access_token- Schema
PATCH /api/object-classes/1/fields/1/
{
"min_value": 4,
"label": "field description",
"is_identifier": false,
"order": 3
}Validations
- General
- label
- is string
- is required
- is not null
- is not blank
- is unique in the Object Class scope
- max length is 100
- is_identifier
- is bool
- is_unique
- is bool
- is_system
- is bool
- cannot be changed from true
- if set to true, only name and description can be changed
- order
- is int
- is greater or equal 0
- description
- is string
- is not null
- max length is 500
inttype
- default_value
- is int
- is between
min_valueandmax_value
- max_value
- is int
- is greater or equal than
min_value
- min_value
- is int
- is less or equal than
max_value
floattype
- default_value
- is float
- is between
min_valueandmax_value
- max_value
- is float
- is greater or equal than
min_value
- min_value
- is float
- is less or equal than
max_value
booltype
- required_value
- is bool
stringtype
- max_length
- is int
- is less or equal than
255ifis_identifieris true - is less or equal
5000 - is greater than 1
enumtype
- options
- is list
- is not empty
- is not null
- list values are unique
- number of items is less or equal than 100
- default_value
- is one of the options
settype
- options
- is list
- is not empty
- is not null
- list values are unique
- number of items is less or equal than 100
- min_values
- is int
- is greater or equal than
max_values - is greater or equal than numer of options
- max_values
- is int
- is less or equal than
min_values - is greater or equal than numer of options
documenttype
- max_num_of_files
- is required
- is greater or equal than
1 - is less or equal than
100
usertype
- options
- is dict
- is not empty
- is not null
- contains only
usersanduser_groupskeys
- min_users_values
- is int
- is greater or equal than
max_users_values - is greater or equal than numer of options
- max_users_values
- is int
- is less or equal than
min_users_values - is greater or equal than numer of options
- min_groups_values
- is int
- is greater or equal than
max_groups_values - is greater or equal than numer of options
- max_groups_values
- is int
- is less or equal than
min_groups_values - is greater or equal than numer of options
- allow_sync
- is bool
- allow_members_selection
- is bool
Response
- General keys
| Key | Type | Notes |
|---|---|---|
| id | int | |
| label | str | |
| type | str | |
| alias | str | |
| is_unique | bool | |
| is_identifier | bool | |
| is_system | bool | |
| has_duplicates | bool | |
| extras | array | |
| order | int | |
| _meta | array | only for user type fields |
Response _meta array
| Key | Type | Notes |
|---|---|---|
| is_min_users_fulfilled | bool | Determine if the current User Type field configuration meets the minimum requirements |
| users | array | Users representation array |
| user_groups | array | User Groups representation array |
Additional keys depends on field type and are described in
ValidatorssectionSuccessful status
200 OkResponse body:
{
"id": 1,
"label": "field description",
"alias": "some_field",
"type": "int",
"is_unique": false,
"is_identifier": false,
"is_system": false,
"has_duplicates": false,
"order": 3,
"extras": {
"default_value": null,
"min_value": 4,
"max_value": null
},
"default_value": null,
"min_value": 4,
"max_value": null
}Errors
| Cause | Response status code | Response message |
|---|---|---|
| label missing | 400 Bad Request | "label": ["This field is required."] |
| label is empty | 400 Bad Request | "label": [ "This field may not be blank." ] |
| label is null | 400 Bad Request | "label": [ "This field may not be null." ] |
| label not unique | 400 Bad Request | "label": ["This field must be unique."] |
| label too long | 400 Bad Request | "label": ["Ensure this field has no more than 100 characters."] |
| order invalid | 400 Bad Request | "order": ["Ensure this value is greater than or equal to 0.'"] |
| options is empty | 400 Bad Request | "options": ["This list may not be empty."] |
| options is null | 400 Bad Request | "options": ["This field may not be null."] |
| options is required | 400 Bad Request | "options": ["This field is required."] |
| options is blank | 400 Bad Request | "options": ["This list may not be blank."] |
| option too long | 400 Bad Request | "options": ["Ensure this field has no more than 100 characters."] |
| options not unique | 400 Bad Request | "options": ["Ensure options are unique."] |
| options required for user | 400 Bad Request | "options": ["At least one users or user groups must be selected."] |
| options required for user invalid type | 400 Bad Request | "options": ["Expected a dictionary of items but got type "type"."] |
| options for user null | 400 Bad Request | "options": ["This field may not be null."] |
| options for user required | 400 Bad Request | "options": ["This field is required."] |
| users insufficient permissions | 400 Bad Request | "options": {"users": ["You do not have permission to select user "user_id" as a user-type field option."]} |
| user_groups insufficient permissions | 400 Bad Request | "options": {"user_groups": ["You do not have permission to select user group "group_id" as a user-type field option."]} |
| user_groups options for user greater than 10 | 400 Bad Request | "options": {"user_groups": ["Ensure this list has at most 10 items."]} |
| user_groups options for user bool params required | 400 Bad Request | "options": ["At least one of allow_sync or allow_members_selection must be set to true when group IDs are provided."] |
| user_groups options for user bool params values | 400 Bad Request | "options": ["allow_sync and allow_members_selection parameters can only be set to true when group IDs are provided."] |
| default_value invalid | 400 Bad Request | "default_value": ["The default value should be one of options."] |
| max_value invalid | 400 Bad Request | "max_value": ["A valid integer is required."] |
| min_value invalid | 400 Bad Request | "min_value": ["A valid integer is required."] |
| max_value < min_value | 400 Bad Request | "detail": ["Max value cannot be smaller than min value."] |
| max_users_value invalid | 400 Bad Request | "max_users_value": ["A valid integer is required."] |
| min_users_value invalid | 400 Bad Request | "min_users_value": ["A valid integer is required."] |
| max_users_value < min_users_value | 400 Bad Request | "detail": ["Users max value cannot be smaller than min value."] |
| max_users_value and min_users_value with conditions | 400 Bad Request | "options": ["min_users_values and max_users_values can be specified only when user IDs are provided or group IDs are provided with allow_members_selection set to true."] |
| max_groups_value invalid | 400 Bad Request | "max_groups_value": ["A valid integer is required."] |
| min_groups_value invalid | 400 Bad Request | "min_groups_value": ["A valid integer is required."] |
| max_groups_value < min_groups_value | 400 Bad Request | "detail": ["Groups max value cannot be smaller than min value."] |
| max_groups_value and min_groups_value with allow_sync | 400 Bad Request | "options": ["min_groups_values and max_groups_values can be passed only when allow_sync is set to true."] |
| default_value < min_value | 400 Bad Request | "detail": ["Default value cannot be smaller than min value."] |
| default_value > max_value | 400 Bad Request | "detail": ["Default value cannot be bigger than max value."] |
| required_value invalid | 400 Bad Request | "required_value": ["Only boolean or null values are allowed."] |
| max_num_of_files is required | 400 Bad Request | "max_num_of_files": ["This field is required."] |
| max_num_of_files is null | 400 Bad Request | "max_num_of_files": ["This field may not be null."] |
| max_num_of_files invalid type | 400 Bad Request | "max_num_of_files": ["A valid integer is required."] |
| max_num_of_files invalid valuer | 400 Bad Request | "max_num_of_files": ["Ensure this value is greater than or equal to 1."] |
| max_length is null | 400 Bad Request | "max_length": ["This field may not be null."] |
| max_length invalid | 400 Bad Request | "max_length": ["A valid integer is required."] |
| is_identifier forbidden type | 400 Bad Request | "is_identifier": ["Object Field of type "type" cannot be set as identifier."] |
| allow_sync is set to null | 400 Bad Request | "allow_sync": ["This field may not be null."] |
| allow_members_selection is set to null | 400 Bad Request | "allow_members_selection": ["This field may not be null."] |
| modifiying is_system flag set to true | 400 Bad Request | "is_system": ["System object class field cannot be modified except for label, description or order."] |
| modifiying fields differend than: name, description, ordering when is_system flag set to true | 400 Bad Request | "is_system": ["System object class field cannot be modified except for label, description or order."] |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
DELETE /api/object-classes/object_class_id/fields/id or alias/
Deletes single Object Field identified by either id or alias.
Permissions
Requires authentication and object_class.edit permission.
Request example
- Headers
Request Method: DELETE
Location: /api/object-classes/1/fields/1/
Authorization: JWT access_tokenResponse example
- Status
204 No Content - Body
Errors
| Error | Response code | Message |
|---|---|---|
| Object Class Field in use | 400 Forbidden | "detail": "Object Class Field is in use by Sequences." |
| Object Class Field is system field | 400 Forbidden | "detail": "System object class fields cannot be deleted." |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Object Class does not exist | 404 Forbidden | "detail": "Not found" |
| Object Field does not exist | 404 Forbidden | "detail": "Not found" |
OPTIONS /api/object-classes/id/fields/
Permissions
Requires authentication only.
Request
- Headers
Request Method: OPTIONS
Content-Type: application/json
Location: /api/object-classes/1/fields/
Authorization: JWT access_tokenResponse
- Successful status
200 OK - Response body:
{
"list": {
"columns": [
{
"alias": "id",
"type": "int",
"predicates": [
"exact",
"gt",
"gte",
"lt",
"lte",
"range",
"in"
],
"sort_ok": true
},
{
"alias": "label",
"type": "string",
"predicates": [
"icontains"
],
"sort_ok": false,
"search_key": "label__icontains"
},
{
"alias": "type",
"type": "enum",
"predicates": [],
"sort_ok": false,
"values": [
{
"value": "int",
"text": "Integer"
},
{
"value": "float",
"text": "Decimal"
},
{
"value": "bool",
"text": "Checkbox"
},
{
"value": "string",
"text": "Text"
},
{
"value": "enum",
"text": "Single select"
},
{
"value": "set",
"text": "Multi select"
},
{
"value": "email",
"text": "Email"
},
{
"value": "phone",
"text": "Phone"
},
{
"value": "date",
"text": "Date"
},
{
"value": "time",
"text": "Time"
},
{
"value": "datetime",
"text": "Date/Time"
},
{
"value": "url",
"text": "URL"
},
{
"value": "json",
"text": "JSON"
},
{
"value": "document",
"text": "Document"
},
{
"value": "user",
"text": "User"
}
]
},
{
"alias": "alias",
"type": "string",
"predicates": [
"in"
],
"sort_ok": false
},
{
"alias": "is_unique",
"type": "bool",
"predicates": [],
"sort_ok": false
}
]
},
"details": {
"schema": [
{
"alias": "label",
"type": "string",
"required": true,
"validators": [
{
"type": "max_length",
"length": 100
}
]
},
{
"alias": "is_system",
"type": "bool",
"predicates": [],
"sort_ok": false
},
{
"alias": "alias",
"type": "string",
"required": true,
"validators": [
{
"type": "min_length",
"length": 1
},
{
"type": "max_length",
"length": 50
}
]
},
{
"alias": "description",
"type": "string",
"required": false,
"validators": [
{
"type": "max_length",
"length": 500
},
],
},
{
"alias": "type",
"type": "enum",
"required": true,
"values": [
{
"value": "string",
"text": "Text",
"is_unique": true,
"is_identifier": true,
"options": [
{
"name": "max_length",
"type": "int",
"required": false,
"validators": [
{
"type": "min_value",
"length": 1
},
{
"type": "max_value",
"length": 5000
}
]
}
]
},
{
"value": "int",
"text": "Integer",
"is_unique": true,
"is_identifier": true,
"options": [
{
"name": "min_value",
"type": "int",
"required": false,
"validators": []
},
{
"name": "max_value",
"type": "int",
"required": false,
"validators": []
},
{
"name": "default_value",
"type": "int",
"required": false,
"validators": []
}
]
},
{
"value": "float",
"text": "Decimal",
"is_unique": true,
"is_identifier": false,
"options": [
{
"name": "min_value",
"type": "float",
"required": false,
"validators": []
},
{
"name": "max_value",
"type": "float",
"required": false,
"validators": []
},
{
"name": "default_value",
"type": "float",
"required": false,
"validators": []
}
]
},
{
"value": "bool",
"text": "Checkbox",
"is_unique": false,
"is_identifier": false,
"options": [
{
"name": "default_value",
"type": "bool",
"required": false,
"validators": []
}
]
},
{
"value": "email",
"text": "Email",
"is_unique": true,
"is_identifier": true,
"options": []
},
{
"value": "phone",
"text": "Phone",
"is_unique": true,
"is_identifier": true,
"options": [
{
"name": "max_length",
"type": "int",
"required": false,
"validators": [
{
"type": "max_length",
"length": 20
}
]
}
]
},
{
"value": "date",
"text": "Date",
"is_unique": false,
"is_identifier": true,
"options": []
},
{
"value": "datetime",
"text": "Date/Time",
"is_unique": false,
"is_identifier": true,
"options": []
},
{
"value": "time",
"text": "Time",
"is_unique": false,
"is_identifier": false,
"options": []
},
{
"value": "url",
"text": "URL",
"is_unique": false,
"is_identifier": true,
"options": []
},
{
"value": "json",
"text": "JSON",
"is_unique": false,
"is_identifier": false,
"options": []
},
{
"value": "enum",
"text": "Single select",
"is_unique": false,
"is_identifier": false,
"options": [
{
"name": "default_value",
"type": "string",
"required": false,
"validators": []
},
{
"name": "options",
"type": "enum",
"required": true,
"validators": [
{
"type": "min_option_length",
"length": 1
},
{
"type": "max_option_length",
"length": 100
},
{
"type": "max_options",
"length": 200
}
]
}
]
},
{
"value": "set",
"text": "Multi select",
"is_unique": false,
"is_identifier": false,
"options": [
{
"name": "options",
"type": "enum",
"required": true,
"validators": [
{
"type": "min_option_length",
"length": 1
},
{
"type": "max_option_length",
"length": 100
},
{
"type": "max_options",
"length": 100
}
]
},
{
"name": "min_values",
"type": "int",
"required": false,
"validators": []
},
{
"name": "max_values",
"type": "int",
"required": false,
"validators": []
}
]
},
{
"value": "document",
"text": "Document",
"is_unique": false,
"is_identifier": false,
"options": [
{
"name": "max_num_of_files",
"type": "int",
"required": true,
"validators": [
{
"type": "min_value",
"length": 1
},
{
"type": "max_value",
"length": 100
}
]
}
]
},
{
"value": "user",
"text": "User",
"is_unique": false,
"is_identifier": false,
"options": {
"users": [
{
"name": "options",
"type": "user",
"required": false,
"validators": [
{
"type": "min_options",
"length": 1
},
{
"type": "max_options",
"length": 100
}
]
},
{
"name": "min_users_values",
"type": "int",
"required": false,
"validators": []
},
{
"name": "max_users_values",
"type": "int",
"required": false,
"validators": []
}
],
"user_groups": [
{
"name": "options",
"type": "user",
"required": false,
"validators": [
{
"type": "min_options",
"length": 1
},
{
"type": "max_options",
"length": 10
}
]
},
{
"name": "min_groups_values",
"type": "int",
"required": false,
"validators": []
},
{
"name": "max_groups_values",
"type": "int",
"required": false,
"validators": []
},
{
"name": "allow_sync",
"type": "bool",
"required": false,
"validators": []
},
{
"name": "allow_members_selection",
"type": "bool",
"required": false,
"validators": []
}
]
}
}
]
}
]
},
"restrictions": {
"limit_items": 2000
}
}GET /api/object-classes/object_class_id/fields/id or alias/
Returns single Object field identified by either id or alias.
Permissions
Requires authentication and object_classes.view permission.
URL parameters
| Key | Type | Notes |
|---|---|---|
| object_class_id | id | |
| id | id | |
| alias | str | Field's alias |
Request example
- Headers
Request Method: GET
Content-Type: application/json
Location: /api/object-classes/1/fields/1/
Authorization: JWT access_tokenResponse
- General keys
| Key | Type | Notes |
|---|---|---|
| id | int | |
| label | str | |
| type | str | |
| alias | str | |
| is_unique | bool | |
| is_identifier | bool | |
| is_system | bool | |
| has_duplicates | bool | |
| extras | array | |
| order | int | |
| description | str | |
| _meta | array |
Additional keys depends on field type and are described in
ValidatorssectionSuccessful status
200 OKResponse body:
- Response body for
intfield type
- Response body for
{
"id": 18,
"label": "field description",
"alias": "some_field",
"type": "int",
"is_unique": false,
"is_identifier": false,
"is_system": false,
"has_duplicates": false,
"order": 3,
"description": "int field description",
"extras": {
"default_value": null,
"min_value": 4,
"max_value": null
},
"default_value": null,
"min_value": 4,
"max_value": null
}- Response body for
userfield type
- Response body for
{
"_meta": {
"is_min_users_fulfilled": true,
"user_groups": [
{
"id": 138,
"name": "UsersGroup 0",
"num_of_members": 1
}
],
"users": []
},
"alias": "slug_name_0",
"allow_members_selection": true,
"allow_sync": true,
"extras": {
"allow_members_selection": true,
"allow_sync": true,
"max_groups_values": 1,
"max_users_values": 1,
"min_groups_values": 1,
"min_users_values": 1,
"options": {
"user_groups": [
138
],
"users": []
}
},
"has_duplicates": false,
"id": 8,
"is_identifier": false,
"is_unique": false,
"label": "Name 0",
"max_groups_values": 1,
"max_users_values": 1,
"min_groups_values": 1,
"min_users_values": 1,
"options": {
"user_groups": [
138
],
"users": []
},
"order": 0,
"description": "user field description",
"type": "user"
}Errors
| Error | Response code | Message |
|---|---|---|
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Object Field with "id" does not exist | 404 Not Found | "detail": "Not found." |
| Object Class with "id" does not exist | 404 Not Found | "detail": "Not found." |
GET /api/object-classes/object_class_id/fields/
Endpoint retrieving the list of fields assigned to given Object Class.
Permissions
Requires authentication and object_class.view permission.
Request example
- Headers
Request Method: GET
Location: /api/object-classes/1/fields/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| id | int | |
| label | str | |
| type | str | |
| alias | str | |
| is_unique | bool | |
| is_identifier | bool | |
| is_system | bool | |
| extras | Object | |
| order | int | |
| sort_ok | bool |
Response extras array
Contains additional configuration options of a Field.
Response example
- Status
200 OK - Body
{
"limit": 100,
"offset": 0,
"filtered_count": 2,
"total_count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"label": "First Name",
"type": "string",
"alias": "firstname",
"is_required": true,
"is_unique": false,
"is_identifier": false,
"is_system": false,
"extras": {
"max_length": null
},
"order": 0,
"sort_ok": true
},
{
"id": 2,
"label": "Has a dog",
"type": "bool",
"alias": "has_a_dog",
"is_required": false,
"is_unique": false,
"is_identifier": false,
"extras": {
"default_value": null
},
"order": 1,
"sort_ok": false
},
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| id | {build}/api/object-classes/object_class_id/fields/?ordering=id | Ascending |
| id | {build}/api/object-classes/object_class_id/fields/?ordering=-id | Descending (-) |
Filtering
Please check ALX API standards for predicates available per type.
| Parameter | Type | Example |
|---|---|---|
| id | int + enum | {build}/api/object-classes/object_class_id/fields/?id__in=1,2 |
| alias__in | enum | {build}/api/object-classes/object_class_id/fields/?alias__in=email,last_name |
| label__icontains | string | {build}/api/object-classes/object_class_id/fields/?label__icontains=name |
Errors
| Error | Response code | Message |
|---|---|---|
object_class_id is invalid | 404 Bad Request | 'detail': "Not found." |
| Unauthorized API call | 403 Bad Request | 'detail': "You do not have permission to perform this action." |
GET /api/object-classes/{object_class_id}/fields/autocomplete/
Returns list of Object Classes Fields.
Permissions
Requires authentication and object_classes.view permission.
Response contains only the fields for the associated object class.
Request example
- Headers
Content-Type: application/json
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| limit | int | |
| offset | int | |
| total_count | int | Total number of results visible to the user (based on permissions). |
| filtered_count | int | Number of results visible to the user (based on permissions) with filters applied. |
| next | url | Next page URL (null if there is no next page) |
| previous | url | Previous page URL (null if there is no previous page) |
| results | Array | List of results. Described in the next table. |
Response results array
| Key | Type | Notes |
|---|---|---|
| value | str | Field alias constructed from prefix and slug namefield_<slug_name> |
| values | Array | List of options to choice for choice type fields. |
| text | str | Field name. |
| predicates | Array | List of predicates for given field type. |
Response results.values array
| Key | Type | Notes |
|---|---|---|
| value | str | Option value. |
| text | str | Option representation text. |
- Successful status
200 OK - Response body schema
{
"limit": <int>,
"offset": <int>,
"filtered_count": <int>,
"total_count": <int>,
"next": <str>,
"previous": <str>,
"results": [
{
"id": <pk>,
"value": <str>,
"values": [
{
"value": <str>,
"text": <str>
},
],
"text": <str>,
"predicates": <Array>
}
]
}Sorting
| Parameter | Example | Notes |
|---|---|---|
| value | /api/object-classes/{object_class_id}/fields/autocomplete/?ordering=value | Ascending |
| value | /api/object-classes/{object_class_id}/fields/autocomplete/?ordering=-value | Descending (-) |
| text | /api/object-classes/{object_class_id}/fields/autocomplete/?ordering=text | Ascending |
| text | /api/object-classes/{object_class_id}/fields/autocomplete/?ordering=-text | Descending (-) |
Filtering
Please check ALX API standards for predicates available per type.
| Parameter | Type | Example | Notes |
|---|---|---|---|
| text | str | /api/object-classes/{object_class_id}/fields/autocomplete/?text__contains=text | |
| for_filtering | bool | /api/object-classes/{object_class_id}/fields/autocomplete/?for_filtering=1 | Filter by types which supports filtering for given field type. Set 0 or skip parameter to disable filtering. |
Field types with filtering support
text
integer
decimal
date
date/time
email
phone
set
enum
url
user
Errors
| Error | Response code | Message |
|---|---|---|
| Requesting user is not authenticated | 401 Unauthorized | "detail": "Authentication credentials were not provided." |
| Requesting user is authorized but without view perm for tasks resource | 403 Forbidden | "detail": "You do not have permission to perform this action." |
| Object Class with "{id}" does not exist | 404 Not Found | "detail": "Not found." |
POST /api/object-classes/object_class_id/fields/validate/
Validates object class fields.
Permissions
Requires authentication and object_classes.view permission.
URL parameters
| Key | Notes |
|---|---|
| object_class_id | Object Class ID |
Request Schema
- Headers
Request Method: POST
Location: /api/object-classes/{object_class_id}/fields/validate/
Authorization: JWT access_token- Body
[<int>]Request body must contain a list of Object Class Field ids.
[<field_id1>, <field_id2>]Request example
[2734, 7231]Validations
Validation logic for individual types.
usertype
| Field Configuration | Counting Logic | No min_users_values | min_users_values defined |
|---|---|---|---|
| Individual users | Individual users defined in the Class field | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| Individual users and user groups with allow_members_selection | Unique users from the ones defined in the Class field - including both individual users and group members | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| Individual users and user groups with allow_sync | Individual users defined in the Class field | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| Individual users and user groups with allow_sync and allow_members_selection | Unique users from the ones defined in the Class field - including both individual users and group members | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| User groups with allow_members_selection | Unique users from the group members list of the groups defined in the Class field | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| User groups with allow_members_selection and allow_sync | Unique users from the group members list of the groups defined in the Class field | always fulfilled | To be fulfilled must have at least the defined number of unique users available |
| User groups with allow_sync | n/a | always fulfilled | always fulfilled |
Restrictions
- Up to 2000 Fields can be sent.
Response
Some Fields Invalid.
| Key | Type | Notes |
|---|---|---|
| error | Object | field validation error message |
- Successful status
200 Ok - Response body:
{
"error": [ "The field "<field_name>" does not have enough valid options available." ]
}All Fields valid.
- Successful status
204 No Content
Errors
| Cause | Response status code | Response message |
|---|---|---|
object_class_id is invalid | 404 Bad Request | 'detail': "Not found." |
| Insufficient permissions | 403 Forbidden | "detail": "You do not have permission to perform this action." |
GET /api/object-classes/object_class_id/fields/id or alias/usage/
Returns usage data of an Object field identified by either id or alias.
Permissions
Requires authentication and object_class.view permission.
Request example
- Headers
Request Method: GET
Location: /api/object-classes/1/fields/2/usage/
Authorization: JWT access_tokenResponse
| Key | Type | Notes |
|---|---|---|
| num_of_message_templates | int | |
| message_templates | array | |
| num_of_message_templates_with_field | int | |
| num_of_records | int | |
| num_of_records_with_values | int | |
| task_template_forms | array | |
| num_of_task_template_forms | int | |
| document_templates | array | |
| sequences | array | |
| num_of_sequences | int | |
| num_of_upload_components | int |
Response message_templates array
| Key | Type | Notes |
|---|---|---|
| id | int | Message template id |
| name | str | Name of message template |
Response task_template_forms array
| Key | Type | Notes |
|---|---|---|
| id | int | Task Template id |
| name | str | Name of Task Template |
Response document_templates array
| Key | Type | Notes |
|---|---|---|
| id | int | Document Template id |
| name | str | Name of Document Template |
| object_class_id | int | ID of related Object Class |
| object_class_name | str | Name of related Object Class |
Response sequences array
| Key | Type | Notes |
|---|---|---|
| id | int | Sequence id |
| name | str | Name of Sequence |
Response example
- Status
200 OK - Body
{
"num_of_message_templates": 55,
"message_templates": [],
"num_of_message_templates_with_field": 0,
"num_of_records": 176,
"num_of_records_with_values": 21,
"task_template_forms": [
{
"id": 1,
"name": "Template 1"
}
],
"num_of_task_template_forms": 1,
"document_templates": [
{
"id": 1,
"name": "Document Template 1",
"object_class_id": 1,
"object_class_name": "Object Class 1",
}
],
"sequences": [
{
"id": 1,
"name": "Sequence 1"
}
],
"num_of_sequences": 1,
"num_of_upload_components": 1,
}Errors
| Error | Response code | Message |
|---|---|---|
id is invalid | 404 Bad Request | 'detail': "Not found." |
| Unauthorized API call | 403 Bad Request | 'detail': "You do not have permission to perform this action." |