As of July 2022, we have the possibilty to execute web service operations as idempotent operations.
The article Making retries safe with idempotent APIs explains it perfectly. I had already thought of this solution before searching the internet for best practices to this problem. From that article, I would emphasize:
The exact list of supported operations can be obtained by executing this SQL command in the database:
SELECT name FROM vtiger_ws_operation where is_idempotency=1
As of the moment of writing this article, they are:
To mark a supported operation as idempotent we have to send an additional parameter with the call: cbwsOptions
. This parameter is an array in which we can define the ClientRequestIdentifier
. This option can have two values:
generate
or empty: in this case, coreBOS will generate the ID for the operation so it can do the tracking of the repeated calls internallyWe do a normal update call but setting the ClientRequestIdentifier
parameter to the empty string so coreBOS can do the internal control of the operation. The description field is updated.
Now we update the description field from inside the application
We do the call again and get the exact same result as the first call. The description field is NOT updated, the web service update call was detected as already executed and ignored.
Next| Chapter 15: coreBOS Web Service Developer Tool.