【发布时间】:2017-06-14 09:55:06
【问题描述】:
我正在调用 Rest API V1/products 从 Magento 2 商店获取产品列表
请求:
http://{myMagentohost}/Magento/index.php/rest/V1/products?searchCriteria[currentPage]=1&searchCriteria[pageSize]=1
回复:
{"items": [ { "id": 1,"sku": "24-MB01","name": "Joust Duffle Bag","attribute_set_id": 15,"price": 34,"status": 1,"visibility": 4,"type_id": "simple","created_at": "2017-06-13 09:36:11","updated_at": "2017-06-13 09:36:11","product_links": [{"sku": "24-MB01", "link_type": "upsell","linked_product_sku": "24-MB03","linked_product_type": "simple","position": null,"extension_attributes": []},{"sku": "24-B01","link_type": "upsell","linked_product_sku": "24-WB04","linked_product_type": "simple","position": null,"extension_attributes": []}],"options": [],"tier_prices": [],"custom_attributes": [{"attribute_code": "description","value": "<p>The sporty Joust Duffle Bag can't be beat - ot in the gym, not on the luggage carousel, not anywhere. Big enough to haul a basketball or soccer ball and some sneakers with plenty of room to spare, it's ideal for athletes with places to go.<p>\n<ul>\n<li>Dual top handles.</li>\n<li>Adjustable shoulder strap.</li>\n<li>Full-length zipper.</li>\n<li>L 29\" x W 13\" x H 11\".</li>\n</ul>"},{"attribute_code": "image","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "small_image","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "thumbnail","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "url_key","value": "joust-duffle-bag"}]}],"search_criteria": {"filter_groups": [],"page_size": 1,"current_page": 1},"total_count": 2046}
现在根据 Magento 2 Rest API swagger 文档, catalogProductRepositoryV1, GET /V1/products 作为响应它显示了 extension_attributes 但是当我实际从邮递员调用这个 api 时 extension_attributes 丢失了。
我正在搜索它,但没有合适的解决方案。
谁能帮忙解决这个问题?
谢谢!
【问题讨论】:
标签: rest product catalog magento-2.0