Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

JSON Batch Request using ODATA in D365 Finance

(0) ShareShare
ReportReport
Posted on by 300

How can you send multiple JSON Request to ODATA endpoint of Dynamics 365 Finance as I get the following error stating Content-Type must be multipart/mixed? Is this supported?

Note: When try to send request based on this example, it works. However I am looking at JSON Request (more than 1 record)

pastedimage1641990392376v1.png

If yes, how do we send  JSON batch request body to D365 Finance? Any pointers will be really helpful.

Categories:
  • Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    I was not successful with JSON multiple batch request.

    Only multipart/mixed content type it worked

  • vinod777 Profile Picture
    35 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    Hi Santosh, 

    are you able to post multiple records with json nody request instead of text as highlighted below

    pastedimage1664361377626v1.png

  • Suggested answer
    Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    We cannot work with JSON Batching as it's new to OData 4.0.1.

    Only ODATA v4.0 specification for batch messages only supports multipart/mixed requests with plain text body.

  • nunomaia Profile Picture
    10,682 Moderator on at
    RE: JSON Batch Request using ODATA in D365 Finance
    [quote user="Santosh Ramamurthy"]

    It's via batch. Don't want to perform record by record.

    [/quote]

    A Batch request It's a single HTTP request with all the records. You need is to group multple inserts in a single batch request.  

  • Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    Batching Microsoft Graph API Requests with JSON Batching: blog.kloud.com.au/.../

    This typically allows JSON Batching using GRAPH API; In similar lines can it be done on D365 Finance or is it the only way as per your blog is what I would like to know.

  • Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    It's via batch. Don't want to perform record by record.

  • nunomaia Profile Picture
    10,682 Moderator on at
    RE: JSON Batch Request using ODATA in D365 Finance

    From Odata spec : docs.oasis-open.org/.../odata-v4.01-part1-protocol.html

    "Batch requests allow grouping multiple individual requests into a single HTTP request payload. An individual request in the context of a batch request is a Metadata Request, Data Request, Data Modification Request"

    An insert is a Data Modification Request.

    So, you need to batch those requests in a single batch to join multiple requets.

  • Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    Okay so we can't send the way I described? It's not supported?

  • Suggested answer
    nunomaia Profile Picture
    10,682 Moderator on at
    RE: JSON Batch Request using ODATA in D365 Finance

    The OData protocol for multiple records must be submitted in a batch or record by record ( multiple requets ). For batch is a mixed content between json and request header 

  • Santosh Ramamurthy Profile Picture
    300 on at
    RE: JSON Batch Request using ODATA in D365 Finance

    The example shared is more of $batch request with multipart/mixed Content-Type. I need to understand how to parse multiple records as JSON.

    Typically example is the way output is rendered when making READ request. Similarly how can we do similar for CREATE request for pushing more than 1 records as JSON format?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

Overall leaderboard

Product updates

Dynamics 365 release plans