NextGen APIs

POST /configurations/characteristics/r1/characteristics

Http Verb

POST

Url

/configurations/characteristics/r1/characteristics

Permissions required


Personally Identifiable Information (PII)

No

Sensitive Information

No

Last Modified Version

r1

Released since

2024 W1 (FSM 16.0)

Deprecated since


Removed since


Tech Tags

MULTILANGUAGE-FIELDS

Business Logic

This API creates a new characteristic.

Validations

Checks if code, characteristicClass, description, and dataType are not empty or missing. If yes, throw an error BASE_0003.

  • Verifies that a characteristic with the same code and characteristicClass doesn't already exist in the system

  • It also sets default values for some boolean fields (meter to false, active to true, negativeValues to false, notNull to false) if they are not explicitly provided

  • If the inserted characteristic is marked as a meter (meaning characteristic.meter = true), and its usage is set to OBJECTS_ATTRIBUTES(usageId = 1), then this combination is considered invalid and the error CHAR_005 is thrown.

  • If usageId != 1:

    • dataTypeId must be either DOUBLE (dataTypeId = 8 ) or NUMBER (dataTypeId = 1 ) . If it's anything else (like text, date, etc.), it throws an error CHAR_002. This means if a characteristic is not an object attribute, it's expected to be a numerical type.

    • measureUnitId is null, it throws an error CHAR_003. This ensures that any non-object-attribute characteristic (which, as per the previous rule, must be numerical) also has a unit of measurement associated with it (e.g., meters, kilograms, units).

  • If dataTypeId is DOUBLE (dataTypeId = 8 ):

    • It must have size, maxLength, and precision defined in the request. If not, it throws an error CHAR_004, error.

  • If dataTypeId is EURO(dataTypeId = 9 ), VARCHAR (dataTypeId = 2 ), or NUMBER (dataTypeId = 1 )

    • It must have size = null and maxLength = null. It must NOT have precision defined (precision = null). If at least one of those conditions is not met, it throws an error CHAR_004, error.

    • If the dataTypeId is not NUMBER (meaning it's EURO with dataTypeId = 9 or VARCHAR with dataTypeId = 2), it must NOT have a measurementUnitId (measureUnitId = null). If it does, it throws an error CHAR_004, error.

  • If dataTypeId is COMBO (dataTypeId = 7 ), BOOLEAN (dataTypeId = 4 ), TIME(dataTypeId = 6 ), DATE(dataTypeId = 3 ), or DATETIME(dataTypeId = 5 ):

    • It must NOT have size, maxLength, precision, or measurementUnitId defined (all of these field null). If any of these are present, it throws an error CHAR_004, error.

    • If dataTypeId is COMBO (dataTypeId = 7 ):

      • it must have a valueDomainId defined (valueDomainId != null).

      • then, it checks if the provided valueDomainId actually exists within a list of valid domain values retrieved from the system. If valueDomain is missing or not valid, it throws an error CHAR_004, error.

Header Parameters

Default.

Request Body Parameters

Field

Validations

Note

code

Not null 

Max Length: 120

 

description

Not null  

Max Length: 255

 

active

Max Length: 1

 

order

Max Length: 10


dataTypeId

Not null 

Max Length: 10


format

Max Length: 2048


size

Max Length: 10


maxLength

Max Length: 10


notNull

 Max Length: 4


measureUnitId

Max Length: 10


precision

Max Length: 10


valueDomainId

Max Length: 10


characteristicClassId

Not null

Max Length: 10


usageId

Max Length: 10


meter

 Max Length: 4


negativeValues

 Max Length: 1


Response documentation

Response payload fields

Field

Note

id

 

Response error codes

BASE_0003, BASE_0007, CHAR_001, BASE_0001, CHAR_002, CHAR_003,CHAR_004, CHAR_005