Submit an Idea or a tool Contact Us
CafePress Developers Network
Home Tools

Content API - Design

Back to Content API Overview
The Design object is the "canvas" for your CafePress Designs. Designs are applied to Merchandise to create sellable Products. In the current html-based CafePress system, you do all of the Design work in an external image editing program like Photoshop or GIMP and upload the result. This NEW object model enables a little bit more flexibility. There are several "revolutionary" new capabilities added by the Design object. One is the notion that a Design can encompass more than one element. This is similar to "layers" in image manipulation programs. Additionally, the Design is now completely encapsulated and described by an open standard: SVG. This means that you can create graphic elements directly in SVG for use in your Design.

Try our Sample Design Application. (You will need an API Key to access this)

Design.getExample.cp

This is a demo API. It returns a sample Design definition. The XML for the Design object is returned.
Signature
http://api.cafepress.com/Design.getexample.cp
Parameters
None
Response
<?xml version="1.0" ?> 
- <Design id="1247299" name="1247299.png" parent-id="0" aspect-ratio="2" 
    width="2640" caption="" height="1122">
  <folderId>0</folderId> 
  </Design>
Errors
Standard Errors as described here
Example
http://api.cafepress.com/design.getexample.cp

design.listfolders.cp

Gives a list of Names of all subfolders in the base Image Folder.
Signature
design.listfolders.cp?userToken=string-value&appKey=string-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   

Optional:    
None
Response
  <?xml version="1.0" ?>
- <folders>
  <folder name="HolidayDesigns" />
  <folder name="DesignsCreatedbyJoe" />
  </folders>
Errors
Standard Errors as described here
Example
http://api.cafepress.com/design.listFolders.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=755afced-a649-4b94-8129-19a49eb4c1b0

design.makeFolder.cp

Create a new Folder in the Authenticated User's Account.
Signature
design.makeFolder.cp?userToken=string-value&appKey=string-value
	&folderName=string-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   
folderName - (string) the name for the new Folder.   	   

Optional:    
None
Response
  <?xml version="1.0" ?>
  <folder name="NewFolder" /> 
Error
Standard Errors as described here
Example
http://api.cafepress.com/design.makefolder.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=755afced-a649-4b94-8129-19a49eb4c1b0&folderName=NewFolder

design.find.cp

Returns the Design specified by the given Design ID. The Design must belong to the current user.
Signature
design.find.cp?userToken=string-value&appKey=string-value&id=int-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   
id - The ID of the Design.  

Optional:    
None
Response
  <?xml version="1.0" ?>
- <design id="15364272" name="15364272.png" parent-id="0" aspect-ratio="1" 
      width="20" caption="italicp.jpg" height="20">
  <folderId>0</folderId>
  </design>
Errors
Standard Errors as described here
Example 
http://api.cafepress.com/design.find.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=755afced-a649-4b94-8129-19a49eb4c1b0&id=15364272

design.list.cp

Lists the Designs in the authenticated users Image basket that match the specified criteria. For Example -
When no parameter is specified it returns all Designs in the current user's base Folder.
When Creator is specified, it retrieves all Design that were created by that Creator only.
When Folder Name is specified, it retrieves all Design from that Folder only.
Signature
* design.list.cp?userToken=string-value&appKey=string-value
* design.list.cp?userToken=string-value&appKey=string-value&folderName=string-value
* design.list.cp?userToken=string-value&appKey=string-value&creator=string-value
* design.list.cp?userToken=string-value&appKey=string-value
                 &folderName=string-value&creator=string-value
* design.list.cp?userToken=string-value&appKey=string-value
                 &folderName=string-value&page=int-value&imageCount=int-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   
id - (integer) The ID of the Design.  

Optional:    
folderName - (string) Sub Folder name
page - (integer) A Zero-based index into the list of designs
imageCount -(integer) The number of designs to return per page
creator - (string) Normally used to identify the application 
           that was used to create the design.
Response
<?xml version="1.0" ?>
- <designs>
+ <design id="14150562" name="14150562.png" parent-id="0" aspect-ratio="1" width="2000" 
caption="DesignForBlackShirt.jpg" height="2000">
+ <design id="14151430" name="14151430.png" parent-id="0" aspect-ratio="1" width="3000" 
caption="design" height="3000" creator="splash.cafepress.com">
+ <design id="14151431" name="14151431.png" parent-id="0" aspect-ratio="1" width="3000" 
caption="design" height="3000" creator="splash.cafepress.com">
- <design id="15069583" name="15069583.png" parent-id="0" aspect-ratio="1" width="250" 
caption="YouTooCanDoIt copy.gif" height="250">
  <folderId>8087572</folderId>
  </design>
- <design id="15069656" name="15069656.png" parent-id="0" aspect-ratio="1" width="300" 
caption="3-YouTooCanDoIt copy.gif" height="300">
  <folderId>8087572</folderId>
  </design>
</designs>
Errors
Standard Errors as described here
Example
http://api.cafepress.com/design.list.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=755afced-a649-4b94-8129-19a49eb4c1b0

design.getLast.cp

Returns the last Design saved to the base Image Folder.
Signature
design.getlast.cp?userToken=string-value&appKey=string-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   

Optional:    
None
Response
<?xml version="1.0" ?> 
- <design id="15364272" name="15364272.png" parent-id="0" 
      aspect-ratio="1" width="20" caption="italicp.jpg" height="20">
  <folderId>8087572</folderId> 
  </design>
Errors
Standard Errors as described here
Example
http://api.cafepress.com/design.getlast.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=deda1871-3dc0-427b-91d6-b58aad285766

design.save.cp

Saves a Design. This method can be called to edit an existing Design or to create a new Design. If you save a Design using the no predefined ID, or an ID = 0, a new Design will be created. The thumbnails and other derivative Images are created for new Designs only. So if you want to update the thumbnail save it as a new Design.
Signature
* Design.save.cp?userToken=string-value&appKey=string-value
			&value=Designobject-xml-value
* Design.save.cp?userToken=string-value&appKey=string-value
			&value=Designobject-xml-value&svg=svg-value
* Design.save.cp?userToken=string-value&appKey=string-value
			&value=Designobject-xml-value&svg=svg-value&folder_name=string-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   
value - (XML) the Design definition xml. 

Optional:    
folderName - (string) the Folder to save the Design in. 
svg - (SVG XML) An SVG XML string
Response
The Design ID generated for the new Design.
  <?xml version="1.0" ?>
- <Design id="15366661" name="15366661.png" parent-id="0" aspect-ratio="1" width="3000" 
			caption="Design" height="3000" creator="manisha">
  <folderId>8087572</folderId>
  </Design>
Error
Standard Errors as described here
Example
http://api.cafepress.com/Design.save.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=24d374b5-390c-498e-8115-f8fa27f9cc68&value=[Design-XML-Value]

Design.svg.cp

Returns the SVG XML of the given Design ID. The Design ID specified must belong to the authenticated user.

Our NEW Design object model has several "revolutionary" new capabilities. One is the notion that a Design can encompass more than one element. This is similar to "layers" in image manipulation programs. Additionally, the Design is now completely encapsulated and described by an open standard: SVG. This means that you can create graphic elements directly in SVG for use in your Design.
Signature
Design.svg.cp?userToken=string-value&appKey=string-value&id=int-value
Parameters
Required:    
userToken - a valid user authentication token.
appKey - an application key.   	   
id - (integer)the Design Id.   	   

Optional:    
None
Response
A single layer Design that consists of a Raster Image only.
  <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" 
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300">
- <g id="layer1">
  <image id="image15069656" height="300" width="300" 
  		xlink:href="http://images.cafepress.com/image/15069656.png" x="0" y="0" />
  </g>
  </svg>
A TEXT ONLY Design created by TshirtDesigner
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" 
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:icb="http://www.cafepressdn.com/tool/TshirtDesigner" width="185" height="185">
<g id="layer1">
<icb:align>Center</icb:align>
<icb:original>This is crazy</icb:original>
<text x="0" y="0" opacity="100" font-size="28" font-family="Courier New" 
		font-weight="bold" font-style="normal" fill="#808000">
<tspan x="27" dy="32">This is </tspan><tspan x="44" dy="32">crazy</tspan></text>
</g></svg>
A composite Design created by ClickShirt
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <svg cpbv:version="1.0" cpbv:libraryIds="" width="290" height="290" 
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" 
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:cpbv="http://www.cafepress.com/splash">
- <g cpbv:class="ShapeArt" cpbv:x="145.002241818962" cpbv:y="102.878043501487" 
cpbv:width="277.105034966005" cpbv:height="65.2195107217748" cpbv:rotation="0" 
cpbv:shape-name="square" cpbv:stroke-width="0" cpbv:stroke-color="16711680" 
cpbv:fill-style="solid" cpbv:fill-color="16711680" cpbv:tail-x="-112.655278761935" 
cpbv:tail-y="112.655278761935" cpbv:exported-stenciled-picture-index="-1" 
transform="translate(145.002241818962,102.878043501487) scale(2.75110906245052) 
rotate(0) translate(-50,-11.4908897767406)" fill="#FF0000" stroke="#FF0000" 
stroke-width="0.724845389872074" stroke-linecap="round" stroke-linejoin="round">
  <path stroke-width="0.724845389872074" d="M100,0L0,0L0,22.9818L100,22.9818L100,0z" />
  </g>
- <g cpbv:class="ShapeArt" cpbv:x="194.378378378378" cpbv:y="148.524526741472" 
cpbv:width="22.2472991730781" cpbv:height="19.7968165357481" cpbv:rotation="0" cpbv:shape-name="star" 
cpbv:stroke-width="0" cpbv:stroke-color="13421772" cpbv:fill-style="solid" cpbv:fill-color="13421772" 
cpbv:tail-x="-90.9549252161369" cpbv:tail-y="90.9549252161369" cpbv:exported-stenciled-picture-index="-1" 
transform="translate(194.378378378378,148.524526741472) scale(0.220380431309394) rotate(0) 
translate(-50,-44.4403352358227)" fill="#CCCCCC" stroke="#CCCCCC" stroke-width="0.949521883115458" 
stroke-linecap="round" stroke-linejoin="round">
  <path stroke-width="0.949521883115458" d="M61.8,33.9524L50,0L38.2,33.9524L0,33.9524l30.9,20.9758L19.1,
  88.8807L50,67.9048L80.9,88.8807L69.1,54.9281L100,33.9524L61.8,33.9524z" />
  </g>
  </svg>
Error
Standard Errors as described here
Example
http://api.cafepress.com/Design.svg.cp?appKey=11111111-1111-1111-1111-111111111111&userToken=755afced-a649-4b94-8129-19a49eb4c1b0&id=15289389
Signup to receive updates