I'm tying to write a batch OCAPI.
In one of the sub request, I would like to use the product_search and variant_search OCAPI.
All settings in the sandbox are correct, the two OCAPI works perfectly if I use them separately.
I receive an error only if I'm using them in a batch.
Here is my request:
POST /s/-/dw/batch?client_id=xxx HTTP/1.1
Host: xxx-alliance-prtnr-eu09-dw.demandware.net
Content-Type: multipart/mixed; boundary=23dh3f9f4
Authorization: Bearer xxx
--23dh3f9f4
x-dw-content-id: req4
x-dw-http-method: POST
x-dw-resource-path-extension: /s/-/dw/data/v18_8/product_search
{
"query" : {
"text_query": {
"fields": ["id"],
"search_phrase": "73910432"
}
},
"select" : "(hits.(product_id))"
}
--23dh3f9f4
x-dw-http-method: POST
x-dw-content-id: req3
x-dw-resource-path: /s/-/dw/data/v18_8/products/
x-dw-resource-path-extension: 73910432/variant_search
{
"query": {
"text_query": {
"fields": [
"variation_attribute.size"
],
"search_phrase": "34"
}
},
"select": "(hits.(product_id,variation_values))"
}
--23dh3f9f4--
The response from the server:
--23dh3f9f4
x-dw-content-id: req4
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 95
Cache-Control: no-cache
x-dw-status-code: 500
{"_v":"18.8","fault":{"type":"InternalServerErrorException","message":"Internal Server Error"}}
--23dh3f9f4
x-dw-content-id: req3
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
Content-Length: 215
Cache-Control: no-cache
x-dw-status-code: 400
{"_v":"18.8","fault":{"arguments":{"parameter":"Body"},"type":"NullConstraintViolationException","message":"The null value constraint for parameter 'Body' is violated. Null is not allowed. Please provide a value."}}
--23dh3f9f4--
Any idea?
Thanks for hour help,