Skip to end of metadata
Go to start of metadata

This document specifies the API of our image service, that allows to render images for designs, products, product types, fonts, etc..

General

Media Type

The default response media type is PNG for images and SWF for fonts. You can change the response and request media type by adding the optional mediaType query parameter to your URL.

Possible response media types are:

Type

Resource

Simplified identifer
(in URL query parameter mediaType)

Pixel

PNG

png

 

JPEG

jpg

 

GIF

gif

 

Flash library
(image or font)

swf

Possible request media types are (design upload):

Type

Resource

Simplified identifer
(in URL query parameter mediaType)

Pixel

PNG

png

 

JPEG

jpg

 

GIF

gif

Vector

SVG

svg

 

AI

ai

 

EPS

eps

 

CDR

cdr

 

PDF

pdf

Dimension

The default image size is 190x190 pixel, but there are some exceptions to this (fonts have no size and some Product Type images have a different default size).
One can explicitly request another image dimension through the optional query parameters width and height.

There is only a limited set of image dimensions, to improve the Image Caches hit ratio and prevent Denial of Service attacks.

Name

Size

Sizes

50,100,150 ... 1200

 

11

 

35

Preview

42

 

51

 

75

 

130

Default

190

 

280

 

560

Image Background

The default background is transparent for all requested media types that support transparency (PNG and GIF). For all other payload formats the background is a full opaque white. However, the background color can be set through a Render Parameter (see below).

Render Parameter

The generic way for defining special render parameters that are applied on the rendered image before delivering to the caller. All render parameters are optional, see below for examples.

Background Color

As described above there is a response media type dependent behaviour whether the image's background is transparent or opaque. The background color can be set with the key backgroundColor and a six digit hexadecimal code defining the three RGB channels (just like in the rest of the HTML/CSS world). Note that there is no dash sign in front of the hexcode, as this is already owned by the Fragment in HTTP speak.

Render parameters currently only affect the rendering of pixel images. This might change in future.

Examples:

http://image.spreadshirt.net/v1/products/938473/views/2?mediaType=png&backgroundColor=ff45e3

http://image.spreadshirt.net/v1/designs/3485723?mediaType=svg&backgroundColor=e467ab
(no change in appearance, as format is SVG)

Resources

Retrieve Design Image

Returns the image for an platform design as pixel design, i.e. png, jpg or gif.

Url

.../v1/designs/{designId}

Sample

http://image.spreadshirt.net/image-server/v1/designs/2484607

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.
colors[i] - The color for an svg layer according to given index and color as hexadecimal RGB color withour leading '#'. None means transparent.

Special Status Codes

 

Examples:

Name

URL

Image

Design Image

http://image.spreadshirt.net/image-server/v1/designs/2484607,width=200,height=200?mediaType=png


Design Layer Image

http://image.spreadshirt.net/image-server/v1/designs/2484607,colors\[1\]=none?mediaType=png&width=200&height=200


Update (Upload) Design Image

Allows to upload design images to our server for a previously created design data entity. You can upload images in the following formats: png, jpg, gif, svg, ai, eps, pdf, cdr. Please note that only pixel designs (png, jpg, gif) will be available instantly. Vector designs (svg, ai, eps, pdf, cdr) will be checked manually for their printability before you can use them. That means, it is also possible that vector designs will be rejected. Please also note that there are upload limits for vector designs right now.

Url

...image-server/v1/designs/123

Sample

http://image.spreadshirt.net/image-server/v1/designs/123

Type

ENTITY

Method

PUT

Request Parameters

mediaType - The requested mediaType, e.g. png, jpg, gif for images or xml for image pointer.

Special Status Codes

403 Forbidden (if image was uploaded already)
415 Unsupported media type

APIKey

true

SessionId

false (true for user design)

Request Payload:

Image payload and mediaType set to png, jpg or gif:

   ... the svg, png, jpg ...

or image pointer in payload as xml and mediaType set to xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reference xmlns:xlink="http://www.w3.org/1999/xlink" 
           xmlns="http://api.spreadshirt.net"
           xlink:href="…your image url…"/>

Retrieve Configuration Image

A configuration image returns an image of one design or text applied to a print area of the selected product type.

Url

.../v1/configurations/{configurationId}

Sample

http://image.spreadshirt.net/image-server/v1/configurations/16940335

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.
appearanceId - The id of the product type appearance to be used to render the image, e.g. 3.

Special Status Codes

 

Examples:

Retrieve Composition Image

A composition image returns an image of all designs and text applied to one product type view.

Url

.../v1/compositions/{productId}/views/{viewId}

Sample

http://image.spreadshirt.net/image-server/v1/compositions/16940335/views/1

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.
appearanceId - The id of the product type appearance to be used to render the image, e.g. 3.

Special Status Codes

 

Examples:

Retrieve Product Image

A product image returns an image of the whole product from a specific viewer's perspective.

Url

.../v1/products/{productId}/views/{viewId}

Sample

http://image.spreadshirt.net/image-server/v1/products/16940335/views/1

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.
appearanceId - The id of the product type appearance to be used to render the image, e.g. 3.

Special Status Codes

 

Examples:

Retrieve ProductType Image

A product type image returns an image of the product type, e.g. T-shirt or cup, from a specific viewer's perspective.

Url

.../v1/productTypes/{productTypeId}/views{viewId}/appearances/{appearanceId}

Sample

http://image.spreadshirt.net/image-server/v1/productTypes/101/views/1/appearances/33

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.

Special Status Codes

 

Examples:

Retrieve ProductType Variant Image

Product type variant image returns variant image of the product type, such as a image that shows the product type details or an image that illustrates the product type sizes.

Url

.../v1/productTypes/{productTypeId}/variants/{variant}

Sample

http://image.spreadshirt.net/image-server/v1/productTypes/101/variants/size

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.

Special Status Codes

 

Examples:

Retrieve ProductType Appearance Image

A product type appearance image returns an image of a possible color/pattern combination for a product type.

Url

.../v1/appearances/{appearanceId}

Sample

http://image.spreadshirt.net/image-server/v1/appearances/4

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.

Special Status Codes

 

Example:

Retrieve PrintColor Image

A print color image returns an image of a possible print type color.

Url

.../v1/printColors/{colorId}

Sample

http://image.spreadshirt.net/image-server/v1/printColors/4

Type

Entity

Method

GET

Request Parameters

backgroundColor - The color to render in background as a hexadecimal RGB color without leading '#' (optional).
mediaType - The requested mediaType, e.g. png, jpg, gif.
width - The desired width, e.g. 100.
height - The desired height, e.g. 100.

Special Status Codes

 

Example:

Retrieve Font File

Returns a font file as SWF that can be used to render text in Adobe Flash clients for example.

Url

.../v1/fontFamilies/{fontFamilyId}/fonts/{fontId}

Sample

http://image.spreadshirt.net/image-server/v1/fontFamilies/6/fonts/19

Type

Entity

Method

GET

Request Parameters

mediaType - The requested mediaType, e.g. png, jpg, gif.

Special Status Codes

 

  • No labels