Creating Groovy endpoints
Groovy endpoints allow you to run Groovy scripts.
The familiar Groovy functions are available in the "Groovy script selection" dialog step. You can open the Groovy editor there and create a Groovy file directly or import an existing file.
Methods
Note that the specification of the method has (only) an informative value for Groovy endpoints. So if you use POST, for example, you should do this when the triggered Groovy script writes a data set or "creates" something in general. Or use GET if you want the Groovy script to return something.
For Groovy endpoints, specifying the method does not cause any functionality. It (merely) serves to provide the users or consumers of the API with a good understanding of the API endpoint.
The following methods are available for Groovy API endpoints:
-
GET
-
POST
-
PUT
-
PATCH
-
DELETE
JSON-Body
The dialog steps for creating a JSON body are not available for Groovy endpoints. You must integrate a corresponding response body or request body into the Groovy script.
Overview of the next chapters
The following section provides instructions for creating a Groovy endpoint using the POST method.