|
Method
|
POST
|
|
URL
|
/v2/<object_full_identifier>/fields
|
|
Parameters
|
|
|
Response Content Type
|
application/json
|
|
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.
|
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"}]
|
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.
|
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"]
}
}]
|
Field
|
Description
|
Type
|
Required
|
|---|---|---|---|
|
io_name
|
Name of the option to create.
|
String
|
Yes
|
|
io_identifier
|
Identifier of the option to create.
|
String
|
Yes
|
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
}
]
}]
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
}
]
}
]
[{
"__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,
.
.
.
}]
|
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
|