Spécifications API du service Query
Le service Query utilise une API REST pour les commandes et les communications. Il y a deux spécifications que vous pouvez utiliser : L'API version 2 destinée à être utilisée avec les vitrines React et une spécification de la version 1 conçue pour la rétrocompatibilité.
Dans ce document
Référence Swagger du service Query
Une interface Swagger vers les nœuds finaux du service Query est disponible dans l'API REST Query. Vous pouvez utiliser Swagger comme référence rapide à l'API et à ses paramètres. Dans ce document, les détails et la logique de l'API sont explorés un peu plus en détail.
API de vitrine de la version 2
Lorsque vous explorez API REST Query, vous constatez que certaines classes ont "V2" comme préfixe. Il s'agit d'appels API spécifiques aux vitrines React. Ils ne s'appliquent pas aux magasins Aurora. Les classes qui n'ont pas "V2" comme préfixe sont des appels de la version 1.
Les API de la version 2 combinent les fonctionnalités à partir d'un certain nombre de classes de la version 1 distinctes. La table suivante fournit des liens vers des spécifications et des échantillons pour chaque classe V2. La table indique chaque nom d'API, les nœuds finaux de la version 1 qu'elle inclut et une liste de paramètres qui peuvent être utilisés avec elle. Chaque paramètre peut prendre en charge plusieurs valeurs.
| Type | URL de nœud final de l'API V1 | URL de nœud final de l'API V2 | Paramètres d'API V2 | Exemples |
|---|---|---|---|---|
| Catégories |
/search/resources/store/{id}/categoryview/{categoryIdentifier} /search/resources/store/{id}/categoryview/@top /search/resources/store/{id}/categoryview/byId/{categoryId} /search/resources/store/{id}/categoryview/byIdentifiers /search/resources/store/{id}/categoryview/byIds /search/resources/store/{id}/categoryview/byParentCategory/{parentCategoryId} |
/search/resources/api/v2/categories | Obligatoire :
Facultatif :
|
|
| Produits |
/search/resources/store/{id}/productview/{partNumber} /search/resources/store/{id}/productview/byCategory/{categoryId} /search/resources/store/{id}/productview/byId/{productId} /search/resources/store/{id}/productview/byIds /search/resources/store/{id}/productview/byPartNumber/{partNumber} |
/search/resources/api/v2/products | Obligatoire :
Facultatif :
|
|
| URL de référencement |
/search/resources/store/{id}/sitecontent/categorySuggestions /search/resources/store/{id}/sitecontent/keywordSuggestionsByTerm/{term} |
/search/resources/api/v2/urls | Obligatoire :
Facultatif :
Note: Ce nœud final ne prend pas en charge la création de facettes, le tri ou la pagination ; il s'agit simplement d'une recherche par service d'identificateur. |
Exemples d'API React
- Exemple 1 de catégories
- URL demande :
OuGET /api/v2/categories?storeId=1&identifier=Apparel or GET /api/v2/categories?storeId=1&identifier=Women%20Shirts%20Blouses,Dresses,Apparel v1 equivalent: /search/resources/store/{id}/categoryview/{categoryIdentifier} /search/resources/store/{id}/categoryview/byIdentifiers
En-tête de requête :GET /api/v2/categories?storeId=1&id=10002 or GET /api/v2/categories?storeId=1&id=10002,10001,1 v1 equivalent: /search/resources/store/{id}/categoryview/byId/{categoryId} /search/resources/store/{id}/categoryview/byIds
Corps de la réponse :accept: application/json{ "contents": [ { "id": "10001", "name": "Dresses", "identifier": "Dresses", "description": "Dresses", "thumbnail": "images/catalog/apparel/women/category/catr_wcl_dresses.png", "seo": { "href": "/shop/apparel/women/dresses" }, "links": { "self": { "href": "/api/v2/categories?storeId=1&id=10001" }, "parent": { "href": "/api/v2/categories?storeId=1&id=3" } } }, { "id": "10002", "name": "Blouses", "identifier": "Women Shirts Blouses", "description": "Blouses", "thumbnail": "images/catalog/apparel/women/category/catr_wcl_blouses.png", "seo": { "href": "/shop/apparel/women/blouses" }, "links": { "self": { "href": "/api/v2/categories?storeId=1&id=10002" }, "parent": { "href": "/api/v2/categories?storeId=1&id=3" } } }, { "id": "1", "name": "Apparel", "identifier": "Apparel", "description": "The latest styles for the entire family.", "thumbnail": "images/catalog/apparel/women/category/catr_wcl_pants.png", "seo": { "href": "/shop/apparel" }, "links": { "self": { "href": "/api/v2/categories?storeId=1&id=1" }, "children": [ { "href": "/api/v2/categories?storeId=1&id=2" }, { "href": "/api/v2/categories?storeId=1&id=3" }, { "href": "/api/v2/categories?storeId=1&id=4" }, { "href": "/api/v2/categories?storeId=1&id=5" } ] } } ] } - Exemple 2 de catégories
- URL demande :
En-tête de requête :GET /api/v2/categories?storeId=1&depthAndLimit=-1,-1 v1 equivalent: /search/resources/store/{id}/categoryview/@top
Corps de la réponse :accept: application/json
En-tête de réponse :{ "contents": [ { "id": "1", "name": "Apparel", "identifier": "Apparel", "description": "The latest styles for the entire family.", "thumbnail": "images/catalog/apparel/women/category/catr_wcl_pants.png", "seo": { "href": "/shop/apparel" }, "children": [ { "id": "2", "name": "Men", "identifier": "Men", "description": "Men", "thumbnail": "images/catalog/apparel/men/category/catr_app_men.png", "seo": { "href": "/shop/apparel/men" }, "children": [ { "href": "/api/v2/categories?storeId=1&id=10013" }, { "href": "/api/v2/categories?storeId=1&id=10012" }, { "href": "/api/v2/categories?storeId=1&id=10011" }, { "href": "/api/v2/categories?storeId=1&id=10010" }, { "href": "/api/v2/categories?storeId=1&id=10014" } ] }, { "id": "5", "name": "Girls", "identifier": "Girls", "description": "Girls", "thumbnail": "images/catalog/apparel/girls/category/catr_app_girls.png", "seo": { "url": "/shop/apparel/girls" }, "children": [ { "href": "/api/v2/categories?storeId=1&id=10015" }, { "href": "/api/v2/categories?storeId=1&id=10016" }, { "href": "/api/v2/categories?storeId=1&id=10017" }, { "href": "/api/v2/categories?storeId=1&id=10018" } ] }, { "id": "4", "name": "Boys", "identifier": "Boys", "description": "Boys", "thumbnail": "images/catalog/apparel/boys/category/catr_app_boys.png", "seo": { "url": "/shop/apparel/boys" }, "children": [ { "href": "/api/v2/categories?storeId=1&id=10019" }, { "href": "/api/v2/categories?storeId=1&id=10020" }, { "href": "/api/v2/categories?storeId=1&id=10021" } ] }, { "id": 3, "name": "Women", "identifier": "Women", "description": "Women", "thumbnail": "images/catalog/apparel/women/category/catr_app_women.png", "seo": { "url": "/shop/apparel/women" }, "children": [ { "href": "/api/v2/categories?storeId=1&id=10003" }, { "href": "/api/v2/categories?storeId=1&id=10007" }, { "href": "/api/v2/categories?storeId=1&id=10008" }, { "href": "/api/v2/categories?storeId=1&id=10002" }, { "href": "/api/v2/categories?storeId=1&id=10006" }, { "href": "/api/v2/categories?storeId=1&id=10001" }, { "href": "/api/v2/categories?storeId=1&id=10004" }, { "href": "/api/v2/categories?storeId=1&id=10005" } ] } ] }, { ... rest of top categories ... } ] }content-type: application/json;charset=UTF-8 date: Sun, 02 Feb 2020 22:15:28 GMT transfer-encoding: chunked - Exemple 1 de produits
- URL demande :
En-tête de requête :GET /api/v2/products?storeId=1&id=10046&associationType=accessories or GET /api/v2/products?storeId=1&id=10046&id=10045&associationType=accessories v1 equivalent /search/resources/store/{id}/productview/byId/{productId} /search/resources/store/{id}/productview/byIds
Corps de la réponse :accept: application/json{ "contents": [ { "id": "11907", "description": "Relaxed fit traditional cut two button suit", "type": "product", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_0819", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "seo": { "href": "/...." }, "links": { "self": { "href": "/api/v2/products?storeId=1&id=11907" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], "items": [ { "id": "11908", "description": "Relaxed fit traditional cut two button suit", "type": "item", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_081901", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], "links": { "self": { "href": "/api/v2/products?storeId=1&id=11988" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "attributes": [ { "identifier": "MenSuitsColor", "usage": "Defining", "values": [ { "identifier": "Black", "unit": { "name": "one", "id": "C62" }, "value": "Black", "id": "7000000000000000904" } ], "name": "Color", "id": "7000000000000000047" }, { "identifier": "MenSuitsSize", "usage": "Defining", "values": [ { "identifier": "40R", "unit": { "name": "one", "id": "C62" }, "value": "40R", "id": "7000000000000000908" } ], "name": "Size", "id": "7000000000000000048" } ] }, { ... rest of items ... } ], "attributes": [ { "identifier": "MenSuitsColor", "usage": "Defining", "values": [ { "identifier": "Black", "unit": { "name": "one", "id": "C62" }, "value": "Black", "id": "7000000000000000904" } ], "name": "Color", "comparable": true, "id": "7000000000000000047" }, { "identifier": "MenSuitsSize", "usage": "Defining", "values": [ { "identifier": "44L", "unit": { "name": "one", "id": "C62" }, "value": "44L", "id": "7000000000000000912" }, { "identifier": "44R", "unit": { "name": "one", "id": "C62" }, "value": "44R", "id": "7000000000000000911" }, { ... rest of attribute values ... } ], "name": "Size", "comparable": true, "id": "7000000000000000048" } ], "associations": [ { "id": "11907", "description": "Relaxed fit traditional cut two button suit", "type": "product", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_0819", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "seo": { "href": "/...." }, "links": { "self": { "href": "/api/v2/products?storeId=1&id=11907" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], } ] }, { "id": "11908", "description": "Relaxed fit traditional cut two button suit", "type": "item", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_081901", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "seo": { "href": "/...." }, "links": { "self": { "href": "/api/v2/products?storeId=1&id=11908" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], "attributes": [ { "identifier": "MenSuitsColor", "usage": "Defining", "values": [ { "identifier": "Black", "unit": { "name": "one", "id": "C62" }, "value": "Black", "id": "7000000000000000904" } ], "name": "Color", "comparable": true, "id": "7000000000000000047" }, { "identifier": "MenSuitsSize", "usage": "Defining", "values": [ { "identifier": "40R", "unit": { "name": "one", "id": "C62" }, "value": "40R", "id": "7000000000000000908" } ], "name": "Size", "comparable": true, "id": "7000000000000000048" } ] } ] } - Exemple 2 de produits
- URL demande :
En-tête de requête :/api/v2/products?storeId=1&categoryId=10001 v1 equivalent /search/resources/store/{id}/productview/byCategory/{categoryId}
Corps de la réponse :accept: application/json
En-tête de réponse :{ "total": 56, "offset": 12, "limit": 12, "next": "/api/v2/products?storeId=1&categoryId=10001&id=11909&limit=12&offset=24", "previous": "/api/v2/products?storeId=1&categoryId=10001&id=11909&limit=12&offset=0", "contents": [ { "id": "11907", "description": "Relaxed fit traditional cut two button suit", "type": "product", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_0819", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "seo": { "href": "/...." }, "links": { "self": { "href": "/api/v2/products?storeId=1&id=11907" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], "items": [ { "href": "/api/v2/products?storeId=1&id=11988" }, { "href": "/api/v2/products?storeId=1&id=11909" } ] }, ..... other products in the search result set .... { "id": "11907", "description": "Relaxed fit traditional cut two button suit", "type": "product", "parent": "/api/v2/categories/10001?storeId=1", "image": "images/catalog/apparel/men/mcl008_suits/646x1000/mcl008_0819.jpg", "buyable": true, "thumbnail": "images/catalog/apparel/men/mcl008_suits/200x310/mcl008_0819.jpg", "sku": "MCL008_0819", "name": "Hermitage Black Relaxed Fit Traditional Two Button Suit", "manufacturer": "Hermitage Collection", "seo": { "href": "/...." }, "links": { "self": { "href": "/api/v2/products?storeId=1&id=11908" }, "parent": { "href": "/api/v2/categories?storeId=1&id=10001" } }, "price": [ { "usage": "Display", "currency": "USD", "value": 980 }, { "usage": "Offer", "currency": "USD", "value": 980 } ], "items": [ { "href": "/api/v2/products?storeId=1&id=11988" }, { "href": "/api/v2/products?storeId=1&id=11909" } ] } ], "facets": [ { "value": "price_USD", "name": "price_USD", "entry": [ { "count": 0, "label": "*-100.0", "value": "price_USD%3A*-100.0" }, { "count": 0, "label": "100.0-200.0", "value": "price_USD%3A100.0-200.0" }, { ... rest of facet entries ... } ] } ] }content-type: application/json;charset=UTF-8 date: Sun, 02 Feb 2020 22:15:28 GMT transfer-encoding: chunked - Exemple 1 d'URL de référencement : requête par identificateur pour une catégorie
- URL demande :
En-tête de requête :GET /api/v2/urls?storeId=12101&identifier=Bath or GET /api/v2/urls?storeId=12101&identifier=Bath,Accessories
Corps de la réponse :accept: application/json{ "contents": [ { "id": 18801, "identifier": "bath", "status": 1, "tokenName": "CategoryToken", "tokenValue": "11509", "tokenExternalValue": "Bath", "storeId": 12101, "redirectURL": "", "page": { "name": "CATEGORY_PAGE", "type": "CATEGORY_PAGE", "layout": "", "title": "Bath | Stockholm", "metaKeyword": "space, light, faucet, mirror, brush, bath, decor", "metaDescription": "Modernize your bath space with a variety of vanity fixtures and lighting options", "imageAlternateDescription": "Image for Bath from Stockholm" } }, { "id": 18804, "identifier": "accessories", "status": 1, "tokenName": "CategoryToken", "tokenValue": "11509", "tokenExternalValue": "Accessories", "storeId": 12101, "redirectURL": "", "page": { "name": "CATEGORY_PAGE", "type": "PRODUCT_LISTING_PAGE", "layout": "", "title": "Accessories | Stockholm", "metaKeyword": "makeup mirrors, style, space, bath", "metaDescription": "Accent your bath with stylish accessories and makeup mirrors", "imageAlternateDescription": "Image for Accessories from Stockholm" } ] } - Exemple 2 d'URL de référencement : demande par identificateur pour un produit
- URL demande :
En-tête de requête :GET /api/v2/urls?storeId=12101&identifier=makeup-mirror-br-acce-0001 or GET /api/v2/urls?storeId=12101
Corps de la réponse :accept: application/json
En-tête de réponse :{ "contents": [ { "id": 18501, "identifier": "makeup-mirror-br-acce-0001", "status": 1, "tokenName": "ProductToken", "tokenValue": "15733", "tokenExternalValue": "BR-ACCE-0001", "storeId": 12101, "redirectURL": "", "page": { "name": "PRODUCT_PAGE", "type": "PRODUCT_PAGE", "layout": "", "title": "Makeup Mirror | Stockholm", "metaKeyword": "Stockholm", "metaDescription": "A modern makeup mirror that sits elegantly on any bathroom counter.", "imageAlternateDescription": "Image for Makeup Mirror from Stockholm" } } ] }content-type: application/json;charset=UTF-8 date: Sun, 02 Feb 2020 22:15:28 GMT transfer-encoding: chunked