Evaluate inline Velocity code (POST)
Changed onEvaluates Velocity (VTL) code supplied directly in the request body — no .vtl file on disk is required — and returns the result. The code is read from a velocity property of the JSON body (properly escaped), or the body may be the raw VTL itself.
The caller requires the Scripting Developer role.
Response shape is decided by the submitted code:
- If the code populates $dotJSON (e.g. $dotJSON.put("key", ...)), the response is that JSON object.
- Otherwise the raw evaluated output is returned, with the content type set by the script (defaults to text/plain).
Velocity errors (syntax/parse errors, method-invocation failures, missing resources) are reported as a 400 with a structured body so an automated caller can locate and fix the offending code instead of receiving partial output. Application-level errors set by the script via $dotJSON.put("errors", ...) are also returned as 400.
Warnings — dotCMS evaluates Velocity in non-strict mode, so an undefined reference ($noSuchVar) renders as literal text and a method returning null produces no output. These likely-typos are collected and, on a successful response, returned in the X-Dot-Velocity-Warnings header (a JSON array); on a 400 they appear in the warnings field of the body.
Request
- Base URLhttps://docs.anzworldline-solutions.com.au
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Request body
Response
Velocity evaluated successfully; body is the raw output or the JSON object produced by the script
Changes
- breaking
added the pattern
.*to thepathrequest parameterpathParam - info
api operation id
dynamicPost_3removed and replaced withdynamicPost_2 - info
api tag
Templatesadded - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the success response with the status
- breaking