Skip to Content
1
Dec 06, 2017 at 02:59 PM

Service Layer: batch operations

2170 Views

Hi everyone,

I try to CREATE TWO BUSINESSPARTNERS IN A SINGLE BATCH REQUEST, but i recieve this error:

--batchresponse_9fmXUprC-We1M-Hp8F-kZ52-rRJnN06M6gxQ
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=utf-8
Content-Length: 129

{
"error" : {
"code" : -1,
"message" : {
"lang" : "en-us",
"value" : "BadFormat"
}
}
}
--batchresponse_9fmXUprC-We1M-Hp8F-kZ52-rRJnN06M6gxQ--

I've just copied the sample of documentation:

POST https://server:port/b1s/v1/$batch

Header: Content-Type - multipart/mixed;boundary=batch_MyBatch1

Body:

--batch_MyBatch1

Content-Type:application/http
Content-Transfer-Encoding:binary

POST /b1s/v1/BusinessPartners
Content-Type: application/json
{"CardCode": "B1DevELB1", "CardName": "B1 Development eLearning batch B1", "CardType": "cCustomer"}

--batch_MyBatch1

Content-Type: application/http
Content-Transfer-Encoding: binary

POST /b1s/v1/BusinessPartners
Content-Type: application/json
{"CardCode": "B1DevELB2", "CardName": "B2 Development eLearning batch B2", "CardType": "cCustomer"}

--batch_MyBatch1--

The response Status is “202 Accepted”, but I have this error and any of customers have been created.

Thanks in advance