Posted on 27/07/2022 12:41:35
Hi Nuno
The POST /dwapi/ecommerce/products andpoint and GET /dwapi/ecommerce/products/search is exactly the same.
The POST endpoint do also need the 'SearchRequest' parameters as URL parameters in this case.
The POST endpoint then takes the ProductListViewModelSettings (a json object) as a request body.
That is the same as the additional parameters that you see from the GET endpoint that needs the parameters as querystring parameters:
You are probably using the ProductIds parameter on the GET endpoint which is the same querystring parameter on the POST endpoint, so that would not change things.
But - the endpoint works like this:
- If RepositoryName and QueryName is specified, the index is searched
- If GroupID is specified, products in the group is returned
- If ProductIds is specified, products with those IDs are returned
So to use the POST endpoint with a long range of ProductIds, you can create a Query that takes a parameter for productIDs - i.e. "NunosProductIds" and then on the post endpoint, specify the repository and query and add something like this to the request body (an instance of the ProductListViewModelSettings object)
{
"Parameters":
{
"NunoProductIds":"prod1,prod2,prod3"
}
}
BR Nicolai