Skip to content

Templates

Get all Templates

GET /api/templates

Returns all the Templates that are currently available in your Erizos Studio environment.

Response

The response is an array of Templates

Supports the list query parameters. GET /api/templates/info returns { "count": n } for the same filter.

Get Template by ID

GET /api/templates/[ID]

Returns the template that corresponds to the template ID.

Request

Parameter Type Description
ID Uuid id of the Template

Response

Template Object

Look up a Template by path

Put the literal BROWSE in place of the id and give the template's path as a query parameter.

GET /api/templates/BROWSE?path=Vizrt/myTemplate&system=VIZRT

Parameter Type Description
path String (query) The template path, as stored on the template
system String (query) Optional. A System enum value, to disambiguate the same path on two systems

An unknown template answers 404 with {"error": "Invalid Template 'BROWSE'"}.

Add a Template

POST /api/templates

Adds, or re-imports, a template into a show. A template is identified by the combination of show, system and path: if one already exists with those three values it is updated rather than duplicated.

Request Body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "show": "5d9f3427238f9f0e53b030f2",
    "system": "SINGULAR",
    "path": "Singular/myTemplate",
    "name": "MyTemplate",
    "mode": "TEMPLATE",
    "model": {
        "system": {},
        "fields": []
    }
}

Response

The added Template object.

Update Template

PUT /api/templates

Update a template (on all shows)

Request

The body must include _id. Without it the request fails with 500 and {"error": "Invalid Template Object"}. With it, the request is redirected (307) to PUT /api/templates/[ID], so the two forms are equivalent.

Request Body

1
2
3
4
5
6
{
    "_id": "5df89437071dca32b3b533d4",
    "system": "SINGULAR",
    "mode": "TEMPLATE"
    ....
}

Note

The template definition - model, aspect, mode and the rest - is propagated to every template that has the same system and path, across all shows. The per-show properties are not overwritten: hidden and channel on the template, and hidden and channel on each layer, keep the value they already had in each show.

Update only a Template's Fields

PUT /api/templates/[ID]/fields

Updates one template without propagating anything to the other shows. Use it to change the fields of a single template.

Request

Parameter Type Description
ID Uuid id of the Template

Set a Template or Layer Property

POST /api/templates/[ID]/property

Sets one or more properties on a template, or on a single layer of a LAYERS template. The body is an object of the properties to set, for example hidden, channel or color.

Request

Parameter Type Description
ID String The template Uuid, or [TEMPLATE ID]\|[LAYER ID] to set the property on one layer. URL-encode the \| as %7C

Request Body

1
2
3
{
    "hidden": true
}

Response

The updated Template object. If the id names a layer of a template that is not in LAYERS mode, or a layer that does not exist, the template is returned unchanged.

Hide or show many Templates at once

POST /api/templates/batch/hidden

1
2
3
4
5
6
7
{
    "ids": [
        "5df89437071dca32b3b533d4",
        "5df89437071dca32b3b533d5"
    ],
    "hidden": true
}

Copy a Template to another Show

POST /api/templates/[ID]/copy

Copies the template into another show, together with its stored thumbnails.

Request

Parameter Type Description
ID Uuid id of the Template to copy

Request Body

1
2
3
{
    "show": "5d9f3427238f9f0e53b030f2"
}

Response

The new Template. If the target show already has a template with the same system and path, that existing template is returned and nothing is copied. An invalid show id fails with Invalid show id '<id>'.

POST /api/templates/relink

Re-points every template at one path and system to another path and system, and moves the matching UI mappings with them. Use it after a scene has been renamed or moved in the render engine.

Request Body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "from": {
        "path": "Vizrt/oldName",
        "system": "VIZRT"
    },
    "to": {
        "path": "Vizrt/newName",
        "system": "VIZRT"
    }
}

All four values are required; leaving one out fails with Missing relink information.

Combine Templates

POST /api/templates/combine

Creates a COMBO template out of two or more existing templates, so that they are taken on air together.

Request Body

1
2
3
4
5
6
7
{
    "name": "My Combo",
    "templates": [
        "5df89437071dca32b3b533d4",
        "5df89437071dca32b3b533d5"
    ]
}

A combo needs at least two templates; with fewer the request fails with Failed to crete a combo template. To address a single layer of a LAYERS template, append ?[LAYER ID] to its id.

Use PUT /api/templates/combo/update to change an existing combo.

Delete Template by ID

DELETE /api/templates/[ID]

Deletes the template that corresponds to the template ID.

Request

Parameter Type Description
ID Uuid id of the Template

Warning

Deleting a template also deletes its stored files and thumbnails, its field bindings, and every page created from it.

Get Template Thumbnail

GET /api/templates/[TEMPLATE ID]/thumbnail

Returns the thumbnail that corresponds to the template ID.

Request

Parameter Type Description
TEMPLATE ID Uuid id of the Template

Response

The thumbnail image as image/png. If no thumbnail has been stored for the template the response is 404.

Get Layer Thumbnail

GET /api/templates/[TEMPLATE ID]|[LAYER ID]/thumbnail

Returns the thumbnail that corresponds to one layer of a template. Layers are sub templates used in render engines such as Unreal Engine and Singular.live

Request

Parameter Type Description
TEMPLATE ID Uuid id of the Template the layer belongs to
LAYER ID String The id of the layer field inside the template's model.fields. It is a plain string chosen by the template, not a Uuid

The two parts are separated by a pipe, which must be URL-encoded as %7C:

/api/templates/5df89437071dca32b3b533d4%7CMAIN_LAYER/thumbnail

Response

The thumbnail image as image/png, or 404 when the layer has no stored thumbnail.

Get All Templates of Show

See the Show API request Get Templates of Show