Add a document template
Audience:
•
Version: 10
Some tooltip text!
• 1 minute to read
• 1 minute to read
var item = {}
item.Name = "Created by unit test";
item.Filename = "footemplate.txt";
item.Tooltip = "Unit Tests FTW";
item.SaveInDb = 1;
item.LoadTemplateFromPlugin = 0;
item = Post("api/v1/List/DocumentTemplate", item)
At this point, the document template record has been created, but there is no content for the document template. We need to upload some document content to the new record:
var id = item.DocumentTemplateId;
content = "Hello {name}.";
Put("api/v1/List/DocumentTemplate/" + id + "/content", content)
Note
The examples are given in JavaScripty pseudocode.