get_article

Description

Gets an article object from your shop

Definition

get_article (
    String token,
    int article_id
)

Parameters

Type Parameter Name Parameter Description
string token session token
int shop_id spreadshirt shop ID

Return Values

FIXME This table doesn't convey very well that producttype_sizes has sub elements.

The return value is a complex response_object that contains the following:

Type Return Value Name Return Value Description
int article_id article ID
int product_id product ID
int producttype_id product type ID
int producttype_color_id colour ID
array producttype_sizes array of size objects representing the available sizes
producttype_sizes array elements
Type producttype_sizes element name producttype element discription
intproducttype_size_id producttype size ID
intweight order weight
stringname size name
Type Return Value Name Return Value Description
int partner_id partner ID
int shop_id shop ID
int weight order weight
decimal currency article currency
decimalgrossarticle price
decimal vat article vat
string name article name
string description article description
string image_url article default image URL
string base_url base URL to article image. :!: The base_urls appear to be invalid now. but you can attach the img_size url parameter to the image_url url and get the same picure. I haven't tested adding an img_id parameter yet.
int view_count Shows how many printable sides the article has (i.e. Two for back/front). Necessary to append to the base_url.
array design_ids array of design_id's representing the applied designs
boolean stockout If this is set, the article is out of stock (not available)
boolean limited Boolean value. If true, the article is limited to a specific amount.
int limited_available If limited is true, this parameter shows, how many articles are left

Parameters for image base url

The methods get_article and get_articles return a parameter called base_url, for example http://www.spreadshirt.net/image.php?type=image&product_id=2008898 You have to append serveral parameters to retrieve the desired article image. :!: The base_urls appear to be invalid now. but you can attach the img_size url parameter to the image_url url and get the same picure. I haven't tested adding an img_id parameter yet.

Parameter Possible Values
img_id Depends on view_count. Most products have two printable sides, so use 1 for front view and 2 for back view.
size small = 42×42 px
medium = 130×130
big = 190×190 px
huge = 280×280 px

For example: http://www.spreadshirt.net/image.php?type=image&product_id=2008898&img_id=1&size=big

Error messages

The return string is a standard format error string and implements all standard error and success messages. The following SOAP exceptions represent specific error codes for this method:

  • 101: missing token
  • 102: Missing article_id
  • 201: empty result set
api/get_article.txt · Last modified: 2009/05/31 17:29 (external edit)
 
Recent changes RSS feed Driven by DokuWiki