Templates

See Templates for working copy vs publish, schema, and workflow. Get the museum id from listMuseums first.

listTemplates

List every template of a museum. Optionally filter by type (the type string from getTemplateSchema).

ArgumentTypeRequiredDescription
museumIdstringYesMuseum id from listMuseums
typestringNoTemplate type string from getTemplateSchema

getTemplate

Get one template and its working copy (the draft tree of nodes). Look this up before you change anything.

ArgumentTypeRequiredDescription
idstringYesTemplate id

createTemplate

Create a new empty template. Pass museumId and a type from getTemplateSchema. Starts as a working copy; it does not go live until someone publishes in the product.

ArgumentTypeRequiredDescription
museumIdstringYesMuseum id
typestringYesTemplate type string from getTemplateSchema
namestringNoName of the template

renameTemplate

Change the name of a template. Does not change the working copy.

ArgumentTypeRequiredDescription
idstringYesTemplate id
namestringYesNew name

deleteTemplate

Remove a template. Guests keep seeing the last published version until a replacement is published.

ArgumentTypeRequiredDescription
idstringYesTemplate id

insertTemplateNodes

Insert one or many nodes in a single change. Use this for a whole block. Open getTemplateSchema first so you use allowed types and props. LAYER and other groups may include children.

ArgumentTypeRequiredDescription
templateIdstringYesTemplate id
nodesarrayYesList of nodes to insert. Each needs a type. Groups may include children. TEXT may include text and language.
parentIdstringNoParent node id. Omit or pass null to insert at the root.
indexintegerNoPosition among siblings. Omit to append.

Returns the working copy plus insertedNodeIds.

updateTemplateNode

Change one node. Only the fields you pass change. Use props for node props, styles for style keys, text for translations, name, or hide.

ArgumentTypeRequiredDescription
templateIdstringYesTemplate id
nodeIdstringYesNode id
propsobjectNoObject of prop keys to set. Pass null on a key to clear it.
stylesobjectNoObject of style keys to set on the node definition.
elementStylesarrayNoList of { element, propertyName, propertyValue, stylesKey } for checkout and rich text.
textstringNoText for a TEXT node
languagestringNoLanguage for text. Defaults to en.
namestringNoDisplay name in the tree
hidebooleanNoHide or show the node

removeTemplateNode

Remove one node, including its children.

ArgumentTypeRequiredDescription
templateIdstringYesTemplate id
nodeIdstringYesNode id

moveTemplateNode

Move one node next to or inside another. placement is INSIDE, ABOVE, or BELOW.

ArgumentTypeRequiredDescription
templateIdstringYesTemplate id
nodeIdstringYesNode to move
targetIdstringYesNode to move relative to
placementstringYesINSIDE, ABOVE, or BELOW

setTemplateOption

Change a template-level option (subject, background color, pass images, content roots, default styles, app intro). Path names come from getTemplateSchema. For an email subject, pass language too.

ArgumentTypeRequiredDescription
templateIdstringYesTemplate id
pathstringYesOption path from getTemplateSchema, for example subject or backgroundColor or contentRoots
valueanyNoNew value. Omit or pass null to clear.
languagestringNoLanguage when path is subject

getTemplateSchema

Node types, props, styles, and options for templates. Pass a type for one kind, or a category (email, print, wallet, seating, thermal, mobile, website, checkout). With neither, lists kinds.

ArgumentTypeRequiredDescription
typestringNoTemplate type string, for example from listTemplates
categorystringNoemail, print, wallet, seating, thermal, mobile, website, or checkout

getTemplateAssignments

See which default emails, PDFs, passes, thermal slips, and checkout styling a museum uses. Read-only.

ArgumentTypeRequiredDescription
museumIdstringYesMuseum id
Previous
Levels, Entries, Capacities
Next
Content, Fonts, Photos