API Endpoints ============= Root ---- .. http:get:: /1.1/ Retrieve a list of resources. .. sourcecode:: js { "authentication": { "token": { "expires": "2015-09-07T17:04:59+0300", "id": "1e0bb382298a103578b2801527b4dbca", "startTime": "2015-09-07T16:04:59+0300" } }, "links": { "self": "https://api.huuto.net/1.1/authentication", "user": "https://api.huuto.net/1.1/users/966898" }, "updated": "2015-09-07T16:04:59+0300" } Authentication -------------- .. http:post:: /1.1/authentication Authenticate with userid and password. Method call returns a token id, which can be sent as the *X-HuutoApiToken* header field. Also token expiration time is returned as part of the data. Userid is the same userid used for Huuto.net. If you do not already have an account, you can register one through the main site (http://www.huuto.net). :param username: user's username :type username: string :param password: password :type password: string :status 400: when form parameters are missing or invalid username/password :status 201: authentication token created **Example response**: .. sourcecode:: js { "authentication": { "token": { "expires": "2015-09-07T17:04:59+0300", "id": "1e0bb382298a103578b2801527b4dbca", "startTime": "2015-09-07T16:04:59+0300" } }, "links": { "self": "https://api.huuto.net/1.1/authentication", "user": "https://api.huuto.net/1.1/users/966898" }, "updated": "2015-09-07T16:04:59+0300" } Bids ---- Getting item's bids ^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items/{itemid}/bids Retrieve information about item's bids :param itemid: item's id :type itemid: int Making a bid ^^^^^^^^^^^^ .. http:post:: /1.1/items/{itemid}/bids :param itemid: item's id :type itemid: int :param bid: bid amount (euros), eg. "16.50" :type bid: float :param automate: Bidding automation. With automate on, bid parameter is considered to be the **maximum amount** the user is willing to pay. Bidding automation system will take care of the bidding process on behalf of the user and try to win the item with the smallest possible price. :type automate: int (0 = no, 1 = yes). Default 0. :param quantityMin: Minimum quantity user is bidding for. Applies to items which have a quantity of more than one (eg. one is selling 10 USB sticks). Required if item has a quantity of more than one. Currently only buy-now items can have a quantity of more than one. :type quantityMin: int :param quantityMax: Maximum quantity user is bidding for. Required if item has a quantity of more than one. (See more info above.) :type quantityMax: int Categories ---------- Listing categories ^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/categories/ Retrieve category listing. Huuto has a 3-level category system. :param max-depth: multiple hierarchy levels can be fetched in a single call :type max-depth: int (1, 2, 3) **Example response**: .. sourcecode:: js { "categories": [ { "id": 1, "links": { "items": "https://api.huuto.net/1.1/categories/1/items", "self": "https://api.huuto.net/1.1/categories/1", "subcategories": "https://api.huuto.net/1.1/categories/1/subcategories" }, "title": "Ajoneuvot" }, { "id": 27, "links": { "items": "https://api.huuto.net/1.1/categories/27/items", "self": "https://api.huuto.net/1.1/categories/27", "subcategories": "https://api.huuto.net/1.1/categories/27/subcategories" }, "title": "Antiikki" }, { "id": 86, "links": { "items": "https://api.huuto.net/1.1/categories/86/items", "self": "https://api.huuto.net/1.1/categories/86", "subcategories": "https://api.huuto.net/1.1/categories/86/subcategories" }, "title": "Elokuvat" } ], "id": 0, "links": { "items": "https://api.huuto.net/1.1/items", "self": "https://api.huuto.net/1.1/categories" }, "title": "Huuto.net categories", "updated": "2015-09-08T13:05:33+0300" } Category info ^^^^^^^^^^^^^ .. http:get:: /1.1/categories/ Retrieve information regarding a single category. :param categoryid: Category id :type categoryid: int **Example response (shortened)**: .. sourcecode:: js { "id": 375, "links": { "items": { "closed": "http://api.huuto.net/1.1/categories/375/items/closed", "closing": "http://api.huuto.net/1.1/categories/375/items/closing", "gallery": "http://api.huuto.net/1.1/galleries/category/375", "open": "http://api.huuto.net/1.1/categories/375/items", "recent": "http://api.huuto.net/1.1/categories/375/items/recent" }, "self": "http://api.huuto.net/1.1/categories/375", "subcategories": "http://api.huuto.net/1.1/categories/375/subcategories" }, "title": "Lastentarvikkeet", "updated": "2015-09-08T13:35:57+0300" } Category items ^^^^^^^^^^^^^^ .. http:post:: /1.1/categories/ Retrieve category items. :param categoryid: Category id :type categoryid: int **Example response (shortened)**: .. sourcecode:: js { "items": [ { "bidderCount": 0, "buyNowPrice": 19, "category": "Poikien vaatepaketit", "closingTime": "2015-09-09T23:29:35+0300", "currentPrice": 19, "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 362545037, "images": [ { "links": { "medium": "http://kuvat.huuto.net/e/ca/c2ea29b2466ae4aea256592ee8493-m.jpg", "original": "http://kuvat.huuto.net/e/ca/c2ea29b2466ae4aea256592ee8493-orig.jpg", "self": "http://api.huuto.net/1.1/items/362545037/images/261771540", "thumbnail": "http://kuvat.huuto.net/e/ca/c2ea29b2466ae4aea256592ee8493-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/retrovaatepaketti-pojalle-100-140cm/362545037", "category": "http://api.huuto.net/1.1/categories/740", "images": "http://api.huuto.net/1.1/items/362545037/images", "self": "http://api.huuto.net/1.1/items/362545037" }, "listTime": "2015-05-12T23:30:32+0300", "location": "akaa", "offerCount": 0, "postalCode": "37800", "saleMethod": "buy-now", "seller": "jannehautamaki", "sellerId": 1396547, "title": "retrovaatepaketti pojalle 100-140cm ", "upgrades": [] }, { "bidderCount": 0, "buyNowPrice": 0, "category": "Poikien vaatepaketit", "closingTime": "2015-09-08T17:58:06+0300", "currentPrice": 15, "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 374721944, "images": [ { "links": { "medium": "http://kuvat.huuto.net/d/5e/040f8e3416cab9b36a852baf2dafd-m.jpg", "original": "http://kuvat.huuto.net/d/5e/040f8e3416cab9b36a852baf2dafd-orig.jpg", "self": "http://api.huuto.net/1.1/items/374721944/images/276066506", "thumbnail": "http://kuvat.huuto.net/d/5e/040f8e3416cab9b36a852baf2dafd-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/110---116---122-cm-pojan-vaatepaketti-mm-lego-hm-lindex/374721944", "category": "http://api.huuto.net/1.1/categories/740", "images": "http://api.huuto.net/1.1/items/374721944/images", "self": "http://api.huuto.net/1.1/items/374721944" }, "listTime": "2015-08-25T17:58:06+0300", "location": "Kuusankoski", "offerCount": 0, "postalCode": "45740", "saleMethod": "auction", "seller": "Pimpuli", "sellerId": 503013, "title": "110 - 116 - 122 cm pojan vaatepaketti, mm. Lego H&M lindex", "upgrades": [] }, { "bidderCount": 0, "buyNowPrice": 0, "category": "Poikien vaatepaketit", "closingTime": "2015-09-09T08:21:52+0300", "currentPrice": 6, "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 374790607, "images": [ { "links": { "medium": "http://kuvat.huuto.net/f/6a/2c75e33113761a25e2d939cd92f17-m.jpg", "original": "http://kuvat.huuto.net/f/6a/2c75e33113761a25e2d939cd92f17-orig.jpg", "self": "http://api.huuto.net/1.1/items/374790607/images/246408952", "thumbnail": "http://kuvat.huuto.net/f/6a/2c75e33113761a25e2d939cd92f17-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/collegehousut-104_110-ja-pitkahihainen-paita-koko-110-lindex/374790607", "category": "http://api.huuto.net/1.1/categories/740", "images": "http://api.huuto.net/1.1/items/374790607/images", "self": "http://api.huuto.net/1.1/items/374790607" }, "listTime": "2015-08-26T08:21:52+0300", "location": "Turku", "offerCount": 0, "postalCode": "20320", "saleMethod": "auction", "seller": "ravvravv", "sellerId": 686933, "title": "collegehousut 104/110 ja pitk\u00e4hihainen paita koko 110 Lindex", "upgrades": [] } ], "links": { "first": "http://api.huuto.net/1.1/categories/375/items?page=1&category=375", "gallery": "http://api.huuto.net/1.1/galleries/items?category=375", "hits": "http://api.huuto.net/1.1/hits?category=375", "last": "http://api.huuto.net/1.1/categories/375/items?page=2172&category=375", "next": "http://api.huuto.net/1.1/categories/375/items?page=2&category=375", "previous": null, "self": "http://api.huuto.net/1.1/categories/375/items?page=1&category=375" }, "totalCount": 108560, "updated": "2015-09-08T14:06:07+0300" } Items ----- Creating a new item ^^^^^^^^^^^^^^^^^^^ .. http:post:: /1.1/items/ Create a new item. Note: Optional parameters are listed last and marked as optional. :param buyNowPrice: Buy now price. Required when sale method is "buy-now". :type buyNowPrice: float :param categoryId: Item's category id :type categoryId: int :param closingTime: together with listTime, alternative to openDays :type closingTime: string - eg. '2016-12-04 18:55:20' :param condition: item's condition :type condition: ``new`` - uusi, ``like-new`` - uudenveroinen, ``good`` - hyvä, ``acceptable`` - tyydyttävä, ``weak`` - heikko :param description: item's description :type description: string :param deliveryMethods: delivery methods :type deliveryMethods: array - ``pickup``, ``shipment``. Note: array! :param deliveryTerms: delivery terms :type deliveryTerms: string :param identificationRequired: Require identification from buyers (optional, default 0). Option available for Huuto Plus users. :type identificationRequired: int - 0 or 1, boolean :param isLocationAbroad: If item is located outside of Finland or not. Default 0 (no). If set to 1, postalCode does not need to be used. :type isLocationAbroad: int - 0 or 1, boolean :param listTime: together with closingTime, alternative to openDays (optional, defaults to current time) :type listTime: string - eg. '2016-11-20 19:26:00' :param marginalTax: Is marginal tax used or not. Available for company users. :type marginalTax: int - 0 or 1, boolean :param minimumFeedback: minimum user feedback points required for buying/bidding (ostajien rajaaminen palautepistemäärän perusteella). Option available for Huuto Plus users. :type minimumFeedback: int :param minimumIncrease: Minimum increase for bidding. (Not available for regular users. Required for Huuto Plus users, who can set this value freely.) Used only when sale method is "auction". :type minimumIncrease: float :param openDays: amount of days item will be available for selling :type openDays: int :param originalId: originalId can be used to easily republish an old, closed item. Title, description, sell method, price, images and other data will get copied from the previous into newly created item, which will have a "draft" status by default. To publish it, its status must be updated to "preview" and after that, to "published". :type originalId: int :param paymentMethods: payment methods :type paymentMethods: array - ``wire-transfer``, ``cash``, ``mobile-pay``. Multiple options can be sent. Note: array! :param paymentTerms: payment terms :type paymentTerms: string - payment terms description, max. 1000 chars :param postalCode: Finnish postal code. Mandatory field by default. However, if isLocationAbroad parameter is set to 1, postalCode is not required. :type postalCode: string - eg. '00100' :param quantity: Quantity available for selling. Mandatory for buy-now items, where minimum is 1. Optional for auction items (set to 1 automatically). :type quantity: int :param republish: Republish item (optional). If not sold, item will be republished automatically. Can be used for items that are open more than 3 days. Option is available only for Huuto Plus users. :type republish: int - 0 or 1, boolean :param saleMethod: item's selling method :type saleMethod: string - ``auction``, ``buy-now``. Note: "Hybrid" method is no longer available. :param startingPrice: Starting price for bidding. Required when sale method is "auction". :type startingPrice: float :param status: item's status - When creating a new item, status will be "preview" by default. :type status: string - ``draft``, ``preview``, ``published``, ``closed``, ``disabled``, ``waiting`` :param title: Item's title :type title: string - max. 60 chars :param vat: Used vat rate as a percentage. Available for companies. :type vat: int - between 0-100 :param offersAllowed: Allow offers from users. Allowed by default. :type offersAllowed: int - 0 or 1, boolean .. note:: **More info about STATUS**: To publish an item, you have to update your item's status to "published" via a PUT request (see below for details). Item can not becreated directly into published state. Item can be created with draft status in which case no additional parameters are required. This is useful if an application wants to save item images before asking other parameters from user. **Example response**: .. sourcecode:: js { "links": { ... }, "bidderCount": 0, "buyNowPrice": 50, "closingTime": "2014-08-18T14:19:20+0300", "condition": "new", "currentPrice": 50, "deliveryMethods": [], "deliveryPrice": null, "description": "

Kohteen kuvaus

", "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 123456789, "images": [], "listTime": "2014-08-08T14:19:20+0300", "location": "Helsinki", "mainCategory": { "id": 1, "name": "Ajoneuvot" }, "minimumIncrease": 0, "paymentMethods": [], "postalCode": "", "quantity": 1, "requirements": { "identificationRequired": false, "minimumFeedback": 0 }, "saleMethod": "buy-now", "sectionCategory": { "id": 2, "name": "Autojen varusteet ja varaosat" }, "seller": "huutonet-testi", "startingPrice": 50, "status": "preview", "subCategory": { "id": 3, "name": "Autojen lis\u00e4varusteet" }, "vat": 24, "deliveryTerms": "", "title": "Testikohde 123", "updated": "2014-08-08T14:20:36+0300", "upgrades": [] } Editing item ^^^^^^^^^^^^ .. http:put:: /1.1/items/{itemid} Editing items can be done via PUT requests. Items can be edited only in preview or draft state. Edit accepts the same parameters as with item creation (see above for reference). :reqheader X-HuutoApiToken: token received via login (required) Setting item's status ^^^^^^^^^^^^^^^^^^^^^ .. http:put:: /1.1/items/{itemid} When creating a new item, it's status will be "preview" by default. To publish an item, it's status will need to be updated to "published". When item status is updated to published only status is changed even if the request contains additional parameters. :reqheader X-HuutoApiToken: token received via login (required) :param status: item's status :type status: string - ``draft``, ``preview``, ``published``, ``closed`` **draft** - Create item with "draft" status. It will return an item object with a valid item id. Put requests can be used to update item's data. Also images can be added to item. Next step is to update the item's status to "preview". .. note:: There is 10 draft item limit per user. Draft items previously created by a user can be found in user sales resource: /1.1/users/{userno}/sales/?status=draft **preview** - Set item's status to "preview". At this point all saved data will be validated. After a successful "preview", an item can published. **published** - Publish an item and make it available for selling. **closed** - Close item. After closing item is no longer available for bidding, offering etc. Highest bidder will win, if other conditions (eg. price reservation) are met. Listing and searching ^^^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items Item search. Various parameters can be used. :param addtime: item's list time :type addtime: string - ``past-day``, ``past-2days``, ``past-5days``, ``past-week`` :param area: city, municipality or zipcode :type area: string - eg. "Helsinki", "Uusimaa", "00100" :param biddernro: bidder's numeric user id :type biddernro: int :param category: category's id, multiple category id's can be separated with commas or dashes, eg. ``1-2-3`` :type category: int | string :param condition: item's condition :type condition: string - ``none`` - ei määritelty, ``new`` - uusi, ``like-new`` - uudenveroinen, ``good`` - hyvä, ``acceptable`` - tyydyttävä, ``weak`` - heikko :param closingtime: item's list time :type closingtime: string - ``next-day``, ``next-2days``, ``next-5days``, ``next-week`` :param feedback_limit: filter by user's feedback value :type feedback_limit: int :param limit: items per page limit :type limit: int (50 | 500) - default is 50 :param page: result set page number :type page: int :param price_max: maximum price :type price_max: float :param price_min: minimum price :type price_min: float :param seller_type: seller's type, default is all. :type seller_type: string - ``company``, ``user`` :param sellernro: seller's numeric user id :type sellernro: int :param sellstyle: item's selling method :type sellstyle: string - ``all``, ``auction``, ``buy-now`` :param sort: result rest sorting :type sort: string - ``hits``, ``newest``, ``closing``, ``lowprice``, ``highprice``, ``bidders``, ``title``. Default is "hits". :param status: item's status :type status: string - ``open``, ``closed`` :param words: search string :type words: string **Example request**: .. sourcecode:: http GET /1.1/items?words=lada samara forma iskunvaimentimet HTTP/1.1 Host: api.huuto.net Accept: application/json, text/javascript **Example response**: .. sourcecode:: js test Getting item data ^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items/{itemid} Retrieve item's data. :param itemid: item's id :type itemid: int Delete draft item ^^^^^^^^^^^^^^^^^ .. http:delete:: /1.1/items/{itemid} Items in *draft* status can be deleted via DELETE requests. :reqheader X-HuutoApiToken: token received via login (required) Images ------ Getting item images ^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items/{itemid}/images Retrieve images related to item. :param itemid: item's id :type itemid: int **Example response**: .. sourcecode:: js { "images": [ { "links": { "medium": "https://kuvat.huuto.net/0/64/eea869a811b177cf79b20f70d876c-m.jpg", "original": "https://kuvat.huuto.net/0/64/eea869a811b177cf79b20f70d876c-orig.jpg", "self": "https://api.huuto.net/1.1/items/123456789/images/261894141", "thumbnail": "https://kuvat.huuto.net/0/64/eea869a811b177cf79b20f70d876c-s.jpg" } } ], "links": { "self": "https://api.huuto.net/1.1/items/123456789/images" }, "updated": "2014-08-12T10:53:56+0300" } Adding an image to item ^^^^^^^^^^^^^^^^^^^^^^^ .. http:post:: /1.1/items/{itemid}/images Post an image to item. Item must exist before images can be added. Item must be in *preview* or *draft* state. Creating an item with *draft* status is useful if the application wants to save item images before asking any other parameters from the user. When request status is *draft*, no additional parameters are required. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id (already present in the url) :type itemid: int :param image: image file :type image: file **Example response**: .. sourcecode:: js { "links": { "image": "http://api.huuto.net/1.1/items/322184647/images/12345678" } } .. note:: Maximum file upload size is 8 MB. **Example CURL request** Here's an example of adding an image using CURL: .. sourcecode:: bash $ curl -i -F 'image=@/path/imagefile.jpg' -H 'X-HuutoApiToken: ' https://api.huuto.net/1.1/items//images Deleting an image ^^^^^^^^^^^^^^^^^ .. http:delete:: /1.1/items/{itemid}/images/{imageid} Delete an image from item. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id :type itemid: int :param imageid: image's id :type imageid: int :status 204: when image deleted successfully Offers ------ Getting item's offers ^^^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items/{itemid}/offers Retrieve information about item's offers :param itemid: item's id :type itemid: int Posting a new offer ^^^^^^^^^^^^^^^^^^^ .. http:post:: /1.1/items/{itemid}/offers Post a new offer (hintaehdotus) to item. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id :type itemid: int :param offer: offer amount (euros), eg. "16.50" :type offer: float :param message: message related to offer :type message: string(255) Accepting, rejecting or cancelling an offer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. http:put:: /1.1/items/{itemid}/offers/{offerid} Seller can accept or refuse offers made by users. Users can cancel offers made by themselves. Cancelling can only be done if seller has not yet accepted or refused the offer in question. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id :type itemid: int :param offerid: offer's id :type offerid: int :param status: offer status to be updated :type offer: string - ``cancelled``, ``accepted``, ``refused`` Questions --------- Getting item's questions ^^^^^^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/items/{itemid}/questions Retrieve information about item's questions and seller's answers. :param itemid: item's id :type itemid: int Posting a new question ^^^^^^^^^^^^^^^^^^^^^^ .. http:post:: /1.1/items/{itemid}/questions Post a new question to item. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id :type itemid: int :param question: question text :type question: string(255) Answering a question ^^^^^^^^^^^^^^^^^^^^ .. http:put:: /1.1/items/{itemid}/questions/{questionid} Answer to a question. Only seller can post answers. :reqheader X-HuutoApiToken: token received via login (required) :param itemid: item's id :type itemid: int :param questionid: item's id :type questionid: int :param answer: answer text :type answer: string(255) User ---- Getting user information ^^^^^^^^^^^^^^^^^^^^^^^^ .. http:get:: /1.1/users/{userid}/ Retrieve user information. :param userid: user's id :type userid: int **Example response**: .. sourcecode:: js { "address": { "email": "teppo.testaaja@example.com", "fullName": "Teppo Testaaja", "mobile": "+358501234567", "street": "Katuosoite", "telephone": null, "town": "Helsinki", "zip": "00100" }, "description": null, "id": 1, "lastLogin": "2015-01-16T12:24:49+0200", "links": { "alternative": "http://www.huuto.net/kayttaja/1", "favorites": "http://api.huuto.net/1.1/users/1/favorites", "feedbacks": "http://api.huuto.net/1.1/users/1/feedbacks", "purchases": "http://api.huuto.net/1.1/users/1/purchases", "sales": "http://api.huuto.net/1.1/users/1/sales", "self": "http://api.huuto.net/1.1/users/1", "settings": "http://api.huuto.net/1.1/users/1/settings" }, "roles": [ "private", "powerseller", "huutoplus-unauthenticated" ], "type": "normal", "updated": "2015-01-16T15:13:44+0200", "username": "testimies1" } .. note:: **LastLogin** is only visible for the user herself. **Address** is only visible for the user herself and for users who have sold items to the user or have bought items from the user. User Settings ^^^^^^^^^^^^^ .. http:get:: /1.1/users/{userid}/settings Retrieve user-specific parameter requirements for creating item, e.g. which parameters are allowed or required and what values are allowed for a certain parameter. :reqheader X-HuutoApiToken: token received via login (required) :param userid: user's id :type userid: int :status 403: when token is not used or it is invalid **Example response**: .. sourcecode:: js { "item": { "closingTime": { "isAllowed": false, "isRequired": false }, "condition": { "isAllowed": true, "isRequired": true }, "deliveryMethods": { "isAllowed": true, "isRequired": false }, "description": { "isAllowed": true, "isRequired": true }, "identificationRequired": { "isAllowed": false, "isRequired": false }, "image": { "isAllowed": true, "isRequired": false, "max": 5, "min": 0 }, "listTime": { "isAllowed": false, "isRequired": false }, "location": { "isAllowed": true, "isRequired": true }, "mainCategoryId": { "isAllowed": true, "isRequired": true }, "minimumFeedback": { "isAllowed": false, "isRequired": false }, "minimumIncrease": { "isAllowed": false, "isRequired": false }, "openDays": { "auction": { "isAllowed": true, "isRequired": true, "max": 14, "min": 1 }, "buyNow": { "isAllowed": true, "isRequired": true, "max": 14, "min": 1 }, "hybrid": { "isAllowed": true, "isRequired": true, "max": 14, "min": 1 } }, "paymentMethods": { "isAllowed": true, "isRequired": false }, "quantity": { "isAllowed": true, "isRequired": true, "max": 1, "min": 1 }, "republish": { "isAllowed": false, "isRequired": false }, "saleMethod": { "isAllowed": true, "isRequired": true }, "sectionCategoryId": { "isAllowed": true, "isRequired": true }, "subCategoryId": { "isAllowed": true, "isRequired": true }, "deliveryTerms": { "isAllowed": true, "isRequired": false }, "title": { "isAllowed": true, "isRequired": true } }, "updated": "2015-01-16T14:59:38+0200" } User Favorites ^^^^^^^^^^^^^^ .. http:get:: /1.1/users/{userid}/favorites Retrieve user's favorite items. Also known as "Muistilista". :param userid: user's id :type userid: int **Example response**: .. sourcecode:: js { "items": [ { "bidderCount": 0, "buyNowPrice": 40, "category": "Muistipiirit", "closingTime": "2015-09-15T22:09:35+0300", "currentPrice": 40, "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 375585570, "images": [ { "links": { "medium": "http://kuvat.huuto.net/4/b8/ea4450e9f2c4e3188c1285ef92633-m.jpg", "original": "http://kuvat.huuto.net/4/b8/ea4450e9f2c4e3188c1285ef92633-orig.jpg", "self": "http://api.huuto.net/1.1/items/375585570/images/278136565", "thumbnail": "http://kuvat.huuto.net/4/b8/ea4450e9f2c4e3188c1285ef92633-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/hp-compaq-4-x-2gb-ddr3-1333/375585570", "category": "http://api.huuto.net/1.1/categories/61", "images": "http://api.huuto.net/1.1/items/375585570/images", "self": "http://api.huuto.net/1.1/items/375585570" }, "listTime": "2015-09-01T22:09:35+0300", "location": "Helsinki", "offerCount": 0, "postalCode": "00720", "saleMethod": "buy-now", "seller": "feldon", "sellerId": 90962, "title": "HP Compaq 4 x 2GB DDR3-1333", "upgrades": [ "list-gallery", "category-gallery" ] }, { "bidderCount": 0, "buyNowPrice": 250, "category": "Renkaat ja vanteet", "closingTime": "2015-09-09T18:53:27+0300", "currentPrice": 250, "hasReservePrice": false, "hasReservePriceExceeded": false, "id": 376104306, "images": [ { "links": { "medium": "http://kuvat.huuto.net/2/3a/951c98bff9c67a3e39dbc33aafa92-m.jpg", "original": "http://kuvat.huuto.net/2/3a/951c98bff9c67a3e39dbc33aafa92-orig.jpg", "self": "http://api.huuto.net/1.1/items/376104306/images/278272979", "thumbnail": "http://kuvat.huuto.net/2/3a/951c98bff9c67a3e39dbc33aafa92-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/kitkarenkaat-opelin-muotopeltivanteilla--kapselit/376104306", "category": "http://api.huuto.net/1.1/categories/6", "images": "http://api.huuto.net/1.1/items/376104306/images", "self": "http://api.huuto.net/1.1/items/376104306" }, "listTime": "2015-09-06T18:53:27+0300", "location": "Vantaa", "offerCount": 0, "postalCode": "01420", "saleMethod": "buy-now", "seller": "Tarjah85", "sellerId": 1447584, "title": "Kitkarenkaat opelin muotopeltivanteilla + kapselit", "upgrades": [] } ], "links": { "first": "http://api.huuto.net/1.1/users/966898/favorites?page=1&status=all&limit=50", "last": "http://api.huuto.net/1.1/users/966898/favorites?page=1&status=all&limit=50", "next": null, "previous": null, "self": "http://api.huuto.net/1.1/users/966898/favorites?page=1&status=all&limit=50" }, "totalCount": 2, "updated": "2015-09-07T17:12:36+0300" } .. http:post:: /1.1/users/{userid}/favorites Add item to user's favorite list. :param userid: user's id :type userid: int :form itemid: item id :type itemid: int :status 201: when favorite successfully created **Example response**: .. sourcecode:: js { "items": [ { "bidderCount": 0, "buyNowPrice": 0, "category": "Muut ker\u00e4ilykortit", "closingTime": "2015-09-21T19:27:32+0300", "currentPrice": 250, "hasReservePrice": true, "hasReservePriceExceeded": false, "id": 376233017, "images": [ { "links": { "medium": "http://kuvat.huuto.net/8/84/1af4c97ca870c2596258e067fe153-m.jpg", "original": "http://kuvat.huuto.net/8/84/1af4c97ca870c2596258e067fe153-orig.jpg", "self": "http://api.huuto.net/1.1/items/376233017/images/278306476", "thumbnail": "http://kuvat.huuto.net/8/84/1af4c97ca870c2596258e067fe153-s.jpg" } } ], "links": { "alternative": "http://www.huuto.net/kohteet/jokerit-jani-rita-kauden-2015-2016-preaseason-gameworn/376233017", "category": "http://api.huuto.net/1.1/categories/219", "images": "http://api.huuto.net/1.1/items/376233017/images", "self": "http://api.huuto.net/1.1/items/376233017" }, "listTime": "2015-09-07T19:27:32+0300", "location": "Helsinki", "offerCount": 0, "postalCode": "00740", "saleMethod": "auction", "seller": "kakkumaa", "sellerId": 2263324, "title": "Jokerit jani rita kauden 2015-2016 preaseason gameworn", "upgrades": [] } ], "links": { "self": "http://api.huuto.net/1.1/users/966898/favorites/376233017", "user": "http://api.huuto.net/1.1/users/966898" }, "updated": "2015-09-08T13:24:44+0300" } User Feedbacks ^^^^^^^^^^^^^^ .. http:get:: /1.1/users/{userid}/feedbacks Retrieve user feedbacks. :param userid: user's id :type userid: int **Example response (shortened)**: .. sourcecode:: js { "totalCount": 3, "updated": "2015-01-16T15:16:09+0200" "title": "Huuto.net user feedbacks", "links": { "first": "http://api.huuto.net/1.1/users/1/feedbacks?page=1", "last": "http://api.huuto.net/1.1/users/1/feedbacks?page=1", "next": null, "previous": null, "self": "http://api.huuto.net/1.1/users/1/feedbacks?page=1", "user": "http://api.huuto.net/1.1/users/1" }, "summary": { "balance": 0, "feedbackCount": 3, "negativeCount": 2, "negativePercent": 67, "neutralCount": 1, "neutralPercent": 33, "positiveCount": 0, "positivePercent": 0 }, "feedbacks": [ { "links": { "author": "http://api.huuto.net/1.1/users/1", "item": "http://api.huuto.net/1.1/items/314243090", "self": "http://api.huuto.net/1.1/users/2094147/feedbacks/45454952", "user": "http://api.huuto.net/1.1/users/2094147" }, "answer": null, "author": "testimies1", "created": "2014-06-05T19:37:36+0300", "feedback": "feedback text", "id": 45454952, "rating": 1, "role": 2 }, ... ] } User Purchases ^^^^^^^^^^^^^^ .. http:post:: /1.1/users/{userid}/purchases/ Retrieve items which user has bidded or purchased. :reqheader X-HuutoApiToken: token received via login (required) :param post_id: post's unique id :type post_id: int :param userid: user's id :type userid: int :param status: item's status - options: ``open``, ``closed``, ``processing``, ``all`` :type status: string User Sales ^^^^^^^^^^ .. http:get:: /1.1/users/{userid}/sales/ Retrieve items created by user. :reqheader X-HuutoApiToken: token received via login (required) :param userid: user's id :type userid: int :param republished: If item is republished or not. Effective only if status "open" or "closed" is used at the same time. :type republished: int - set eg. to 1 to enable filter :param sold: If item is sold or not. Effective only if status "open" or "closed" is used at the same time. :type sold: int (0 or 1) :param status: item status :type status: string - ``all``, ``open``, ``closed``, ``waiting``, ``draft`` :param sort: result set sorting :type sort: string - ``bidders``, ``closing-time``, ``current-price``, ``list-time`` :param page: result page number :type page: int