Create Fields
Use this endpoint to create single or multiple fields with different data types, namespaces, applications and attributes. Created fields are related to the specified object.
Method
POST
URL
/v2/<object_full_identifier>/fields
Parameters
Response Content Type
application/json
Service Input Data for Field Creation
Input data is sent to the service in the request body as a JSON representation of the array of fields to create and relate to the specified object (<object_full_identifier>). Each element of the array must contain the data needed to create a field. The data is represented by a JSON map of <field_full_identifier, value>, where each key corresponds to a full identifier of a Field object. Only required fields must be specified to create a field, and if nonmandatory attributes are left unspecified, default values are set. Also, to create fields of certain data types, you must include additional data. For more information, see Specific Input Data for Relationship Field Creation and Specific Input Data for Option List Field Creation below.
General Input Data
Field
Description
Type
Required
io_name
Name of the field to create
String
Yes
io_identifier
Identifier of the field to create
String
Yes
io_namespace
Namespace of the field to create, specified with the identifier of the namespace.
String
Yes
io_application
Application of the field to create, with the application name specified.
String
Yes
io_datatype
Data type of the field to create, with the data type identifier specified.
String
Yes
Fields with the Relationship data type
Relationship related to the field to create.
JSON code that specifies relationship data.
Yes
Fields with the Dynamic Relationship data type
Dynamic relationship related to the field to create.
JSON code that specifies dynamic relationship data.
Yes
Fields with the Option List data type
Option list related to the field to create.
JSON array that specifies option list values.
Yes
io_<identifier>
Nonmandatory field attributes
Based on the field data type, JSON representation as described in REST API Data Type Representation.
Not required. If not set, default values apply.
Input Example
Following is an example POST request to create a Boolean field named Test Field for the Showcase object, with a test_field identifier, in the io namespace and the Max application:
POST https://localhost:8080/v2/io_showcase/fields

[{"io_name": "Test Field", "io_identifier":"test_field", "io_namespace":"io", "io_application":"Max","io_datatype":"boolean", "io_default_value":"true"}]
At minimum, the request body must include the mandatory data for each field to create, and optional attributes if needed. For some data types, such as Relationship, Dynamic Relationship, and Option List, additional data must be provided.
Specific Input Data for Relationship Field Creation
For a Relationship field to be created, in addition to the required attributes in General Input Data, the following data must also be provided to create the associated relationship in the same namespace and application specified for the fields.
Field
Description
Type
Required
io_type
The relationship type. Supported values are referential, master, and hierarchical.
String
Yes
targets
An array that specifies the target objects for the relationship by their full identifiers.
Array of String
Not required if hasAllTargets is set to true, required otherwise.
hasAllTargets
Attribute that specifies the relationship can have any target object. This removes the need to specify all platform objects in the targets array and applies only to dynamic relationships.
Boolean
Not required. If hasAllTargets is set to true and objects are specified in the targets array, an error is thrown.
io_name
Name of the relationship to create.
String
Not required. If not specified, the source object and field identifier are combined and used to set this value.
io_identifier
Identifier of the relationship to create.
String
Not required. If not specified, the source object and field identifier are combined and used to set this value.
Input Example
Following is an example POST request to create a Relationship field named Test Relationship Field for the Showcase object, with a test_rel_field identifier, in the io namespace and the Max application. The relationship is referential and has User and Account as its target objects.
POST https://localhost:8080/v2/io_showcase/fields
\
[{
"io_name": "Test Relationship Field",
"io_identifier":"test_rel_field",
"io_namespace":"io",
"io_application":"Max",
"io_datatype": "dynamic_relationship",
"relationship": {
"io_type": "referential",
"targets": ["io_user", "io_account"]
}
}]
Specific Input Data for Option List Field Creation
For an Option List field to be created, in addition to the required attributes in General Input Data, the following data must also be provided to create the list of associated options in the same namespace and application specified for the fields.
Field
Description
Type
Required
io_name
Name of the option to create.
String
Yes
io_identifier
Identifier of the option to create.
String
Yes
Input Example
Following is an example POST request to create an Option List field named Test Option List Field for the Showcase object, with a test_option_list_field identifier, in the io namespace and Max application, with options named Option 1 and Option 2:
POST https://localhost:8080/v2/io_showcase/fields

[{
"io_name": "Test Option List Field",
"io_identifier": "test_option_list_field",
"io_namespace": "io",
"io_application": "Max",
"io_datatype": "option_list",
"options": [{
"io_name": "Option 1",
"io_identifier": "option1",
"io_ordering_position": 1
},
{
"io_name": "Option 2",
"io_identifier": "option2",
"io_ordering_position": 2
}
]
}]
Create Multiple Fields
Following is an example POST request to create multiple fields:
POST https://localhost:8080/v2/io_showcase/fields

[{
"io_name": "Test Relationship Field", <-- create a dynamic relationship with any targets
"io_identifier": "test_rel_field",
"io_namespace": "io",
"io_application": "Max",
"io_datatype": "dynamic_relationship",
"relationship": {
"io_type": "referential",
"hasAllTargets": true
}
},
{
"io_name": "Test Boolean Field", <-- create a boolean field
"io_identifier": "test_boolean_field",
"io_namespace": "io",
"io_application": "Max",
"io_datatype": "boolean"
},
{
"io_name": "Test Relationship Field1", <-- create a non dynamic relationship with User as target object
"io_identifier": "test_rel_field1",
"io_namespace": "io",
"io_application": "Max",
"io_datatype": "relationship",
"relationship": {
"io_type": "referential",
"targets": ["io_user"]
}
},
{
"io_name": "Test Option List Field", <- create an option list field with options 'Option 1' and 'Option 2'
"io_identifier": "test_option_list_field",
"io_namespace": "io",
"io_application": "Max",
"io_datatype": "option_list",
"options": [{
"io_name": "Option 1",
"io_identifier": "option1",
"io_ordering_position": 1
},
{
"io_name": "Option 2",
"io_identifier": "option2",
"io_ordering_position": 2
}
]
}
]
Service Response Example
Following is an example Status Code 200 response received if input data validation is successfully passed and all fields (including related relationships and options if applicable) are successfully created. The response is a JSON array that includes all created fields.
[{
"__object_identifier": "io_field",
"io_column_name": null,
"io_owner": "764f0869-8b2a-4e43-8f23-88f593863eff",
"io_custodian_reserved": false,
"io_default_value": null,
"io_private": false,
"io_custodian_change_policy": null,
"io_placeholder": null,"io_renderer_datatype": [
"json",
""],"io_created_on": "2017-07-06T10:41:43.937-03:00",
"io_update_safe": true,
"io_access_control_enabled": false,
"io_description": null,
"io_initialize_operation": null,
"io_updated_by": "764f0869-8b2a-4e43-8f23-88f593863eff",
"io_short_description": null,
"io_required": false,
"io_recalc_on_read": false,
"io_validation_operation": null,
.
.
.
}]
Error Response Messages
HTTP Status Code
Error Message
400
The body of the request is empty
400
The body of the request has invalid format
400
The required parameters are not informed
500
Body: Error Creating Fields. Exception={...}
Status: Internal Server error
For more information:
Was this helpful?