Support for

TCAPI: Populating or customizing a template

John Valentine
by John Valentine 5 years ago
 

This information is based on content from our developer website.

Embedding the TemplateCloud Editor

To embed the Flash editor on your site simple copy-paste the code below and fill all “{}” blocks accordingly. [download jquery.flash.js]

HTML/JavaScript
<!-- Start Editor -->
<script type="text/javascript" src="/js/jquery.flash.js"></script>
<script type="text/javascript">
$(document)
    .ready(function () {
    $('#example')
        .flash({
        src: 'http://www.templatecloud.com/templates_frontend/PDCRobot.swf?1325859802',
        id: 'PDCRobot',
        width: 940,
        height: 800,
        quality: 'high',
        bgcolor: '#0000ff',
        allowscriptaccess: 'always',
        allownetworking: 'all',
        allowfullscreen: 'true',
        wmode: 'transparent',
        base: 'templates_frontend',
        flashvars: {
            autoParams: 'friendlynames=true',
            baseURL: 'http://www.templatecloud.com/api/',
            continueURL: '{your_continue_url}',
            cancelURL: '{your_cancel_url}',
            redirectURL: '{your_redirect_url}',
            templateid: '{template_id}',
            instanceid: '{instance_id}',
            customerid: '{your_customer_id}',
            locale: 'tc_GB',
            bleed: '1.5000',
            extraParam: '&asset_key=*******',
            activeButtonColor1: '0xc8d756',
            activeButtonColor2: '0xc8d756',
            fotoliaSearchTerm: 'business'
        }
    }, {
        version: 8
    });
});
</script>
<div id="example"></div>
<!-- EOF Editor -->
flashvars{ Parameter } Value, Description
Required
autoParams

'friendlynames=true'

When true, we show friendly names like "Your Business Name" instead of our active field placeholders like {{business_name}}

baseURL

The API server address.

  • 'http://www.templatecloud.com/api/' for live
  • 'http://dev.templatecloud.com/api/' for development (see “For development purposes…” below this table)
continueURL
cancelURL
redirectURL
Where the website sends users after they leave the editor:
  • Continue will accept the edits and continue to refine or complete the order (perhaps to select a product).
  • Cancel will be used if a user quits the editor. This will usually be a step backwards, e.g. to select another template, or re-view the existing template.
  • Redirect is invoked when there is a fatal error (e.g. bad parameters). 
templateid The ID of the template that is being loaded into the editor.
instanceid The ID of the template instance that is being loaded into the editor.
customerid Your own customer ID, assigned to you by the TemplateCloud team. (not an ID for your customer)
locale

Selects a language for notifications and display.

Allowed values: 'en', 'fr', 'nl', 'de', 'pt', 'it', 'es', 'se'

bleed Templates for our production have 1.5 bleed; your SupplieReady products might have a different value.
extraParam: asset_key = hex(SHA1(concat( <your editor_key>, <instanceid> )))
activeButtonColor1
Primary button colour (for the most important actions)

RGB hex (C format), e.g. '0xc8d756'

activeButtonColor2

Secondary button colour.

RGB hex (C format), e.g. '0xa88080'

allowFotoliaImages When false, the editor does not offer library images to replace existing images. (JS Boolean, default: true)
fotoliaSearchTerm The term searched for when the Fotolia editor appears.
Image chooser - paging
userImagesPagingRequired 'true' These help preserve client-side memory by loading user images in groups as required. E.g. If the first item is set to 'true', then the editor will load 10 images initially and load images in blocks of 5, as the user scrolls.
defaultNumberOfImages 10
numberOfImagesToAdd 5

For development purposes please use the following values for variables:

src

'http://dev.templatecloud.com/templates_frontend/PDCRobot.swf?1325859802'

baseURL

'http://dev.templatecloud.com/api/'

templateid

10014

Please use this ID for testing purposes; only a limited number are activated on the DEV server.

instanceid 

436738

This is generated using the method "Create Instance", see https://developer.templatecloud.com/docs#/instances 

customerid

'TCDEMO'

asset_key Hexadedimal representation of SHA1 hash of concat('bf6b7bb900dcb665497362cbce0a9e90', instanceid).

ExtraParam: asset_key

It’s worth explaining how to obtain a value for asset_key, in more detail.

  1. First join the instanceid to the API key,
    e.g. if instanceid=356 and the API key is ba386e729c5f6870cea89f38e92d7a5c,
    then the concatenated string will be ba386e729c5f6870cea89f38e92d7a5c356.

  2. then obtain the SHA1 hash of the result

  3. and then convert that hash to a hexadecimal string.

 

Jump to contents page of

TemplateCloud API Guide

 
 
 

All content is (c) Grafenia Operations Limited, 2020 and may not be used, copied or distributed without permission.