https://github.com/folio-org/folio-custom-fields
FOLIO module library to store and maintain custom fields using Okapi's multiple interfaces feature. All modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints. The client must set the X-Okapi-Module-Id header, for details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Collection of custom-field items.
Create a new custom-field item.
POST /custom-fields
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Custom field collection item",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"description": "The name of the custom field",
"example": "Department"
},
"refId": {
"type": "string",
"description": "The reference id of the custom field. Read only, autogenerated field",
"example": "department_1",
"readonly": true
},
"type": {
"type": "string",
"description": "The type of the custom field",
"example": "RADIO_BUTTON",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Field Types Schema",
"additionalProperties": false,
"enum": [
"RADIO_BUTTON",
"SINGLE_CHECKBOX",
"SINGLE_SELECT_DROPDOWN",
"MULTI_SELECT_DROPDOWN",
"TEXTBOX_SHORT",
"TEXTBOX_LONG",
"DATE_PICKER"
]
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package"
},
"visible": {
"type": "boolean",
"description": "Defines visibility of the custom field",
"default": true,
"example": true
},
"required": {
"type": "boolean",
"description": "Defines if the custom field is required",
"default": false,
"example": true
},
"isRepeatable": {
"type": "boolean",
"description": "Defines if the custom field is repeatable",
"default": false,
"example": true
},
"order": {
"type": "integer",
"description": "The order of the custom field to be displayed",
"example": 1,
"readonly": true
},
"helpText": {
"type": "string",
"description": "The description of the custom field",
"example": "Provide a department"
},
"checkboxField": {
"type": "object",
"description": "Checkbox field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Checkbox Field Schema",
"additionalProperties": false,
"properties": {
"default": {
"type": "boolean",
"description": "Defines if the custom field is default",
"example": false,
"default": false
}
}
},
"selectField": {
"type": "object",
"description": "Select field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Select Field Schema",
"additionalProperties": false,
"properties": {
"multiSelect": {
"type": "boolean",
"description": "Defines if the custom field is a multi select",
"example": false
},
"options": {
"type": "object",
"description": "Defines the options for the custom field",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOptions",
"properties": {
"values": {
"type": "array",
"description": "Defines the possible values for the custom field",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Select Field Option Schema",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOption",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1"
},
"value": {
"type": "string",
"description": "Possible value of the custom field",
"example": "Engineering"
},
"default": {
"type": "boolean",
"description": "Indicates that this value is default",
"default": false,
"example": false
}
},
"required": [
"value"
]
}
},
"sortingOrder": {
"type": "string",
"enum": [
"ASC",
"DESC",
"CUSTOM"
],
"description": "Defines sorting order for the custom field",
"example": "ASC",
"default": "CUSTOM"
}
},
"required": [
"values"
]
}
},
"required": [
"multiSelect",
"options"
]
},
"textField": {
"type": "object",
"description": "Text field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Textbox Field Schema",
"additionalProperties": false,
"properties": {
"fieldFormat": {
"type": "string",
"description": "Defines custom field format option",
"$schema": "http://json-schema.org/draft-04/schema#",
"enum": [
"TEXT",
"EMAIL",
"URL",
"NUMBER"
],
"example": "EMAIL",
"default": "TEXT"
}
},
"required": [
"fieldFormat"
]
},
"displayInAccordion": {
"type": "string",
"description": "Display in accordion names for the custom field"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"name",
"type",
"entityType"
]
}
Example:
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
}
Returns a newly created item, with server-controlled fields like 'id' populated
URI to the created custom-field item
Media type: application/json
Type: any
Example:
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
}
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to add custom-field -- malformed JSON at 13:3"
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to create custom-fields -- unauthorized
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Update all custom fields and delete fields that are not mentioned in request
PUT /custom-fields
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Collection of custom fields for PUT request",
"additionalProperties": false,
"properties": {
"customFields": {
"type": "array",
"description": "An array of custom fields",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Custom field collection item",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"description": "The name of the custom field",
"example": "Department"
},
"refId": {
"type": "string",
"description": "The reference id of the custom field. Read only, autogenerated field",
"example": "department_1",
"readonly": true
},
"type": {
"type": "string",
"description": "The type of the custom field",
"example": "RADIO_BUTTON",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Field Types Schema",
"additionalProperties": false,
"enum": [
"RADIO_BUTTON",
"SINGLE_CHECKBOX",
"SINGLE_SELECT_DROPDOWN",
"MULTI_SELECT_DROPDOWN",
"TEXTBOX_SHORT",
"TEXTBOX_LONG",
"DATE_PICKER"
]
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package"
},
"visible": {
"type": "boolean",
"description": "Defines visibility of the custom field",
"default": true,
"example": true
},
"required": {
"type": "boolean",
"description": "Defines if the custom field is required",
"default": false,
"example": true
},
"isRepeatable": {
"type": "boolean",
"description": "Defines if the custom field is repeatable",
"default": false,
"example": true
},
"order": {
"type": "integer",
"description": "The order of the custom field to be displayed",
"example": 1,
"readonly": true
},
"helpText": {
"type": "string",
"description": "The description of the custom field",
"example": "Provide a department"
},
"checkboxField": {
"type": "object",
"description": "Checkbox field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Checkbox Field Schema",
"additionalProperties": false,
"properties": {
"default": {
"type": "boolean",
"description": "Defines if the custom field is default",
"example": false,
"default": false
}
}
},
"selectField": {
"type": "object",
"description": "Select field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Select Field Schema",
"additionalProperties": false,
"properties": {
"multiSelect": {
"type": "boolean",
"description": "Defines if the custom field is a multi select",
"example": false
},
"options": {
"type": "object",
"description": "Defines the options for the custom field",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOptions",
"properties": {
"values": {
"type": "array",
"description": "Defines the possible values for the custom field",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Select Field Option Schema",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOption",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1"
},
"value": {
"type": "string",
"description": "Possible value of the custom field",
"example": "Engineering"
},
"default": {
"type": "boolean",
"description": "Indicates that this value is default",
"default": false,
"example": false
}
},
"required": [
"value"
]
}
},
"sortingOrder": {
"type": "string",
"enum": [
"ASC",
"DESC",
"CUSTOM"
],
"description": "Defines sorting order for the custom field",
"example": "ASC",
"default": "CUSTOM"
}
},
"required": [
"values"
]
}
},
"required": [
"multiSelect",
"options"
]
},
"textField": {
"type": "object",
"description": "Text field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Textbox Field Schema",
"additionalProperties": false,
"properties": {
"fieldFormat": {
"type": "string",
"description": "Defines custom field format option",
"$schema": "http://json-schema.org/draft-04/schema#",
"enum": [
"TEXT",
"EMAIL",
"URL",
"NUMBER"
],
"example": "EMAIL",
"default": "TEXT"
}
},
"required": [
"fieldFormat"
]
},
"displayInAccordion": {
"type": "string",
"description": "Display in accordion names for the custom field"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"name",
"type",
"entityType"
]
}
},
"entityType": {
"type": "string",
"description": "The entityType of custom fields"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"customFields",
"entityType"
]
}
Example:
{
"customFields": [
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
},
{
"name": "Phone",
"refId": "phone",
"visible": true,
"required": false,
"helpText": "Phone number",
"entityType": "user",
"type": "TEXTBOX_SHORT"
}
]
}
All custom fields successfully updated
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to update /custom-fields -- malformed JSON at 13:4"
Internal server error
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Retrieve a list of custom-field items.
GET /custom-fields
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
Query should contain custom field attributes
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
name=department
Skip over a number of elements by specifying an offset value for the query
Example:
0
Limit the number of elements returned in the response
Example:
10
Requested language. Optional. [lang=en]
Returns a list of custom-field items
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Collection of custom fields",
"additionalProperties": false,
"properties": {
"customFields": {
"type": "array",
"description": "An array of custom fields",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Custom field collection item",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"description": "The name of the custom field",
"example": "Department"
},
"refId": {
"type": "string",
"description": "The reference id of the custom field. Read only, autogenerated field",
"example": "department_1",
"readonly": true
},
"type": {
"type": "string",
"description": "The type of the custom field",
"example": "RADIO_BUTTON",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Field Types Schema",
"additionalProperties": false,
"enum": [
"RADIO_BUTTON",
"SINGLE_CHECKBOX",
"SINGLE_SELECT_DROPDOWN",
"MULTI_SELECT_DROPDOWN",
"TEXTBOX_SHORT",
"TEXTBOX_LONG",
"DATE_PICKER"
]
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package"
},
"visible": {
"type": "boolean",
"description": "Defines visibility of the custom field",
"default": true,
"example": true
},
"required": {
"type": "boolean",
"description": "Defines if the custom field is required",
"default": false,
"example": true
},
"isRepeatable": {
"type": "boolean",
"description": "Defines if the custom field is repeatable",
"default": false,
"example": true
},
"order": {
"type": "integer",
"description": "The order of the custom field to be displayed",
"example": 1,
"readonly": true
},
"helpText": {
"type": "string",
"description": "The description of the custom field",
"example": "Provide a department"
},
"checkboxField": {
"type": "object",
"description": "Checkbox field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Checkbox Field Schema",
"additionalProperties": false,
"properties": {
"default": {
"type": "boolean",
"description": "Defines if the custom field is default",
"example": false,
"default": false
}
}
},
"selectField": {
"type": "object",
"description": "Select field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Select Field Schema",
"additionalProperties": false,
"properties": {
"multiSelect": {
"type": "boolean",
"description": "Defines if the custom field is a multi select",
"example": false
},
"options": {
"type": "object",
"description": "Defines the options for the custom field",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOptions",
"properties": {
"values": {
"type": "array",
"description": "Defines the possible values for the custom field",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Select Field Option Schema",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOption",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1"
},
"value": {
"type": "string",
"description": "Possible value of the custom field",
"example": "Engineering"
},
"default": {
"type": "boolean",
"description": "Indicates that this value is default",
"default": false,
"example": false
}
},
"required": [
"value"
]
}
},
"sortingOrder": {
"type": "string",
"enum": [
"ASC",
"DESC",
"CUSTOM"
],
"description": "Defines sorting order for the custom field",
"example": "ASC",
"default": "CUSTOM"
}
},
"required": [
"values"
]
}
},
"required": [
"multiSelect",
"options"
]
},
"textField": {
"type": "object",
"description": "Text field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Textbox Field Schema",
"additionalProperties": false,
"properties": {
"fieldFormat": {
"type": "string",
"description": "Defines custom field format option",
"$schema": "http://json-schema.org/draft-04/schema#",
"enum": [
"TEXT",
"EMAIL",
"URL",
"NUMBER"
],
"example": "EMAIL",
"default": "TEXT"
}
},
"required": [
"fieldFormat"
]
},
"displayInAccordion": {
"type": "string",
"description": "Display in accordion names for the custom field"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"name",
"type",
"entityType"
]
}
},
"totalRecords": {
"description": "Total number of records available, that match search conditions",
"type": "integer"
}
},
"required": [
"customFields",
"totalRecords"
]
}
Example:
{
"customFields": [
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
},
{
"name": "Phone",
"refId": "phone",
"visible": true,
"required": false,
"helpText": "Phone number",
"entityType": "user",
"type": "TEXTBOX_SHORT"
}
]
}
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
unable to list custom-fields -- malformed parameter 'query', syntax error at column 6
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
unable to list custom-fields -- unauthorized
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"type": "object",
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Retrieve custom-field item with given {custom-fieldId}
GET /custom-fields/{id}
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Returns item with a given ID
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Custom field collection item",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"description": "The name of the custom field",
"example": "Department"
},
"refId": {
"type": "string",
"description": "The reference id of the custom field. Read only, autogenerated field",
"example": "department_1",
"readonly": true
},
"type": {
"type": "string",
"description": "The type of the custom field",
"example": "RADIO_BUTTON",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Field Types Schema",
"additionalProperties": false,
"enum": [
"RADIO_BUTTON",
"SINGLE_CHECKBOX",
"SINGLE_SELECT_DROPDOWN",
"MULTI_SELECT_DROPDOWN",
"TEXTBOX_SHORT",
"TEXTBOX_LONG",
"DATE_PICKER"
]
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package"
},
"visible": {
"type": "boolean",
"description": "Defines visibility of the custom field",
"default": true,
"example": true
},
"required": {
"type": "boolean",
"description": "Defines if the custom field is required",
"default": false,
"example": true
},
"isRepeatable": {
"type": "boolean",
"description": "Defines if the custom field is repeatable",
"default": false,
"example": true
},
"order": {
"type": "integer",
"description": "The order of the custom field to be displayed",
"example": 1,
"readonly": true
},
"helpText": {
"type": "string",
"description": "The description of the custom field",
"example": "Provide a department"
},
"checkboxField": {
"type": "object",
"description": "Checkbox field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Checkbox Field Schema",
"additionalProperties": false,
"properties": {
"default": {
"type": "boolean",
"description": "Defines if the custom field is default",
"example": false,
"default": false
}
}
},
"selectField": {
"type": "object",
"description": "Select field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Select Field Schema",
"additionalProperties": false,
"properties": {
"multiSelect": {
"type": "boolean",
"description": "Defines if the custom field is a multi select",
"example": false
},
"options": {
"type": "object",
"description": "Defines the options for the custom field",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOptions",
"properties": {
"values": {
"type": "array",
"description": "Defines the possible values for the custom field",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Select Field Option Schema",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOption",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1"
},
"value": {
"type": "string",
"description": "Possible value of the custom field",
"example": "Engineering"
},
"default": {
"type": "boolean",
"description": "Indicates that this value is default",
"default": false,
"example": false
}
},
"required": [
"value"
]
}
},
"sortingOrder": {
"type": "string",
"enum": [
"ASC",
"DESC",
"CUSTOM"
],
"description": "Defines sorting order for the custom field",
"example": "ASC",
"default": "CUSTOM"
}
},
"required": [
"values"
]
}
},
"required": [
"multiSelect",
"options"
]
},
"textField": {
"type": "object",
"description": "Text field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Textbox Field Schema",
"additionalProperties": false,
"properties": {
"fieldFormat": {
"type": "string",
"description": "Defines custom field format option",
"$schema": "http://json-schema.org/draft-04/schema#",
"enum": [
"TEXT",
"EMAIL",
"URL",
"NUMBER"
],
"example": "EMAIL",
"default": "TEXT"
}
},
"required": [
"fieldFormat"
]
},
"displayInAccordion": {
"type": "string",
"description": "Display in accordion names for the custom field"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"name",
"type",
"entityType"
]
}
Example:
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
}
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"custom-field not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Delete custom-field item with given {custom-fieldId}
DELETE /custom-fields/{id}
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Item deleted successfully
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to delete custom-field -- constraint violation"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"custom-field not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Update custom-field item with given {custom-fieldId}
PUT /custom-fields/{id}
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Custom field collection item",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"description": "The name of the custom field",
"example": "Department"
},
"refId": {
"type": "string",
"description": "The reference id of the custom field. Read only, autogenerated field",
"example": "department_1",
"readonly": true
},
"type": {
"type": "string",
"description": "The type of the custom field",
"example": "RADIO_BUTTON",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Custom Field Types Schema",
"additionalProperties": false,
"enum": [
"RADIO_BUTTON",
"SINGLE_CHECKBOX",
"SINGLE_SELECT_DROPDOWN",
"MULTI_SELECT_DROPDOWN",
"TEXTBOX_SHORT",
"TEXTBOX_LONG",
"DATE_PICKER"
]
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package"
},
"visible": {
"type": "boolean",
"description": "Defines visibility of the custom field",
"default": true,
"example": true
},
"required": {
"type": "boolean",
"description": "Defines if the custom field is required",
"default": false,
"example": true
},
"isRepeatable": {
"type": "boolean",
"description": "Defines if the custom field is repeatable",
"default": false,
"example": true
},
"order": {
"type": "integer",
"description": "The order of the custom field to be displayed",
"example": 1,
"readonly": true
},
"helpText": {
"type": "string",
"description": "The description of the custom field",
"example": "Provide a department"
},
"checkboxField": {
"type": "object",
"description": "Checkbox field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Checkbox Field Schema",
"additionalProperties": false,
"properties": {
"default": {
"type": "boolean",
"description": "Defines if the custom field is default",
"example": false,
"default": false
}
}
},
"selectField": {
"type": "object",
"description": "Select field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Select Field Schema",
"additionalProperties": false,
"properties": {
"multiSelect": {
"type": "boolean",
"description": "Defines if the custom field is a multi select",
"example": false
},
"options": {
"type": "object",
"description": "Defines the options for the custom field",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOptions",
"properties": {
"values": {
"type": "array",
"description": "Defines the possible values for the custom field",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Select Field Option Schema",
"additionalProperties": false,
"javaType": "org.folio.rest.jaxrs.model.SelectFieldOption",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1"
},
"value": {
"type": "string",
"description": "Possible value of the custom field",
"example": "Engineering"
},
"default": {
"type": "boolean",
"description": "Indicates that this value is default",
"default": false,
"example": false
}
},
"required": [
"value"
]
}
},
"sortingOrder": {
"type": "string",
"enum": [
"ASC",
"DESC",
"CUSTOM"
],
"description": "Defines sorting order for the custom field",
"example": "ASC",
"default": "CUSTOM"
}
},
"required": [
"values"
]
}
},
"required": [
"multiSelect",
"options"
]
},
"textField": {
"type": "object",
"description": "Text field properties",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Textbox Field Schema",
"additionalProperties": false,
"properties": {
"fieldFormat": {
"type": "string",
"description": "Defines custom field format option",
"$schema": "http://json-schema.org/draft-04/schema#",
"enum": [
"TEXT",
"EMAIL",
"URL",
"NUMBER"
],
"example": "EMAIL",
"default": "TEXT"
}
},
"required": [
"fieldFormat"
]
},
"displayInAccordion": {
"type": "string",
"description": "Display in accordion names for the custom field"
},
"metadata": {
"description": "User metadata information",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"type": "object",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record (when available)",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate"
]
}
},
"required": [
"name",
"type",
"entityType"
]
}
Example:
{
"name": "Department",
"refId": "department",
"visible": true,
"required": true,
"helpText": "Provide a department",
"entityType": "package",
"type": "SINGLE_SELECT_DROPDOWN"
}
Item successfully updated
Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.
Media type: text/plain
Type: any
Example:
"unable to update custom-field -- malformed JSON at 13:4"
Item with a given ID not found
Media type: text/plain
Type: any
Example:
"custom-field not found"
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
internal server error, contact administrator
Returns usage statistic of custom field with the given id
GET /custom-fields/{id}/stats
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Requested language. Optional. [lang=en]
Returns statistic of custom field with the given id
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Custom field statistic",
"additionalProperties": false,
"properties": {
"fieldId": {
"type": "string",
"description": "Unique generated identifier for the custom field",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da"
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field is assigned to",
"example": "package",
"readonly": true
},
"count": {
"type": "integer",
"description": "The number of usages by entity with the particular type",
"example": 3,
"readonly": true
}
},
"required": [
"fieldId",
"entityType",
"count"
]
}
Example:
{
"fieldId": "a772e255-4f75-4742-8735-a8b1a02348d4",
"entityType": "package",
"count": 10
}
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
Unable to get retrieve statistic -- unauthorized
Custom field with the given id is not found
Media type: text/plain
Type: any
Example:
Custom field not found
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator
Returns usage statistic of custom field option with the given optId
GET /custom-fields/{id}/options/{optId}/stats
The Okapi Module-Id, must be set by the client because all modules that use this library share the CRUD interface POST/PUT/GET/DELETE on /custom-fields and /custom-fields/$id endpoints with Okapi's multiple interfaces feature. For details see Okapi multiples interfaces documentation, folio-custom-fields introduction, and Custom Field backend demo.
Example:
mod-users-19.0.0
Returns usage statistic of custom field option with the given optId
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Custom field option statistic",
"additionalProperties": false,
"properties": {
"optionId": {
"type": "string",
"description": "Unique identifier for the option",
"pattern": "opt_\\d{1,5}",
"example": "opt_1",
"readonly": true
},
"customFieldId": {
"type": "string",
"description": "Custom field ID",
"example": "62d00c36-a94f-434d-9cd2-c7ea159303da",
"readonly": true,
"$schema": "http://json-schema.org/draft-04/schema#",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
},
"entityType": {
"type": "string",
"description": "The entity type, the custom field option is assigned to",
"example": "user",
"readonly": true
},
"count": {
"type": "integer",
"description": "The number of usages by entity with the particular type",
"example": 3,
"readonly": true
}
},
"required": [
"fieldId",
"entityType",
"count"
]
}
Example:
{
"optionId": "opt_1",
"customFieldId": "a772e255-4f75-4742-8735-a8b1a02348d4",
"entityType": "package",
"count": 10
}
Not authorized to perform requested action
Media type: text/plain
Type: any
Example:
Unable to get retrieve statistic -- unauthorized
Custom field with the given id is not found
Media type: text/plain
Type: any
Example:
Custom field not found
Internal server error, e.g. due to misconfiguration
Media type: text/plain
Type: any
Example:
Internal server error, contact administrator