Objects

Connect to script output stream (WebSocket)

WebSocket endpoint for running an ad-hoc script and receiving its output. The token is obtained from POST /v1/objects/{object-id}/execute-script or POST /v1/execute-script with stream=true. Token is single-use and expires after 30 seconds. Script execution starts when the connection is established.

Server sends JSON text frames:

  • {"type":"output","data":"..."} - output chunk
  • {"type":"result","data":...} - script return value, formatted the same way as result in synchronous mode (honors resultAsMap)
  • {"type":"completed"} - execution finished successfully (always follows result)
  • {"type":"stopped"} - execution was stopped on request
  • {"type":"error","message":"...","diagnostic":{...}} - execution failed; diagnostic holds NXSL error details

Server closes the connection after completed, stopped or error message.

Client can send JSON text frames:

  • {"type":"stop"} - stop script execution

Closing the connection by the client stops the script.

get/v1/script-executions/output/{token}

Path parameters

tokenstring uuid required

Single-use token from the streaming execute-script response

Changes

Changed in 1 of the 128 revisions of this API.1