cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Odata batch persistence request payload error - Integration API

rahulverma94
Active Participant
0 Likes
799

Hi All,

I am trying to do a bulk persistence using multipart/mix content payload using odata services in integration api.
The POST request is erroring out with 400: Bad Request. Please help me understand and resolve the issue.

POST Endpoint:
https://host:<port>/odata2webservices/InboundClassificationAttribute/$batch

Request Payload Details:

--batch

Content-Type: multipart/mixed; boundary=changeset


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


POST ClassificationAttributes HTTP/1.1
Accept: application/json
Content-Type: application/json

<-- NEWLINE -->
<-- NEWLINE -->
{ "@odata.context": "$metadata#ClassificationAttributes/$entity", "code": "Case_Length", "name": "Case Length", "systemVersion": { "catalog": { "id": "bekClassificationSystem" }, "version": "V1.0" } }

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


POST ClassificationAttributes HTTP/1.1
Accept: application/json
Content-Type: application/json
<-- NEWLINE -->
<-- NEWLINE -->
{ "@odata.context": "$metadata#ClassificationAttributes/$entity", "code": "Case_Width", "name": "Case Width", "systemVersion": { "catalog": { "id": "bekClassificationSystem" }, "version": "V1.0" } }
--changeset--
--batch
Content-Type: multipart/mixed; boundary=changeset


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


POST ClassificationAttributes HTTP/1.1
Accept: application/json
Content-Type: application/json
<-- NEWLINE -->
<-- NEWLINE -->
{ "@odata.context": "$metadata#ClassificationAttributes/$entity", "code": "Case_Height", "name": "Case Height", "systemVersion": { "catalog": { "id": "bekClassificationSystem" }, "version": "V1.0" } }
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST ClassificationAttributes HTTP/1.1
Accept: application/json
Content-Type: application/json
<-- NEWLINE -->
<-- NEWLINE -->
{ "@odata.context": "$metadata#ClassificationAttributes/$entity", "code": "Case_Height", "name": "Case Height", "systemVersion": { "catalog": { "id": "bekClassificationSystem" }, "version": "V1.0" } }

--changeset--
--batch--

Response Error:

<?xml version='1.0' encoding='UTF-8'?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">Bad Request.</message>
</error>

Accepted Solutions (0)

Answers (0)