What I get :
http://example.com/index.php/rest/V1/categories/263/products
[{
"sku": "20130",
"position": 1,
"category_id": "263"
},
{
"sku": "20134",
"position": 1,
"category_id": "263"
},
]
What I want :
http://example.com/index.php/rest/V1/categories/263/products
[{
entity_id: "2"
type_id: "simple"
sku: "Levis Bagpack"
description: "Bagpack"
short_description: "Bagpack"
meta_keyword: null
name: "Levis Bagpack"
meta_title: null
meta_description: null
regular_price_with_tax: 45
regular_price_without_tax: 45
final_price_with_tax: 45
final_price_without_tax: 45
is_saleable: true
image_url: "http://example.com/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg"
},
{
entity_id: "3"
type_id: "simple"
sku: "Levis Bagpack Silver"
description: "Bagpack Silver"
short_description: "Bagpack Silver"
meta_keyword: null
name: "Levis Bagpack Silver"
meta_title: null
meta_description: null
regular_price_with_tax: 45
regular_price_without_tax: 45
final_price_with_tax: 45
final_price_without_tax: 45
is_saleable: true
image_url: "http://example.com/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg"
}
]
-
Create your own API which extend of the native implementation/interface or extend the current API in a custom module. – Franck Garnier Nov 25 '16 at 13:03
Create your own API in a custom module.
Base on this native implementation :
\Magento\Catalog\Model\CategoryLinkManagement::getAssignedProducts
Load product data
Create your custom \Magento\Catalog\Api\Data\CategoryProductLinkInterface
to expose your custom product values
About image URL, you need to emulate the frontend area in order to generate the correct path.
Be careful about performance issue.