Support for

TCAPI: Mapping your products

John Valentine
by John Valentine 10 years ago
 

TemplateCloud templates are designed for an item of known size. It is expected that you have a list of products, each product having a size that can be matched to the templates in TemplateCloud.

So that you can present appropriate templates to your customers, you should select only the /template_sizes/ that have sizes corresponding to your products, i.e. matching template_size.width, template_size.height, and template_size.bleed.

TemplateCloud contains templates in landscape and portrait orientations, so there might be additional matches when height and width are swapped, or compare [min(h,w), max(h,w)] of template size and your product.

One approach would be to create a table defined like this:

Column Description
template_size_id ID from /template_sizes/, also used in template.size.
myProduct Your own product code.

With example data like this:

template_size_id myProduct
A4 StatPremA4
13rd StatPremCompl
A4 DistroLeafA4

Query your table to retrieve all template_size_id values, and feed them into the sizes parameter of the /templates/ API call.

 

Jump to contents page of

TemplateCloud API Guide

 
 
 

All content is (c) Nettl Systems Limited, 2024 and may not be used, copied or distributed without permission.