Skip to main content
Version: 2025.002.000

PUT

Complete Resource Update

PUT: webapi_base_url/v1/production/{module}/{resource}/0

Parameters

  • id: The identifier code of the resource to be read.
  • body: The object of type {resource}DTO to be updated.
  • force: The error code(s) (separated by ,) to ignore during the operation.

Response Code

  • 200: The object has been successfully updated.
  • 400: The object was not updated; the response content contains the validation messages produced.
  • 404: The object was not found.
  • 409: The object was not updated due to unmet business logic; the response content contains the validation messages produced.

PATCH

Partial Resource Update

PATCH: webapi_base_url/v1/production/{module}/{resource}/0

Parameters

  • id: The identifier code of the resource to be read.
  • force: The error code(s) (separated by ,) to ignore during the operation.
  • body: Specifies a set of changes to apply to the resource. It can be more efficient than using PUT because the client sends only the changes, not the entire representation of the resource.

Example Body

{
"title": "pippo",
"accounts": [
{
"id": 1,
"description": "account1"
},
{
"id": 2,
"patchInternalOp": "delete"
},
{
"patchInternalOp": "add",
"description": "account3"
}
]
}

In this example body, the attribute patchInternalOp is used to delete (using the key, e.g., id) or add sub-elements to a resource. Each sub-element without patchInternalOp is searched within the resource by its key (e.g., id). If found, it is considered for modification; otherwise, it is added.

Response Code

  • 200: The object has been successfully updated.
  • 400: The object was not updated; the response content contains the validation messages produced.
  • 404: The object was not found.
  • 409: The object was not updated due to unmet business logic; the response content contains the validation messages produced.