{ "scripts": [ { "id": 2, "lang": "lua", "name": "new_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" }, { "id": 3, "lang": "lua", "name": "good_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" }, { "id": 4, "lang": "lua", "name": "bad_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" } ]}
Scripts
List scripts
Copy
Ask AI
GET /api/v1/scripts/{id}
This endpoint is used to get a script by its ID. If the ID is -1, it returns all scripts.
{ "scripts": [ { "id": 2, "lang": "lua", "name": "new_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" }, { "id": 3, "lang": "lua", "name": "good_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" }, { "id": 4, "lang": "lua", "name": "bad_script", "source": "\n-- This is a sample script\n-- Fill in the onRecord function to transform the incoming record\nlocal json = require \"json\"\n\nfunction onRecord(r)\n return json.encode(r.row)\nend" } ]}