NextGen APIs

PATCH /integration/documents/r1/documents

Http Verb

PATCH

Url

/integration/documents/r1/documents

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


Available Async

No

BPMN Diagram (TBD)


Business Logic

This Integration API update a document if it’s already 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 - New Version File Creation

System takes Input fields and creates a new version of an existing files

API Verb: POST

Resource: File Version

Input: fileUuid, name, startValidityDate, endValidityDate

Output: Response State, uuid, version

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 3 - Upload URL Retrieve

System takes Input fields and retrieves the Presigned URL.

API Verb: GET

Resource: Upload URLs

Input: uuid, version

Output: presignedURL

If System can obtain the Output fields, it automatically uploads the file → continue to next step.

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

Error Type:

STEP 4 - Metadata Creation or Update

System checks whether there is any metadata in the request.

This step is skipped if the input Metadata fields are absent.

STEP 4a - Resource Id Retrieve (perhaps to be eliminated in the future)

System takes uuid created in step File Creation and uses it as Input Field.

API Verb: GET

Resource: Files

Input: uuid

Output: id

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

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

Error Type:

STEP 4b - Metadata Retrieve

System takes Input fields and checks their existence.

Input filed resourceId corresponds to the id output retrieved in the step Resource Id Retrieve.

API Verb: GET

Resource: Metadata

Input: resourceId

Output: metadataId

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

If System can’t obtain the Output fields → continue to the step Metadata Creation

Error Type:

STEP 4c - Metadata Update

System takes Input fields and updates the metadata record.

API Verb: PATCH

Resource: Metadata

Input: metadataId, description, number, notes

Output: Response State

If Response State is SUCCESS → continue to the step File activation.

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

Error Type:

  • Others - see link in Resource

STEP 4d - Metadata Creation

System takes Input fields and creates the Metadata record.

API Verb: POST

Resource: Metadata

Input: resourceId, description, number, notes

Output: Response State, metadataId

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 5 - File Activation

System uploads file on the presignedURL and then activates it.

API Verb: POST

Resource: /{fileUuid}/activations

Input: uuid

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

requestData


externalSystemCode

External System Code

Y

Not Blank

2


uuid

Uuid of source file

Y

Not Blank

3


name

Name

N


4


startValidityDate

Start Validity Date

N


5


endValidityDate

End Validity Date

N


6

file.metadata

description

Metadata Description

N

 

7

number

Metadata Number

N

 

8

notes

Metadata Notes

N

 

9

fileContent


fileContent

File to upload

Y


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"
  },
  "externalSystemCode": "SAP",
  "file": {
    "extension": {
      "myFieldName": "myValue"
    },
    "fileUuid": "214dbe38-1240-4acf-8b34-a06db8136270",
    "name": "doc2",
    "startValidityDate": "2026-07-10T21:36:02.491Z",
    "endValidityDate": "2026-08-10T21:36:02.491Z" 
    },
    "metadata": {
      "extension": {
        "myFieldName": "myValue"
      },
      "description":"broken meter report 1",
      "number":"2",
      "notes":"To be replaced"
    }
  }
}

Response documentation

Response payload fields

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

Extension fields:

Field

Description

Note

code

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

Only for ERROR

Response example

{
  "uuid": "c89f7ea8-7ef5-4f3f-bd37-d11fc50088c1"
}
JSON
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "External system string does not exist",
  "instance": "/integration/work-orders/r1/documents",
  "code": "IA001_001"
} 

Response error codes