You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -700,6 +818,57 @@ setReplace(replace) | The replacement value. The replacement can be any valid JS
700
818
701
819
---
702
820
821
+
## Template Schemas
822
+
823
+
The following schemas specify how to use templates to store and render templates. A template lets you save an
824
+
[Edit](#edit) that can be rendered by its template ID and optionally include merge fields that are merged with the
825
+
template when rendered.
826
+
827
+
### Template
828
+
829
+
A template is a saved [Edit](#edit) than can be loaded and re-used.
830
+
831
+
#### Example:
832
+
833
+
```javascript
834
+
constShotstack=require('shotstack-sdk');
835
+
836
+
consttemplate=newShotstack.Template;
837
+
template
838
+
.setName('My Template')
839
+
.setTemplate(edit);
840
+
```
841
+
842
+
#### Methods:
843
+
844
+
Method | Description | Required
845
+
:--- | :--- | :---:
846
+
setName(string name) | The template name. | Y
847
+
setTemplate([Shotstack.Edit](#edit) edit)) | An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format. | Y
848
+
849
+
### TemplateRender
850
+
851
+
Configure the id and optional merge fields to render a template by id.
852
+
853
+
#### Example:
854
+
855
+
```javascript
856
+
constShotstack=require('shotstack-sdk');
857
+
858
+
consttemplate=newShotstack.TemplateRender;
859
+
template
860
+
.setId('21e781c0-8232-4418-fec1-cc99f0280c21')
861
+
.setMerge(merge);
862
+
```
863
+
864
+
#### Methods:
865
+
866
+
Method | Description | Required
867
+
:--- | :--- | :---:
868
+
setId(string id) | The id of the template to render in UUID format. | Y
869
+
setMerge([Shotstack.MergeField[]](#mergefield) mergeField) | An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. | -
870
+
871
+
---
703
872
## Output Schemas
704
873
705
874
The following schemas specify the output format and settings.
@@ -1029,6 +1198,98 @@ getData(): [Shotstack.Edit](#edit) | The timeline and output data to be rendered
1029
1198
getCreated(): string | The time the render task was initially queued. | Y
1030
1199
getUpdated(): string | The time the render status was last updated. | Y
1031
1200
1201
+
---
1202
+
1203
+
## Template Response Schemas
1204
+
1205
+
The following schemas are returned by the templates endpoint, including create, update and rendering a template.
1206
+
1207
+
### TemplateResponse
1208
+
1209
+
The response received after a [template](#create-template) is submitted. The template is saved and a unique
1210
+
template id is returned.
1211
+
1212
+
#### Methods:
1213
+
1214
+
Method | Description | Required
1215
+
:--- | :--- | :---:
1216
+
getSuccess(): bool | `true` if successfully queued, else `false`. | Y
1217
+
getMessage(): string | `Created`, `Bad Request` or an error message. | Y
1218
+
getResponse(): [Shotstack.TemplateResponseData](#templateresponsedata) | `TemplateResponseData` or an error message. | Y
1219
+
1220
+
### TemplateResponseData
1221
+
1222
+
The response data returned with the [Shotstack.TemplateResponse](#templateresponse).
1223
+
1224
+
#### Methods:
1225
+
1226
+
Method | Description | Required
1227
+
:--- | :--- | :---:
1228
+
getMessage(): string | Success response message or error details. | Y
1229
+
getId(): string | The unique id of the template in UUID format. | Y
1230
+
1231
+
### TemplateDataResponse
1232
+
1233
+
The template data including the template name and [Edit](#edit).
1234
+
1235
+
#### Methods:
1236
+
1237
+
Method | Description | Required
1238
+
:--- | :--- | :---:
1239
+
getSuccess(): bool | `true` if successfully queued, else `false`. | Y
1240
+
getMessage(): string | `Created`, `Bad Request` or an error message. | Y
1241
+
getResponse(): [Shotstack.TemplateDataResponseData](#templatedataresponsedata) | `TemplateDataResponseData` or an error message. | Y
1242
+
1243
+
### TemplateDataResponseData
1244
+
1245
+
The response data returned with the [TemplateDataResponse](#templatedataresponse).
1246
+
1247
+
#### Methods:
1248
+
1249
+
Method | Description | Required
1250
+
:--- | :--- | :---:
1251
+
getId(): string | The unique id of the template in UUID format. | Y
1252
+
getName(): string | The template name. | Y
1253
+
getOwner(): string | The owner id of the templates. | Y
1254
+
getTemplate(): [Shotstack.Edit](#edit) | `Edit` or an error message. | Y
1255
+
1256
+
### TemplateListResponse
1257
+
1258
+
A list of previously saved templates.
1259
+
1260
+
#### Methods:
1261
+
1262
+
Method | Description | Required
1263
+
:--- | :--- | :---:
1264
+
getSuccess(): bool | `true` if successfully queued, else `false`. | Y
1265
+
getMessage(): string | `Created`, `Bad Request` or an error message. | Y
1266
+
getResponse(): [Shotstack.TemplateListResponseData](#templatelistresponsedata) | `TemplateListResponseData` or an error message. | Y
1267
+
1268
+
### TemplateListResponseData
1269
+
1270
+
The response data returned with the [TemplateListResponse](#templatelistresponse).
1271
+
1272
+
#### Methods:
1273
+
1274
+
Method | Description | Required
1275
+
:--- | :--- | :---:
1276
+
getOwner(): bool | The owner id of the templates. | Y
1277
+
getTemplates(): [[Shotstack.TemplateListResponseItem]](#templatelistresponseitem) | The list of templates. | Y
1278
+
1279
+
### TemplateListResponseItem
1280
+
1281
+
The individual template item returned with the [TemplateListResponseData](#templatelistresponsedata) templates
1282
+
list.
1283
+
1284
+
#### Methods:
1285
+
1286
+
Method | Description | Required
1287
+
:--- | :--- | :---:
1288
+
getId(): string | The unique id of the template in UUID format. | Y
1289
+
getName(): string | The template name | Y
1290
+
getCreated(): string | The time the template was created. | -
1291
+
getUpdated(): string | The time the template was last updated. | -
0 commit comments