NextGen APIs

POST /integration/documents/r1/dynamic-forms/sheets

Http Verb

POST

Url

/integration/documents/r1/dynamic-forms/sheets

Permissions required

Core Additional Parameters: Edit (fsm.core.additionalparameter.edit)

WorkOrder: View (fsm.core.workorder.view) or WorkOrder: Edit (fsm.core.workorder.edit)

WO Configuration: View (fsm.core.workorder.configuration.view) or WO Configuration: Edit (fsm.core.workorder.configuration.edit)

Technical Object: View (fsm.core.technicalobject.facility.view) or Technical Object: Edit (fsm.core.technicalobject.facility.edit)

Customer: View (fsm.core.technicalobject.customer.view) or Customer: Edit (fsm.core.technicalobject.customer.edit)

Last Modified Version

r1

Tech Tags

MULTILANGUAGE-FIELDS

Available Async

No

BPMN Diagram

Integration_API_POST_Dynamic_Forms_Sheets_20260211_v1.0.svg


Business Logic

This Integration API creates or updates a Dynamic Form Sheet.

System verifies that only one between workOrderOperation, resource, asset and account object is present, because it is not possibile to have a sheet associated to multiple entities:

  • If workOrder is populated: system verifies that at least one of the fields workOrder.code or workOrder.externalCode is present.

  • If resource is populated: system verifies that at least one of the fields resource.identificationNumber or resource.secondaryIdentificationNumber is present.

  • If asset is populated: system verifies that at least one of the fields asset.externalCode or asset.code is present.

  • If account is populated: system verifies that at least one of the fields account.externalCode or account.code is present.

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 - Operation Center Validation

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

API Verb: GET

Resource: Operation Centers

Input: operationCenterCode, active=true

Output: operationCenterId

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 3 - Work Order Validation

System takes Input fields and checks their existence.

This step is skipped if workOrder is absent.

API Verb: GET

Resource: Work Orders

Input: [workOrder.code] OR [externalSystemId, workOrder.externalCode], operationCenterId

Output: workOrderId

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 3b- Work Order Operation Validation

System takes Input fields and checks the existence of the operation. If workOrderOperation is absent system checks if input work order has only one operation.

API Verb: GET

Resource: Work Order Operations

Input: workOrderId, [workOrderOperation.operationExecutionOrder] OR [workOrderOperation.operationCode]

Output: workOrderOperationId

If System can obtain the Output fields and workOrderOperation.operationExecutionOrder is not null OR workOrderOperation.operationCode is not null → continue to next step.

If System can obtain the Output fields and both workOrderOperation.operationExecutionOrder and workOrderOperation.operationCode are null, checks if the number of workOrderOperationId is equal to one → continue to next step.

If System can’t obtain the Output fields or the number of workOrderOperationId is not equal to one→ responds with error. Elaboration is stopped.

Error Type:

STEP 4 - Resource Validation

System takes Input fields and checks the existence of the resource.

This step is skipped if resource is absent.

API Verb: GET

Resource: Resources

Input: operationCenterId, [resource.identificationNumber] OR [resource.secondaryIdentificationNumber]

Output: resourceId

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 5 - Asset Validation

System takes Input fields and checks the existence of the asset.

This step is skipped if asset is absent.

API Verb: GET

Resource: Asset

Input: [asset.code] or [asset.externalCode]

Output: assetId

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 6 - Account Validation

System takes Input fields and checks the existence of the account.

This step is skipped if account is absent.

API Verb: GET

Resource: Account

Input: [account.code] or [account.externalCode]

Output: accountId

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 7 - Dynamic Form Template Validation

System takes Input fields and checks their existence.

API Verb: GET

Resource: Dynamic Forms Templates

Input: templateCode

Output: templateId

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 8 - Dynamic Form Template Structure Validation

System verifies that list of node.code in input matches correctly with dynamic form template nodes codes.

System takes Input fields and checks their existence.

This step is skipped if node field is absent.

API Verb: GET

Resource: Dynamic Forms Templates Release Current Models

Input: templateId

Output: list of [children.node.id, children.node.properties.code, children.node.type.name]

If System can obtain the Output fields and all children.node.properties.code match with input nodes.code fields → continue to next step.

If System can obtain the Output fields and not all children.node.properties.code match with input nodes.code fields → responds with error. Elaboration is stopped.

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

Error Type:

STEP 9 - Dynamic Form Sheet Existence

System takes Input fields and checks their existence.

This step is skipped if sheet.code is absent.

API Verb: GET

Resource: Dynamic Form Sheets

Input: code

Output: sheetId, statusId, workOrderOperationId, resourceId, accountId, assetId

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

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

Error Type:

STEP 10 - Dynamic Form Sheet Creation

System takes Input fields and checks their existence.

API Verb: POST

Resource: Dynamic Forms Templates / Sheet

Input: templateId, operationCenterId, list of [description.lang, description.value]

Output: sheetId

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 11 - Sheet Code Retrieval

System takes Input fields and retrieve the sheet code to be returned in response payload.

This step is skipped if sheet.code is present.

API Verb: GET

Resource: Sheets

Input: sheetId

Output: code

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:

STEP 12 - Nodes Valorization

System updates the Dynamic Form Sheet structure.

API Verb: PATCH

Resource: Dynamic Sheet Nodes

Input: sheetId, list of [id, type.name, nodes.value(=type.value)]

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

STEP 13 - Entity Association

System compares the entity currently associated to sheet with the entity provided in the input payload and determines if a swap or removal is required.

  • Current Entity: Can be resourceId (step Dynamic Form Sheet Existence), assetId (step Dynamic Form Sheet Existence), accountId (step Dynamic Form Sheet Existence) or workOrderOperationId (step Dynamic Form Sheet Existence).

  • Target Entity: Can be resourceId (step Resource Validation), assetId (step Asset Validation), accountId (step Account Validation) or workOrderOperationId (step Work Order Operation Validation)

STEP 13a - Work Order Operation Removal

System takes Input fields and deletes current Work Order Operation association to Sheet.

This step is skipped if current workOrderOperationId is absent or current workOrderOperationId is equal to target workOrderOperationId

API Verb: DELETE

Resource: Sheet Operations

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13b - Resource Removal

System takes Input fields and deletes current Resource association to Sheet.

This step is skipped if current resourceId is absent or current resourceId is equal to target resourceId

API Verb: DELETE

Resource: Sheet Resources

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13c - Asset Removal

System takes Input fields and deletes current Asset association to Sheet.

This step is skipped if current assetId is absent or current assetId is equal to target assetId

API Verb: DELETE

Resource: Sheet Assets

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13d - Account Removal

System takes Input fields and deletes current Account association to Sheet.

This step is skipped if current accountId is absent or current accountId is equal to target accountId

API Verb: DELETE

Resource: Sheet Accounts

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13e - Work Order Operation Association

System takes Input fields and associate the target Work Order Operation to Sheet.

This step is skipped if target workOrderOperationId is absent or current workOrderOperationId is equal to target workOrderOperationId

API Verb: POST

Resource: Sheet Operations

Input: sheetId, workOrderOperationId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13f - Resource Association

This step is skipped if target resourceId is absent or current resourceId is equal to target resourceId

API Verb: POST

Resource: Sheet Resource

Input: sheetId, resourceId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13g - Asset Association

System takes Input fields and associate the target Asset to Sheet.

This step is skipped if target assetId is absent or current assetId is equal to target assetId

API Verb: POST

Resource: Sheet Assets

Input: sheetId, assetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 13h - Account Association

System takes Input fields and associate the target Account to Sheet.

This step is skipped if target accountId is absent or current accountId is equal to target accountId

API Verb: POST

Resource: Sheet Account

Input: sheetId, accountId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 14 - Sheet Unlock Management

These steps are skipped if lockManagement is absent or lockManagement value is ‘LOCK’.

STEP 14a - Sheet Unlock Request

System takes Input fields to request the Unlock of the Sheet.

API Verb: POST

Resource: Sheet Unlock Request

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 14b - Sheet Unlock

System takes Input fields to Unlock the Sheet.

API Verb: POST

Resource: Sheet Unlock

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

Error Type:

  • Others - see link in Resource

STEP 15 - Sheet Lock Management

System takes Input fields to Lock the Sheet.

These steps are skipped if lockManagement is absent or lockManagement value is ‘UNLOCK’.

API Verb: POST

Resource: Sheet Lock

Input: sheetId

Output: Response State

If Response State is SUCCESS → continue to next step.

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

sheet

externalSystemCode


External System Code

Y

Not Blank

2

operationCenterCode


Operation Center Code

Y

Not Blank

3

code


Sheet Code

N

Absent or Not Blank

4

templateCode


Template Code

Y

Not Blank

5

description

(minOccurs=0,

maxOccurs=N)

lang

Sheet Description Language

Y

Absent or not blank

6

value

Sheet Description Value

Y


7

lockManagement


Allows to lock or request the unlock of the sheet.

N

Absent or not blank.

Accepted values:

  • LOCK

  • UNLOCK

8

nodes

(minOccurs=0,

maxOccurs=N)

code


Sheet Node Code

Y

Absent or Not Blank

9

value


Sheet Node Value

Y

Absent or Not Blank

10

workOrder

code


Work Order Code

N

Absent or Not Blank

11

externalCode


Account Code

N

Absent or Not Blank 

12

workOrderOperation

operationCode

Operation Code

N

Absent or Not Blank 

13

operationExecutionOrder

Operation Execution Order

N

Absent or Not Blank 

14

resource

identificationNumber


Resource Identification Number

N

Absent or Not Blank

15

secondaryIdentificationNumber


Resource Secondary Identification Number

N

Absent or Not Blank

16

asset

code


Asset Code

N

Absent or Not Blank

17

externalCode


Asset External Code

N

Absent or Not Blank

18

account

code


Account Code

N

Absent or Not Blank

19

externalCode


Account External Code

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

Creation example - Work Order Case

JSON

{   
  "extension":{
      "myFieldName":"myValue"
   },
    "sheet": {
        "extension":{
            "myFieldName":"myValue"
        },
        "externalSystemCode": "SAP",
        "operationCenterCode": "OCENW",
        "templateCode": "INT_API",
        "code": "OCENW-2602100902292753038",
        "description": [
            {
                "lang": "en",
                "value": "Sheet Test"
            }
        ]
    },
    "nodes": [
        {
            "code": "INFO",
            "value": "Test String"
        },
        {
            "code": "VALUE",
            "value": 123
        },
        {
            "code": "MULTI",
            "value": "OPT1"
        }
    ],
    "workOrder": {  
      "extension":{
        "myFieldName":"myValue"
       },
        "code": "OCENW00001",
        "workOrderOperation": {
            "operationExecutionOrder": 4
        }
    }
}

Response documentation

Response payload fields

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

Extension fields:

Field

Description

Note

code

Code of the Dynamic Form

Only for SUCCESS

code

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

Only for ERROR

instanceCode

Code of generated resource

Only for ERROR

Response example

JSON
{
  "code": "OCENE-26010716253545645"
}
JSON
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "External system string does not exist",
  "instance": "/integration/work-orders/r1/documents",
  "instanceCode": "DCS001",
  "code": "IA001_001"
} 

Response error codes