Is it possible to call an fonction before data saved from rest api?

Hi , i want to make an transformation or vérification before data are saved from the REST API.
Is it possible to intercepte the data by specifie an callback in the parameter of the REST API?

Hi,

Let me ask you a question: why do you want to verify and transform the data in a callback? Why not to perform all verifications and transformations before passing the data in the REST API methods?

Hello , thanks for your reply!
I want to send an image to the server with the REST API , but i would like to save my image to Cloudinary.
So with my callback before to save to the server , i can send the image to Cloudinary , receive it ID from Cloudinary , and save the ID to the server database.

Ok, I see. Anyway, the standard API doesn’t have any callbacks. In your case, it seems that it will be simpler just to execute two sequential requests: one for the Cloudinary, get the ID, and then the second request to the platform using this ID.
As for the data validation, in the upcoming release 6.4 we’ll support Bean Validation. You will be able to define validation rules in the entity class and then the entity instance will be automatically verified before each modifications both in the web application and in the REST API.

ok, i wait for upcoming release 6.4 , thanks