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 :
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

I have the same question (0)
  • 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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans