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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Web API POST, create two records at once?

(0) ShareShare
ReportReport
Posted on by 5

Hello,

I am testing Dynamics 365 CRM web API calls with Postman.

Using this URI: https://<mysite>.crm.dynamics.com/api/data/v8.2/contacts

If I POST this JSON code:

{
"firstname": "Joe",
"lastname": "Doakes"
}

The new contact record is created perfectly.

But if I try to POST an array of two records:

[
{
"firstname": "Joe",
"lastname": "Doakes"
},
{
"firstname": "John",
"lastname": "Doakes"
}
]

I get this error: "An unexpected 'StartArray' node was found when reading from the JSON reader. A 'StartObject' node was expected."

Is it not possible to post more that one record at a time?  Or is my syntax faulty?

Thanks for any help on this.

Bryan Hunt

*This post is locked for comments

  • Verified answer
    Ben John Profile Picture
    559 on at

    Hi Bryan,

    you need to use a batch request to create multiple records of the same type in same operation.
    MSDN: Execute batch operations using the Web API

    Regards,
    Ben

  • ccnwo Profile Picture
    5 on at

    Thanks Ben.  I had seen that article, but wasn't sure if it was strictly for transactional integrity, or if it pertained to any form of batched inserts/updates.

    Now that I know that it is the only supported method for multi-record updates, I will incorporate it into my code.

    Bryan Hunt

  • Community Member Profile Picture
    on at

    Hi Bryan,

    I am trying to create contact in MS CRM using postman . i have done the same thing but getting 401 unauthorised error. i am using basic authentication. Can you help me here.

    Rinkesh Rathor  

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
TNJ_CRM_Team Profile Picture

TNJ_CRM_Team 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans