Template details API

13/02/2009

Extended web to print template details can be requested as XML via HTTP GET. You may need this function to show the template in your own web-to-print user interface bypassing ZetaPrints screens altogether.

List of templates (public)

The easiest way to obtain a current list of web-to-print templates is to request an RSS feed for a catalog.

E.g. http://order.example.com/RssTemplates.aspx?D0B47D43-3507-32D8-B851-7164F9270D9D

Format: http://[domain name]/RssTemplates.aspx?[Catalog ID]

[domain name] – can be zetaprints.com or the domain name of the portal the catalog belongs to

[Catalog ID] – a case insensitive GUID as the ID of the catalog. It is shown in many URLs as CorporateID and is displayed on catalog details page.

A link to a catalog’s RSS can be found on catalog details page. Only web-to-print catalogs with public access have RSS feeds available.

The feed contains <ID></ID> element with template ID as well as links to the template, large and small preview images.

List of templates (password protected)

The same RSS feed is returned in both cased, but access to password-protected catalogs requires an API key.

E.g. http://orders.example.com/API.aspx?page=api-templates;CorporateID=201CBC4F-17B7-4394-BFA4-FB0C1FB8F29A;ApiKey=612ecb11-48fd-4df7-b004-3e497919283e

Format: http://[domain name]/API.aspx?page=api-templates;CorporateID=[Catalog ID];ApiKey=[your API key]

[domain name] – can be zetaprints.com or the domain name of the portal the catalog belongs to

[Catalog ID] – a case insensitive GUID as the ID of the catalog.

A link to a catalog’s API feed can be found on catalog details page.

[your API key] – found on API page.

Web to print catalog RSS feed example

<rss version="2.0">
	<channel>
		<lastBuildDate>Fri, 13 02 2009 08:26:22 +0000</lastBuildDate>
		<title>Web-to-print templates</title>
		<link>http://order.uprintinvitations.com</link>
		<generator>ZetaPrints</generator>
		<item>
			<title>Babyface 143 Birthday Invitation</title>
			<link>http://order.uprintinvitations.com/Invitations-Boys/Babyface-143-Birthday-Invitation.htm</link>
			<description>size: 4" x 6" (10.16 CM x 15.24 CM) Upgrade to 5x7 for $5 after purchase (print yourself only). Choose print yourself, or pick up at your local discount store or pharmacy next day. DOES NOT INCLUDE ENVELOPES. Order sent to the closest store based on the zip code you enter in the address box.You pay nothing at the time of pick up. You will receive an email with pickup location and completion time. If you choose the "Print Yourself" option you may download your file immediately after payment. You will receive an email with instructions on how to download your file.</description>
			<id>89E2EE7B-7381-4FCF-8786-2AB27E590E12</id>
			<thumbnail>http://order.uprintinvitations.com/thumb/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg</thumbnail>
			<image>http://order.uprintinvitations.com/preview/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg</image>
			<media:thumbnail url="http://order.uprintinvitations.com/thumb/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<media:content url="http://order.uprintinvitations.com/preview/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<enclosure url="http://order.uprintinvitations.com/thumb/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg" type="image/jpeg"/>
		</item>
		<item>
			<title>Golf Magazine Birthday Invitations</title>
			<link>http://order.uprintinvitations.com/Invitations-Boys/Golf-Magazine-Birthday-Invitations.htm</link>
			<description/>
			<id>F8D2C6B2-80F0-4AC2-B13F-666732881069</id>
			<thumbnail>http://order.uprintinvitations.com/thumb/4b6e44cd-e18b-4df4-9b01-fb34c7a985b2-0.jpg</thumbnail>
			<image>http://order.uprintinvitations.com/preview/4b6e44cd-e18b-4df4-9b01-fb34c7a985b2-0.jpg</image>
			<media:thumbnail url="http://order.uprintinvitations.com/thumb/4b6e44cd-e18b-4df4-9b01-fb34c7a985b2-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<media:content url="http://order.uprintinvitations.com/preview/4b6e44cd-e18b-4df4-9b01-fb34c7a985b2-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<enclosure url="http://order.uprintinvitations.com/thumb/4b6e44cd-e18b-4df4-9b01-fb34c7a985b2-0.jpg" type="image/jpeg"/>
		</item>
		<item>
			<title>Basketball Magazine Birthday Invitations</title>
			<link>http://order.uprintinvitations.com/Invitations-Boys/Basketball-Magazine-Birthday-Invitations.htm</link>
			<description/>
			<id>3F107634-F362-4AD4-ADBC-5CD4CD1E824A</id>
			<thumbnail>http://order.uprintinvitations.com/thumb/57984895-4c88-4f82-a44f-116eb4948e2c-0.jpg</thumbnail>
			<image>http://order.uprintinvitations.com/preview/57984895-4c88-4f82-a44f-116eb4948e2c-0.jpg</image>
			<media:thumbnail url="http://order.uprintinvitations.com/thumb/57984895-4c88-4f82-a44f-116eb4948e2c-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<media:content url="http://order.uprintinvitations.com/preview/57984895-4c88-4f82-a44f-116eb4948e2c-0.jpg" type="image/jpeg" xmlns:media="http://search.yahoo.com/mrss/"/>
			<enclosure url="http://order.uprintinvitations.com/thumb/57984895-4c88-4f82-a44f-116eb4948e2c-0.jpg" type="image/jpeg"/>
		</item>
	</channel>
</rss>

Template details feed (public)

Details of a web-to-print template can be requested at http://[domain name]/?page=template-xml;TemplateID=[template ID]

[domain name] – can be zetaprints.com or the domain name of the portal the web to print template belongs to

[Template ID] – a case insensitive GUID as the ID of the catalog. It is shown in many URLs as TemplateID and is displayed on template details page.

E.g. http://zetaprints.com/?page=template-xml;TemplateID=89E2EE7B-7381-4FCF-8786-2AB27E590E12

Template details feed (password-protected)

The same XML feed is returned in both cased, but access to password-protected catalogs requires an API key.

E.g. http://orders.example.com/API.aspx?page=api-template;TemplateID=201CBC4F-17B7-4394-BFA4-FB0C1FB8F29A;ApiKey=612ecb11-48fd-4df7-b004-3e497919283e

Format: http://[domain name]/API.aspx?page=api-template;TemplateID=[Template ID];ApiKey=[your API key]

[domain name] – can be zetaprints.com or the domain name of the portal the catalog belongs to

[Template ID] – a case insensitive GUID as the ID of the catalog.

A link to a template’s API feed can be found on Links page for the template.

[your API key] – found on API page.

Web to print template feed example

<TemplateDetails TemplateID="89E2EE7B-7381-4FCF-8786-2AB27E590E12" Created="2009-02-13T07:21:27.577" CorporateID="D0B47D43-3407-42D8-B851-7164F9270D9D" Comments="size: 4&quot; x 6&quot; (10.16 CM x 15.24 CM) Upgrade to 5x7 for $5 after purchase (print yourself only). Choose print yourself, or pick up at your local discount store or pharmacy next day. DOES NOT INCLUDE ENVELOPES. Order sent to the closest store based on the zip code you enter in the address box.You pay nothing at the time of pick up. You will receive an email with pickup location and completion time. If you choose the &quot;Print Yourself&quot; option you may download your file immediately after payment. You will receive an email with instructions on how to download your file." GenerateJpg="1" AccessURL="http://order.uprintinvitations.com/Invitations-Boys/Babyface-143-Birthday-Invitation.htm" ProductReference="">
	<Pages>
		<Page Name="Page 1" PreviewImage="preview/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg" ThumbImage="thumb/bc88a68d-55ef-4fe9-b777-0cafd39f0f00-0.jpg"/>
	</Pages>
	<Images>
		<Image Name="Your Picture 1 of 5 (crop tool under Help)" Width="1003" Height="647"/>
		<Image Name="Your Picture 2 of 5 (crop tool under Help)" Width="261" Height="237"/>
		<Image Name="Your Picture 3 of 5 (crop tool under Help)" Width="261" Height="237"/>
		<Image Name="Your Picture 4 of 5 (crop tool under Help)" Width="261" Height="237"/>
		<Image Name="Your Picture 5 of 5 (crop tool under Help)" Width="261" Height="237"/>
		<Image Name="Choose Your Background" Width="1800" Height="1200">
			<StockImage FileID="6CAB2649-8C0B-490B-87CD-33E2FB79D8FF" MIME="image/jpg" Thumb="4b461602-ac60-450c-86c5-12b72023c927.jpg"/>
			<StockImage FileID="C16EAF32-632F-4434-9BE7-0FF3C82A7988" MIME="image/jpg" Thumb="e3035786-992f-4d0e-9109-475d7099bc77.jpg"/>
			<StockImage FileID="8ED88275-4935-40FA-A708-2B6692629F94" MIME="image/jpg" Thumb="31820673-dce5-415a-8156-148caf7f21f4.jpg"/>
			<StockImage FileID="8E15E01B-97EA-40FC-90A5-547D17B2D4CC" MIME="image/jpg" Thumb="c51e7579-77de-4345-81c7-6a000e5f81b0.jpg"/>
		</Image>
	</Images>
	<Fields>
		<Field FieldName="Top Greeting" Page="1" Multiline="1" Hint=""/>
		<Field FieldName="First Name" Page="1" Multiline="1" Hint=""/>
		<Field FieldName="Last Name" Page="1" Multiline="1" Hint=""/>
		<Field FieldName="Party Information" Page="1" Multiline="1" Hint=""/>
	</Fields>
	<Keywords/>
</TemplateDetails>

Feed elements explained

TemplateDetails/@CorporateID – catalog ID

TemplateDetails/@GenerateJpg, @GeneratePdf, @GenerateGif – type of file generated as the final output if the attribute value set to 1.

Image fields

TemplateDetails/Images/Image – list of image fields in the template.

TemplateDetails/Images/Image/@Name – name of the image field.

TemplateDetails/Images/Image/@Width and @Height – recommended image size in pixels.

TemplateDetails/Images/Image/StockImage – list of stock images provided with the template.

TemplateDetails/Images/Image/StockImage/@FileID – the ID sent to ZetaPrints as value of the image field if the stock photo is selected.

TemplateDetails/Images/Image/StockImage/@Thumb – location of a small preview image for the photo.

TemplateDetails/Images/Image – can have attributes @AllowUpload, @AllowUrl set to 1 if these features are enabled for this field.

TemplateDetails/Images/Image/@ColourPicker set to RGB if this field should have a color picker in the user interface.

Text fields

TemplateDetails/Fields/Field/@FieldName – name of the text field.

TemplateDetails/Fields/Field/@Page – page number where the field is encountered for the first time.

TemplateDetails/Fields/Field/@Multiline – set to 1 if the field accepts more than 1 line of user input.

TemplateDetails/Fields/Field/@Hint – a hint about the purpose of the text field.

TemplateDetails/Fields/Field/@MinLen and @MaxLen – recommended input length limits.

TemplateDetails/Fields/Field/Value – a list of values for the field. Multiple Value elements with text nodes. One Value element can be empty.

Keywords

TemplateDetails/Keywords – can have any number of attributes named k1, k2, … kn with a single keyword to be used for related search.

Other elements and attributes

This post describes only some of the elements and attributes. The sample feed above is incomplete. There can be any number of other nodes present. We hope they are self-explanatory. Leave a comment with your questions.

User data cache

Template details can contain cached user input if user ID and hash are specified as HTTP POST fields: ID, Hash.

The values reside in Field/@Value and Image/@Value attributes.

See also: