Skip to content

GPIO

Trigger GPIO Output

POST /api/gpio/:device/outputs/:output/write

Set the value of a GPIO output port.

Parameter Type Description
:device String or Number (required) The 0-based index, or the name as configured in Settings → GPIO, of the GPIO device. It is a mandatory part of the URL.
:output Number The output port number to control.

Request Body

1
2
3
{
  "value": true
}

Parameter Type Description
value Boolean The value to set the output.

Response

On success the response is {}. If no device matches the index or name, the response is 500:

1
2
3
4
{
    "status": "ERROR",
    "error": "Failed to find GPIO device 2"
}

Simulate GPIO Input Trigger

POST /api/gpio/:device/inputs/:input/simulate

Simulate a trigger on an input port.

Parameter Type Description
:device String or Number (required) The 0-based index, or the name as configured in Settings → GPIO, of the GPIO device.
:input Number The input port number to simulate a trigger on.

Response

{} on success, or 500 Failed to find GPIO device X when the device cannot be found.

Event Listeners (for input triggers)

Note

This is the UI Builder script API for the Gpio object, not a REST interface.

You can use these methods to listen and react to GPIO events:

  • .on('trigger', e => {}) - Add a listener for input triggers.
  • .once('trigger', e => {}) - Add a one-time listener.
  • .off('trigger', e => {}) - Remove a listener.
  • .simulate(InputNumber) - Simulate an input trigger.
  • .write(OutputNumber, Boolean) - Write a value to an output port.

Get Info of the Erizos Server

GET /api/info

Returns all the information regarding the Erizos Server.

This route is public: it can be called without authentication.

Response

The response is the information of the Studio Server. mode is SERVER when Studio runs as a server, and LOCAL when it runs standalone. service and tag come from the general settings.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
    "info": {
        "shortName": "Studio Server",
        "longName": "Erizos Studio Server",
        "version": "0.0.0.13778",
        "buildDate": "2024-03-11T07:57:50.873Z",
        "startTime": "2024-03-15 01:23:34",
        "license": {
            "expiry": "2025-07-31",
            "features": {}
        },
        "session": "246bc8c57fde089d57a57c8dcaf715d8",
        "mode": "SERVER"
    }
}

Get Settings of Erizos Server

GET /api/settings

Returns all the information regarding the Erizos Server settings

Note

A user without Admin rights receives the same object with systems.vizrt.gh.password removed.

Response

The response is the information of the Studio Server Settings

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
    "log": {
        "level": "VERBOSE",
        "daysToKeep": 30
    },
    "redundancy": {
        "enabled": false,
        "replica": "",
        "machines": []
    },
    "general": {
        "name": "",
        "address": ""
    },
    "systems": {
        "ue": {
            "enabled": true,
            "source": "FOLDER",
            "creativehub": {
                "server": "DESKTOP-CVIC5J6",
                "username": "admin",
                "password": "ENC:7fab6adc9420ff1dddb8f7476859"
            },
            "root": "D:\\My\\Project\\Directory",
            "runInEditor": false,
            "livePreview": true,
            "routeCommands": true
        }
        ...
    ...
}
}

Update Settings of Erizos Server

POST /api/settings

Updates the Studio Server settings. The body is a partial settings object; the values it carries are merged into the stored settings.

*Requires Admin rights

Get all Servers

GET /api/servers

Returns all the Erizos Servers found in the network.

Request

Parameter Type Description
app String (query) Only return servers of this app, for example agent
timeout Number (query) How long to listen for answers, in milliseconds. Default 3000. The request blocks for this long before answering

Response

The response is an array of Servers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
[
    {
        "app": "Agent",
        "hostname": "DESKTOP-CVIC5J6",
        "name": "DESKTOP-CVIC5J6 - Agent",
        "port": 5510,
        "addresses": [
            "192.168.56.1",
            "172.22.158.135",
            "192.168.1.194"
        ]
    },
    {
        "app": "Studio Server",
        "hostname": "DESKTOP-CVIC5J6",
        "name": "DESKTOP-CVIC5J6 - Studio Server",
        "port": 5550,
        "addresses": [
            "192.168.56.1",
            "172.22.158.135",
            "192.168.1.194"
        ]
    }
]

Restart the App

Restarts the App

POST /api/restart

*Requires Admin rights

The response is sent before the server restarts.

Response

1
2
3
{
    "message": "Restarting"
}

Folders

Shows, profiles and engines are all organised into the same tree of folder paths.

Get all Folder Paths

GET /api/paths

Returns every folder path currently in use by a show, a profile or an engine.

Rename a Folder

POST /api/paths/rename

Renames a folder across shows, profiles, engines and the permission sets of users and user roles, so that everything under it keeps working.

Request Body

1
2
3
4
{
    "source": "/NY",
    "target": "/New York"
}
Parameter Type Description
source String The folder path to rename
target String The new folder path

The caller needs access to both the source and the target folder.

Browse the Server's File System

GET /api/files

Lists the contents of a folder as the Studio Server sees it. Used by the file pickers in Studio.

Parameter Type Description
path String (query) The folder to list. Leave empty to list the roots
onlyDirs Boolean (query) Only return folders. Default true
extensions String (query) Comma-separated list of file extensions to keep

Get the Script Libraries

GET /api/resources/libs

Returns the names of the JavaScript libraries available to UI Builder scripts, taken from the Resources/Libs folder of the Studio Server data directory.

This route is public: it can be called without authentication.

Installers

GET /api/installers
GET /api/installers/[NAME]

The first returns the list of installers bundled with the Studio Server; the second downloads one of them as an attachment.

Both routes are public: they can be called without authentication.

Get all UI Mappings

GET /api/uimappings

Returns all the UI Mappings. A UI Mapping binds a User Interface to a template, a layer or a show.

Response

The response is an array of UI Mapping

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[
    {
        "_id": "65e884f19d3c19dde220c2db",
        "ui": "65e884e89d3c19dde220c2d2",
        "key": "65e70de4e26a8da333766cf7",
        "show": "65e70de4e26a8da333766cf7",
        "disabled": false,
        "createdAt": "2024-03-06T15:00:01.038Z",
        "updatedAt": "2024-03-11T13:52:37.463Z",
        "__v": 0,
        "_type": "UIMAPPING"
    }
]
Parameter Value Description
_id Uuid The id of the mapping
ui Uuid The id of the User Interface to open
key String What the mapping is keyed on. For a template mapping it is [SYSTEM]*[PATH]*[LAYER]; for a show mapping it is the show id
path String The template path the mapping applies to
system System The system the mapping applies to
layer String The layer the mapping applies to
show Uuid The show the mapping applies to
disabled Boolean When set, the mapping is not used

POST /api/uimappings, PUT /api/uimappings/[ID] and DELETE /api/uimappings/[ID] create, update and delete a mapping; GET /api/uimappings/info returns { "count": n }.