get_articles

Description

Returns an array of of article objects

Definition

get_articles (
    String token,
    int shop_id,
    int producttype_id,
    int design_id,
    String order_by,
    int position,
    int limit,
    String search_phrase
)

Parameters

Type Parameter Name Parameter Description
string token session token
int shop_id spreadshirt shop ID
int producttype_id producttype ID (Optional)
int design_id design ID (Optional)
string order_by reorder the results, possible values: name, price, weight(default) This doesn't appear to be working currently.
int position start position in list
int limit limit result set to # of elements
string search_phrase full text search in article name and description (optional)

Return Values

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

The return value is a list of complex response_objects i.e. an array of objects that contain 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_sizes element description
int producttype_size_id producttype size ID
int weight order weight
string name 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
decimal gross article price
decimal vat article vat
string name article name
string description article description
string image_url article default image URL :!: This currently appears to be broken. The URL is being prepended with ”http://www.spreadshirt.net/” i.e. twice.
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 method 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 shop_id
  • 201: empty result set
api/get_articles.txt · Last modified: 2009/06/01 00:05 by thuperadmin
 
Recent changes RSS feed Driven by DokuWiki