Introduction
JuliuS exposes a local HTTP server based on Indy TIdHTTPServer that enables remote control of the scripting engine and the embedded browser (Chromium CEF). All endpoints use a single route with parameters in the query string.
The endpoints are divided into three macro-areas: Browser CEF (operations inside the embedded browser), Page Inspection / DevTools (reading the DOM, frames, network), OS (operating-system-level mouse and keyboard, for native windows outside the browser).
Base URL & Authentication
Load script from file
Settings.Data.scriptPath and opens it in JuliuS's graphical editor. Use this endpoint when the script to run already resides on the disk of the machine hosting JuliuS. The .js extension is added automatically if the file is not found without it, making it optional to specify it in the call. Loading is asynchronous: the response arrives immediately, but the editor opens on the main thread shortly after.OKErrore, file non trovato [...]Load script from stream
OKErrore nello scritp โ missing body or read errorRead current script
frmScript editor. Reading happens directly from SynSynaScript.Text via TThread.Synchronize, so it also includes any manual edits made by the user in the editor after the initial load, not just the last value set via loadscript or readscritpfromstream. This is a pure read endpoint: it does not modify the editor state nor the current execution. Useful for checking what is about to be executed before a start, for a quick backup of the remote editor, or to compare the in-memory script with the file on disk.| Parameter | Required | Description |
|---|---|---|
| operation | โ | Must be getscript |
| Response Header | Value |
|---|---|
| Content-Type | text/plain; charset=utf-8 |
frmScript or error while readingRead current line
SynSynaScript editor in frmScript is currently positioned. This is exactly the line that would be used as the starting point by the next ?operation=start: script execution indeed starts from the current caret position in the editor. Useful for monitoring how far a script's execution has progressed, synchronizing external interfaces with the execution pointer, or checking the starting line before launching a start. Purely a read endpoint: it does not alter the editor state.| Parameter | Required | Description |
|---|---|---|
| operation | โ | Must be getcurrentline |
| Response Header | Value |
|---|---|
| Content-Type | text/plain; charset=utf-8 |
42)0 โ frmScript not initialized or read errorSet starting line
SynSynaScript editor to the given line (1-based), which becomes the starting line used by the next ?operation=start. The caret column is reset to 1. If the requested value exceeds the number of lines present in the script, a clamp is applied to the last available line. The operation is protected: if a script is already running, the call is rejected to avoid altering the current execution pointer. More flexible than reset cursor, which always moves the caret back to line 1.| Parameter | Required | Description |
|---|---|---|
| operation | โ | Must be setcurrentline |
| line | โ | Line number (integer โฅ 1, 1-based). Values beyond the maximum number of lines are clamped to the last available line. |
| Response Header | Value |
|---|---|
| Content-Type | text/plain; charset=utf-8 |
line_set_N โ confirmation with the line number actually set (may differ from the one requested if clamping was applied)ERROR: parametro line mancante o non numericoERROR: line deve essere >= 1ERROR: script in esecuzione, impossibile cambiare la linea correnteERROR: frmScript non inizializzato?operation=setcurrentline&line=N, then ?operation=start to start execution from the chosen line.Start execution
currentLine. Before calling this endpoint it is good practice to check the state with ?operation=status: if a process is already running, the call is rejected with an explicit message, avoiding concurrent executions. The excelLine and remoteVirtualPath parameters set the logging and screenshot upload context used by the script during execution.| Parameter | Required | Description |
|---|---|---|
| operation | โ | Must be start |
| currentLine | Line at which execution starts | |
| excelLine | Base name of the row in the Excel log, used to name screenshot files | |
| remoteVirtualPath | Remote virtual path for screenshot upload (_ is replaced with /). The trailing / is added automatically. |
startedAlready Running, check status before try to start another processScript is not already initiated โ no script form openStop execution
frmScript.stopExecution on the main thread. The operation correctly handles both the running and paused states, clearing both status flags. Any child popup window opened during execution is also closed. If no execution is in progress, the call is a silent no-op.Reset cursor
IsRunning = true), the call is silently ignored without returning errors, avoiding interference with the process in progress.IsRunning = true).Status
start to avoid multiple concurrent starts, and during execution to detect when a script has finished. The state accounts for both active script execution and page loading in the browser (MainBrowserFrm.FPageLoading): if the page is still loading, the system is reported as busy even if the script is technically paused.on working โ script running or page loadingno operation progress โ system idle, ready for a new startGet Result (fixed function)
preventivo() in the browser โ the result-extraction function used by convention in JuliuS scripts โ and returns its value serialized as TOperationResult JSON. The JSON includes the raw result, the operation ID, the start date, and the list of captured screenshots. Use this at the end of a quoting script to retrieve the computed value. For functions with a different name, use the variable Get Result endpoint.Get Result (variable function)
getresult: executes in the browser the JavaScript function whose name is passed as a parameter, automatically appending the parentheses (). Returns the value as TOperationResult JSON, exactly like the fixed endpoint. Use this endpoint when the script exposes extraction functions with custom names (e.g. getOrderTotal, calcolaPremio) instead of the standard preventivo() function. The function must already be defined in the browser's JS context at the time of the call.| Parameter | Description |
|---|---|
| getresult | Name of the JS function to execute, without parentheses. The () are added automatically. |
Click (CEF)
SCREEN_SIZE. For clicks on native Windows windows or system dialogs, use the OS Mouse endpoints instead, which act at the operating-system level.| Parameter | Description |
|---|---|
| X | X coordinate in pixels relative to the CEF panel |
| Y | Y coordinate in pixels relative to the CEF panel |
Snapshot (CEF)
scalefactor header indicates the monitor's DPI scale factor and should be used by the client to correctly interpret image dimensions in high-density display environments (HiDPI). This endpoint captures only the browser panel, not the entire JuliuS window nor the desktop. For a screenshot of the whole desktop, use osscreenshotjpg.| Response Header | Value |
|---|---|
| Content-Type | image/jpg |
| scalefactor | Monitor DPI factor (e.g. 1.25 for 125% displays) |
Restart Chromium
Clears the embedded Chromium session without restarting the application.
Via the DevTools Protocol it clears HTTP cache, cookies, localStorage,
sessionStorage and IndexedDB, then navigates to about:blank.
Responds only once the reset is complete.
Response
chromium_restarted โ reset completedERROR: ... โ error messageExample
Delete Chromium Cache
Performs a complete reset of the Chromium cache: clears HTTP cache,
cookies and storage via the DevTools Protocol, then physically deletes
the GlobalCEFApp.RootCache directory on disk.
Slower than restartchromium โ use it for a corrupted cache
or to guarantee a session indistinguishable from a cold start.
Comparison with restartchromium
| Action | restartchromium | deletechromiumcache |
|---|---|---|
| In-memory HTTP cache | โ | โ |
| In-memory cookies | โ | โ |
| LocalStorage / IndexedDB | โ | โ |
| Cache files on disk | โ | โ |
| Average time | ~3 s | ~5 s |
Response
chromium_cache_deleted โ cleanup completedERROR: ... โ error messageExample
Get DOM
document.documentElement.outerHTML. Useful for offline DOM analysis, debugging pages with dynamic rendering, or checking the current state of the page before performing interactions. Since it returns the live DOM (post-JavaScript, not the server's original source), it reflects the actual state of the page including changes made by scripts already executed.text/html; charset=utf-8ERROR: ... โ internal exceptionGet Form Fields
input, select, textarea and button. For each element, properties such as id, name, type, value and visible are included. Particularly useful while developing a script, to identify the IDs of elements to use in WRITETO commands without having to manually inspect the page source.application/json; charset=utf-8ERROR: ... โ internal exceptionGet Page Info
readyState and the list of iframes present with their URLs. This is the ideal endpoint to quickly check which page the browser is on, verify that loading is complete (readyState === "complete"), and identify the frame structure before using TARGET_FRAME in scripts.url, title, readyState, iframes list โ application/json; charset=utf-8ERROR: ... โ internal exceptionGet Console Log
console.log, console.warn and console.error messages accumulated so far. Essential for debugging SNIPPET blocks in scripts, which typically use console.log() to trace execution. Messages are accumulated in memory and returned on every call without being cleared, unless an explicit reset occurs.application/json; charset=utf-8ERROR: ... โ internal exceptionEvalJS (via API)
?operation=getresult, the result is not stored in the current TOperationResult but returned directly in the HTTP response. The expression must be URL-encoded. Useful for quick DOM queries or checking the state of JS variables without having to define a dedicated function in the script.text/plain; charset=utf-8ERROR: ... โ internal exception or JS errorFind Element
id, tagName, value, visible and boundingRect. Useful for implementing conditional logic in automation flows: checking that a button is present before clicking, waiting for a result element to appear, or detecting error messages on the page. The selector must be URL-encoded.application/json; charset=utf-8ERROR: ... โ internal exceptionGet Frame List
name, id, url, the isMain flag and the isFocused flag are provided. This is the reference endpoint to consult before using the TARGET_FRAME=POPUP directive in scripts, to identify exactly the name or URL of the target frame. Particularly useful with pages that open popups or use nested frames.name, id, url, isMain, isFocused{"error":"..."}Get Frame Source
frame parameter is omitted, the source of the main frame is returned. Useful for inspecting the content of third-party iframes, forms loaded in separate frames, or child popups opened during navigation.| Parameter | Required | Description |
|---|---|---|
| frame | Name of the target frame. If omitted โ main frame. |
text/html; charset=utf-8ERROR: ... โ frame not found or internal errorWait Page Load
WAITs in scripts, this endpoint adapts to the server's real timing: it returns the response as soon as the page is ready, reducing unnecessary wait time. The request runs on the HTTP thread without blocking the application's main thread. The default timeout is 15 seconds and can be increased for particularly slow pages.| Parameter | Default | Description |
|---|---|---|
| timeout | 15000 | Maximum wait timeout in milliseconds |
loaded โ page loaded successfully within the timeouttimeout โ the timeout expired before loading completedDevTools Protocol
params parameter accepts a URL-encoded JSON object with the specific parameters of the CDP command. Consult the official CDP documentation for the full list of available methods.| Parameter | Required | Description |
|---|---|---|
| devtools | โ | CDP method to execute (e.g. Network.enable, DOM.getDocument) |
| params | Command parameters as URL-encoded JSON |
{"error":"..."} โ invalid method or CDP errorStart Network Log
Network.enable via the Chrome DevTools Protocol to intercept all HTTP/HTTPS requests made by the browser: XHR, fetch, resource loading. Must be called before navigating to the page to monitor, so as not to miss the first requests. The collected data can then be retrieved with ?operation=getnetworklog. Useful for analyzing the APIs called by a web page or identifying endpoints to replicate.network log startedERROR: ... โ internal exceptionGet Network Log
startnetworklog. The log is a JSON array where each entry contains the HTTP method (method), the full URL (url) and the resource type (type, e.g. XHR, Fetch, Document). Calling this endpoint multiple times does not clear the log: the buffer grows until the next startnetworklog. Ideal for reverse-engineering a web page's APIs or checking the calls made during a script's execution.method, url, type for each request โ application/json; charset=utf-8{"error":"..."}OS Mouse โ Move
TCrossSO.SetMousePos). Unlike the CEF click endpoint, which acts inside the embedded browser, this endpoint controls the cursor at the OS level and can interact with any window visible on the desktop: native Windows dialogs, system popups, windows of other applications, or JuliuS's own interface. Use in combination with osmouseclick to perform precise clicks on native elements.movedERROR: ...OS Mouse โ Left click
TCrossSO.MouseLClick. Must be preceded by a call to osmousemove to correctly position the cursor. Acts at the operating-system level, so it works on any active window on the desktop, not just the CEF browser. For movement and click in a single atomic operation, use osmousemoveclick.clickedOS Mouse โ Move + Click
moved_and_clickedOS Mouse โ Right click
TCrossSO.MouseRClick. Useful for opening native operating-system context menus or Windows applications that do not expose their own elements via a web interface. Like the other OS mouse endpoints, it acts at the operating-system level and is not bound to the CEF browser.right_clickedOS Mouse โ Get position
{"x": N, "y": N}. Useful during automation development and debugging to calibrate the coordinates to use in the osmousemove and osmousemoveclick endpoints, or to check that the cursor is at the expected position before performing a click.{"x":320,"y":240} โ application/json; charset=utf-8{"error":"..."}OS Keyboard โ Key Press
WRITETO, which writes into the CEF browser, this endpoint acts at the OS level and can control any active window: native Windows dialogs, non-web forms, desktop applications. For common keys (ENTER, ESC, TAB), dedicated, more readable shortcuts are available; use this endpoint when you need a specific key not covered by the shortcuts.| Keycode | Key | Keycode | Key |
|---|---|---|---|
| 13 | ENTER | 27 | ESC |
| 9 | TAB | 32 | SPACE |
| 8 | BACKSPACE | 46 | DELETE |
| 37 | โ LEFT | 38 | โ UP |
| 39 | โ RIGHT | 40 | โ DOWN |
| 112โ123 | F1โF12 | 65โ90 | AโZ |
key_pressedOS Keyboard โ Common key shortcuts
oskeypress. Each endpoint performs exactly the same operation as the corresponding numeric keycode, but makes logs and automation sequences immediately understandable. Use these shortcuts whenever possible; fall back to oskeypress with a numeric keycode only for keys not covered by these aliases.| Operation | Key | Response |
|---|---|---|
| oskeyenter | ENTER (โต) | enter |
| oskeyesc | ESC | esc |
| oskeytab | TAB (โฅ) | tab |
| oskeybackspace | BACKSPACE (โซ) | backspace |
OS Keyboard โ Arrow Keys
dir parameter accepts the values up, down, left, right in lowercase; unrecognized values are silently ignored.| dir | Key |
|---|---|
| up | โ Arrow up |
| down | โ Arrow down |
| left | โ Arrow left |
| right | โ Arrow right |
arrow_down / arrow_up / etc.OS Keyboard โ Key Combo
keybd_event API. The combo parameter accepts the syntax modifier+key in lowercase, URL-encoded if necessary. The modifier can be ctrl, shift or alt; the key can be a single letter (aโz) or a special key by name. Available only on the Windows platform: on other platforms the endpoint responds with an explicit error message without raising exceptions.| Combo field | Accepted values |
|---|---|
| modifier | ctrl, shift, alt |
| key | Single letter (aโz), or: f4โf6, f10โf12, tab, enter, esc, del, home, end, pageup, pagedown |
combo_ctrl+c โ confirmation of the executed combinationERROR: formato combo non valido, usare modifier+keyERROR: tasto non riconosciuto [...]ERROR: oskeycombะพ not implemented on this platformOS Screenshot (PNG)
scalefactor header indicates the monitor's DPI factor. Use the osscreenshotjpg variant when file size takes priority over quality.| Response Header | Value |
|---|---|
| Content-Type | image/png |
| scalefactor | Monitor DPI factor |
ERROR: screenshot failedOS Screenshot (JPG)
| Response Header | Value |
|---|---|
| Content-Type | image/jpg |
| scalefactor | Monitor DPI factor |
ERROR: screenshot failedGet Browser Window Info
mainForm) and the CEF browser panel (browser), including absolute screen values (screenLeft, screenTop). The scaleFactor field indicates the monitor's DPI factor. This endpoint is essential for converting browser-relative coordinates into absolute screen coordinates to use with the OS mouse endpoints, so that automations work correctly regardless of where the JuliuS window is positioned on the desktop.JSON response structure
mainForm, browser and scaleFactor โ application/json; charset=utf-8{"error":"..."}browser.screenLeft and browser.screenTop, then add them to the browser-relative coordinates to get the absolute screen coordinates to pass to osmousemoveclick.Browser Move Click
snapshot and MOUSE_CLICK), internally delegating to ClickOnBrowserRelative the conversion into absolute screen coordinates. It is more reliable than osmousemoveclick with absolute coordinates because it works correctly regardless of the position of the JuliuS window on the desktop and the DPI scale factor, without the caller having to compute the conversion manually.| Parameter | Description |
|---|---|
| x | X coordinate in CSS pixels relative to the top-left corner of the browser panel |
| y | Y coordinate in CSS pixels relative to the top-left corner of the browser panel |
clicked_at_browser_320_240 โ confirmation with the coordinates usedERROR: ...?operation=click sends an internal synthetic CEF event. osmousemoveclick uses absolute screen coordinates. browsermoveclick uses browser-relative coordinates but acts at the OS level โ it is the sweet spot between ease of use and cross-position reliability.Rewrite Global Variables
GLOBALV block of the script currently loaded, overwriting the previous values. The content is loaded into frmScript.GlobalV via LoadFromStream and then updateGlobalV physically updates the lines of the GLOBALV=BEGIN/END block in the editor. Useful in orchestration systems to parameterize an already-loaded script with different data (e.g. different customer, different case) without reloading the entire file. The body must contain var name="value"; pairs in the GLOBALV block format.API Logging โ Overview
Every HTTP request received by the JuliuS server is automatically recorded as a JSON Lines row in the application's log file. Logging relies on the synaLog unit (global singleton thLog, asynchronous writing with a dedicated writer thread, automatic rotation at 100 MB, zip archiving of old logs with a 7-day retention). The log file is the same one used by the scripting engine (wLog), so API requests and script execution logs appear in the same chronological sequence.
Format of a log line
Fields present in each entry
| Field | Description |
|---|---|
| ts | Local ISO 8601 timestamp with milliseconds |
| tag | Always "API" โ distinguishes API rows from other system logs |
| reqId | 8-character ID (first 8 hex digits of a GUID) to correlate entry/exit of the same request |
| client | Caller's IP (AContext.Binding.PeerIP) |
| method | HTTP method (GET, POST) |
| uri | Requested URI (always / for JuliuS, parameters in the query string) |
| op | Identified operation: the value of ?operation= if present, otherwise inferred from loadscript, globalv, navigate, evaljs, getresult, findelement, devtools |
| durMs | Request duration in milliseconds (from receipt to response composition) |
| params | Object with all query string and form parameters |
| bodyBytes | (only if logBodies=true and there is a POST body) โ size of the body in bytes |
| bodyPreview | (only if logBodies=true) โ text preview of the body up to maxBodyPreview characters, or <REDACTED> for sensitive operations |
| response | Preview of the response truncated to maxBodyPreview characters, or <binary> if the content type is image/* |
Sensitive operations (masked if maskSensitive=true)
The body of the following operations is replaced with <REDACTED> to avoid writing credentials or personal data contained in global variables to disk, and to prevent the log from ballooning with large scripts:
POST /?operation=readscritpfromstreamโ body with script source (potentially MB in size)POST /?globalv=rewriteโ body with global variables (potentially credentials)
Configuration
The four toggles are in Settings.Data.ApiLog and can be changed at runtime via setapilog without restarting the server:
| Parameter | Type | Default | Description |
|---|---|---|---|
| Enabled | boolean | true | Master switch: if false, no request is logged |
| LogBodies | boolean | false | If true, includes bodyPreview and bodyBytes in entries |
| MaskSensitive | boolean | true | If true, redacts the bodies of sensitive operations even with LogBodies=true |
| MaxBodyPreview | integer | 500 | Maximum characters for bodyPreview and response |
jq, grep, and import into Splunk/ELK. Quick example to filter errors:grep '"response":"ERROR' app.log | jq -r '[.ts,.op,.response] | @tsv'Log status
| Response Header | Value |
|---|---|
| Content-Type | application/json; charset=utf-8 |
Response structure
Hot toggle
| Parameter | Values | Description |
|---|---|---|
| enabled | true / false / 1 / 0 | Master switch of the log |
| logbodies | true / false | Logs POST body and response |
| masksensitive | true / false | Redacts the bodies of sensitive operations |
| maxpreview | integer > 0 | Maximum characters in previews |
Examples
uSettings.pas โ TApiLogSettings.Initialize.Read last lines
thLog writer thread, then reads the log file and returns the last N lines in the response body as plain UTF-8 text. The default is 200 lines, the maximum limit is 5000. Useful for remote debugging without needing access to the filesystem of the machine running JuliuS, or for integration with monitoring dashboards.| Parameter | Default | Description |
|---|---|---|
| lines | 200 | Number of final lines to return. Values < 1 โ 1, values > 5000 โ 5000. |
| Response Header | Value |
|---|---|
| Content-Type | text/plain; charset=utf-8 |
ERROR: thLog non attivo โ the global logger is not initializedERROR: ... โ file exclusively locked by the writer or I/O errorFlush to disk
thLog.FlushLog to immediately write to disk all rows still buffered in the synaLog writer thread. Under normal conditions the writer flushes automatically every 200 rows (if FdoFlush=true) or when the thread stops; this endpoint is useful when you want to guarantee that the file on disk contains everything up to that point, for example before copying it off for analysis.flushedERROR: thLog non attivoERROR: ... โ exception during flushForce rotation
thLog.RequestRotate to trigger manual rotation of the file: thLog closes the current file, renames it with a unique name and zips it in the background via txtUtils.ZipAndDeleteAsync, then opens a fresh, clean file. The operation is asynchronous: the rotation flag is set and processed by the thLog Execute thread on the next iteration, typically within a second. Regardless of this call, automatic size-based rotation (default 100 MB, checked every 30 seconds) remains always active.rotate_requested โ flag set, the writer thread will perform the rotationERROR: thLog non attivorotateapilog to begin with a fresh file, run the tests, then flushapilog and collect the "clean" log file that contains only that session.