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 | |
| 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 | |
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 | |
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 | |
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 | |
Restart the App
Restarts the App
POST /api/restart
*Requires Admin rights
The response is sent before the server restarts.
Response
1 2 3 | |
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 | |
| 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 | |
| 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 }.