Managing custom static templates

Manage your template file registration.

Before you begin

Manage template file registration

Register a template file

curl -X POST 'https://<tenant>/template/v1.0/branding/registration/<type>' --header 'Authorization: Bearer <access_token>' -F 'file=@"<file>"'

This command registers a template file. The table below provides the allowed file types.

Allowed types Allowed file extensions Maximum number of files per type Maximum size per file
js .js 15 300 KB
css .css 15 100 KB
icon .ico,.png, and .svg 30 100 KB
image .png, .jpg, .jpeg, .gif, .svg, and .webp 15 500 KB
font .woff, .woff2, .ttf, .otf, and .eot 15 500 KB

Get all template files on a type

curl -X GET 'https://<tenant>/template/v1.0/branding/registration/<type>' -H 'Authorization: Bearer <access_token>'

This command lists all of the files that are registered on the specific file type.

Delete a template file

curl -X DELETE 'https://<tenant>/template/v1.0/branding/registration/<type>/<file_name>' --header 'Authorization: Bearer <access_token>'

This command deletes an existing file.

Delete all template files on a type

curl -X DELETE 'https://<tenant>/template/v1.0/branding/registration/<type>' --header 'Authorization: Bearer <access_token>'

This command deletes all of the files that are registered on the specific file type.

Customize a template file

You can update a template file after it is registered. To modify an existing template file, refer to the following pages:
Note: If the webpage references the file through the /template/v1.0/static API path after updating it, the changes might not appear immediately. Clear your browser cache, and allow up to 5 minutes for the update to propagate.

Using a registered file in HTML

For a .js file, register the <js-filename> file, and add it in the HTML page:

<script type="text/javascript" src="/template/v1.0/static/js/<js-filename>?themeId=@THEME_ID@"></script>

For an image file, register the <image-filename> file, and add it in the HTML page:

<img src="/template/v1.0/static/assets/image/<image-filename>?themeId=@THEME_ID@">

For an icon file, register the <icon-filename> file, and add it in the HTML page:

<link rel="icon" href="/template/v1.0/static/assets/icon/<icon-filename>?themeId=@THEME_ID@">

For a .css file, register the <css-filename> file, and add it in the HTML page:

<link rel="stylesheet" href="/template/v1.0/static/assets/css/<css-filename>?themeId=@THEME_ID@">

For a font file, include it into the .css file <css-filename>:

@font-face {   
    font-family: '<font-family>';   
    src: url('/template/v1.0/static/assets/fonts/<font-filename>?themeId=@THEME_ID@') format('<font-format>')
}


.custom-text {   
    font-family: '<font-family>'
}  

After registering the font file <font-filename> and the .css file <css-filename>, add it in the HTML page:

<link rel="stylesheet" href="/template/v1.0/static/assets/css/<css-filename>?themeId=@THEME_ID@" />
Note: @THEME_ID@ is a macro representing the theme ID. It is replaced with the actual themeId at runtime.