NextGen APIs

POST /integration/configurations/r1/characteristics

Http Verb

POST

Url

/integration/configurations/r1/characteristics

Permissions required

Facility Configuration: View (fsm.core.technicalobject.configuration.view)

Facility Configuration: Edit (fsm.core.technicalobject.configuration.edit)

Last Modified Version

r1

Tech Tags

MULTILANGUAGE-FIELDS

Available Async

No

BPMN Diagram

diagram (23).svg

Business Logic

This Integration API creates or updates a Characteristic for Asset.

System verifies Permission Required and starts the elaboration that is organized in steps.

STEP 1 - External System Validation

System takes Input fields and checks their existence in internal configuration.

API Verb: GET

Resource: External Systems

Input: externalSystemCode, active=true

Output: externalSystemId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 2 - Data Type Validation

System takes Input fields and checks their existence.

This step is skipped if Input fields are absent.

API Verb: GET

Resource: Data Types

Input: dataTypeDescription

Output: dataTypeId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 3 - Measurement Unit Validation

System takes Input fields and checks their existence.

This step is skipped if Input fields are absent.

API Verb: GET

Resource: Measurement Units

Input: measurementUnitCode, active=true

Output: measurementUnitId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 4 - Usage Validation

System takes Input fields and checks their existence.

This step is skipped if Input fields are absent.

API Verb: GET

Resource: Usages

Input: usageDescription

Output: usageId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 5 - Characteristic Class Type Validation

System takes Input fields and checks their existence.

API Verb: GET

Resource: Class Types

Input: characteristicClassType.code

Output: classTypeId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 6 - Characteristic Class Existence

System takes Input fields and checks their existence.

API Verb: GET

Resource: Classes

Input: caharacteristicClass.Code, classTypeId, page=num,0,size,0

Output: classId

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → continue to step Characteristic Class Creation.

Error Type:

  • Others - see link in Resource

STEP 7 - Value Domain Validation

System takes Input fields and checks their existence.

This step is skipped if Input fields is absent.

API Verb: GET

Resource: Value Domains

Input: valueDomainCode, active=true

Output: valueDomainId

If System can obtain the Output fields → continue to step Value Domain Items Existence

If System can’t obtain the Output fields → System verifies if valueDomain.description is present.

  • If yes → continue to next step.

  • If not → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 7a - Value Domain Creation

System takes input fields and creates the Value Domain.

API Verb: POST

Resource: Value Domains

Input: valueDomainCode, description, active

Output: valueDomainId, Response State

If Response State is SUCCESS → continue to next step.

If Response State is ERROR → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 7b - Value Domain Items Existence

System takes Input fields and checks their existence.

API Verb: GET

Resource: Value Domains Items

Input: valueDomainId

Output: list of [itemId, code, value]

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → continue to next step.

Error Type:

  • Others - see link in Resource

STEP 7c - Value Domain Items Compare

System compare input characteristicValueDomain.code items with the code of Value Domain Items retrieved in STEP Value Domain Items Existence.

If codes are already existing → Value Domain Items Update

If codes are not present → Value Domain Items Creation

STEP 7e - Value Domain Items Update

System updates value of items already present

API Verb: PATCH

Resource: Value Domains Item

Input: valueDomainId, itemId, value, visible

Output: Response State

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 7f - Value Domain Items Creation

System creates Value Domain Items.

API Verb: POST

Resource: Value Domains Item

Input: valueDomainId, code, value, visible

Output: Response State

If Response State is SUCCESS → continue to next step.

If Response State is ERROR → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 10 - Characteristic Existence

System takes Input fields and checks their existence.

API Verb: GET

Resource: Characteristics

Input: characteristic.code, classId, page=num,0,size,0

Output: characteristicId

If System can obtain the Output fields → continue to step Characteristic Class Update and then to step Characteristic Update.

If System can’t obtain the Output fields → continue to step Characteristic Class Update and then to step Characteristic Creation.

Error Type:

  • Others - see link in Resource

STEP 10a - Characteristic Class Creation

System takes Input fields and checks their existence in internal configuration.

API Verb: POST

Resource: Classes

Input: characteristicClass.code, characteristicClass.description (multilanguage object), classTypeId, active

Output: Response State

If Response State is SUCCESS → continue to step Characteristic Creation.

If Response State is ERROR → elaboration is stopped. See Response payload fields.

Error Type:

  • Others - see link in Resource

STEP 10b - Characteristic Class Update

System takes Input fields and checks their existence in internal configuration.

API Verb: PATCH

Resource: Classes

Input: characteristicClass.code, characteristicClass.description (multilanguage object), classTypeId, active

Output: Response State

If Response State is SUCCESS → continue to step Characteristic Creation or to step Characteristic Update.

If Response State is ERROR → elaboration is stopped. See Response payload fields.

Error Type:

  • Others - see link in Resource

STEP 11a - Characteristic Creation

System takes Input fields and checks their existence in internal configuration.

API Verb: POST

Resource: Characteristics

Input: characteristic.code, characteristic.description (multilanguage object), classId, format, size, maxLength, notNull, active, precision, order, meter, negativeValues, dataTypeId, valueDomainId, measurementUnitId, usageId

Output: Response State

If Response State is SUCCESS → see Response payload fields.

If Response State is ERROR → elaboration is stopped. See Response payload fields.

Error Type:

  • Others - see link in Resource

STEP 11b - Characteristic Update

System takes Input fields and checks their existence in internal configuration.

API Verb: PATCH

Resource: Characteristics

Input: characteristic.code, characteristic.description (multilanguage object), classId, format, size, maxLength, notNull, active, precision, order, meter, negativeValues, dataTypeId, valueDomainId, measurementUnitId, usageId

Output: Response State

If Response State is SUCCESS → elaboration is stopped. See Response payload fields.

If Response State is ERROR → elaboration is stopped. See Response payload fields.

Error Type:

  • Others - see link in Resource


Path Parameters

As their name suggests, they are included in the URL path of the endpoint.

Not applicable.

Query String Parameters

Start with a ? and includes parameters listed one after the another separated by &.

Not applicable.

Header Parameters

Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.

Default.

Request Body Parameters

Request body parameters are used when clients send data to the API. They are shipped in a JSON Object only in POST, PUT, or PATCH requests.

 


Field

Description

Mandatory

Constraint

1

characteristic


externalSystemCode

External System Code

Y

Not Blank

2


code

Characteristic Code

Y

Not Blank

3


description

Characteristic Description: Multilanguage field

N


4


format

Format

N


5


size

Size

N


6


maxLength

Max lenght

N


7


notNull

Flag mandatory

N


8


active

Flag active

N


9


precision

Precision

N


10


order

Order

N


11


meter

Is meter flag

N


12


negativeValues

Negative values flag

N


13


dataTypeDescription

Description for data type

(Mandatory in Creation)

N

Absent or Not Blank

14


valueDomainCode

Code for value domain

N

Absent or Not Blank

15


measurementUnitCode

Code for unit of measurement

N

Absent or Not Blank

16


usageDescription

Description for usage

(Mandatory in Creation)

N

Absent or Not Blank

17

characteristicClassType


code

Characteristic Class Type Code

The codes for the type managed (MATERIALS or FACILITIES) must be agreed with the external system

Y

Not Blank

18

characteristicClass


code

Characteristic Class Code

Y

Not Blank

19


description

Characteristic Class Description: Multilanguage field

N


20


active

Flag active

N


21

valueDomain

(minOccurs=0, maxOccurs=1)


description

Value Domain Description

Y

Not Blank

22


active

Flag active

N

Absent or Not Blank

23

itemList

(minOccurs=1, maxOccurs=N)

code

Value Code

Y

Not Blank

24

value

Value Description

N

Absent or Not Blank

25

visible

Visible Flag

N

Absent or Not Blank

26

order

Order

N

Absent or Not Blank

The objects in input could have also the extension object that allows to add additional, customized data to this API. More info here How to use APIs: Custom data via Extension.

Request example

JSON
{
  "extension": {},
  "characteristic": {
    "extension": {
        "myFieldName": "myValue"
    },
    "externalSystemCode": "SAP",
    "code": "CODE_01",
    "description": [ 
     {
       "lang": "en",
       "value": "Description of Characteristic 01"
     }
    ],
   "format": "Text",
   "size": 5,
   "maxLength": 10,
   "notNull": true,
   "active": true,
   "order": 10 
  },
  "characteristicClassType": {
    "extension": {
        "myFieldName": "myValue"
    },
    "code": "CT01"
  },
  "characteristicClass": {
    "extension": {
        "myFieldName": "myValue"
    },
    "code": "CL01",
    "description": [
     {
       "lang": "it",
       "value": "Classe 01"
     },
     {
       "lang": "en",
       "value": "Class 01"
     }
    ],
    "active": true
  }
}

 

Response documentation

Response payload fields

Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html

Extension fields:

Field

Description

Note

id

Id of the resource created

Only for SUCCESS

code

Extension member of a Problem Details Object that contains the error code

Only for ERROR

Response example

JSON
{
  "id": 123456
}
JSON
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "External system string does not exist",
  "instance": "/integration/configurations/r1/characteristics",
  "code": "IA001_001"
}

 

Response error codes