web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Batch Insert to Custom Entity via HTTP

(0) ShareShare
ReportReport
Posted on by 5

Hi all

I have been having an issue getting batch inserts working to a custom entity via the rest api. To my eye, this is correct according to the documentation. I get a 200 OK back but no rows are created. 

My custom entity is called custom_users. So the collection name comes out as custom_userses

I can easily do a single insert for a row to the entity via /api/data/v9.0/custom_userses so I know the entity exists and is fine. 



Request Headers

https://.dynamics.com/api/data/v9.2/$batch

'Content-Type': 'multipart/mixed;boundary=batch_22975cad-7f57-410d-be15-6363209367ea', 
'OData-MaxVersion': '4.0', 
'OData-Version': '4.0', 
'Prefer': 'odata.include-annotations="*",return=representation', 
'Accept': 'application/json'

This is the request body

 --batch_AAA123
Content-Type: multipart/mixed;boundary=changeset_BBB456

--changeset_BBB456
Content-Type: application/http
Content-Transfer-Encoding:binary
Content-ID: 1

POST /api/data/v9.2/custom_userses HTTP/1.1
Content-Type: application/json;type=entry

{
    "id":"614515",
    "username":"oldmate1",
    "firstname":"Old",
    "lastname":"Mate"
}


Any help would be really great. 

I have the same question (0)
  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at

    Hi,

    Your batch id in boundary=batch_22975cad-7f57-410d-be15-6363209367ea must match the  --batch_AAA123 (delimiter of each entry)

    In your snippet, 22975cad-7f57-410d-be15-6363209367ea is not equal to AAA123

    Could you try with  --batch_22975cad-7f57-410d-be15-6363209367ea

    Note that you need to end with --batch_22975cad-7f57-410d-be15-6363209367ea-- (two -- here!)

    A full example is available in this documentation : learn.microsoft.com/.../execute-batch-operations-using-web-api

  • Suggested answer
    KurtD Profile Picture
    5 on at

    That worked perfectly. Thank you for your help!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans