Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

JSON create new incident (case) against an account using the web API

(0) ShareShare
ReportReport
Posted on by 15

Hi, 

Could someone help me create a JSON script that creates a new case against a account using the WEB API?

I have created the simple script I can't figure out what I have wrong.

{

    "title":"Test Web API Case",
    "accountnumber@odata.bind":"/accounts(xxxxxxxxx)"
}
Error:
An undeclared property 'accountnumber' which only has property annotations in the payload but no property value was found in the payload.
What am I missing
  • Guido Preite Profile Picture
    Guido Preite 54,087 Super User 2024 Season 1 on at
    RE: JSON create new incident (case) against an account using the web API

    the "record" variable that is generated inside the code is a JSON format. if you need to have as a string you can do a

    console.log(JSON.stringify(record, null, "\t"));

    or you can export the collection to Postman, if you open it inside Postman you will see the JSON inside the Body tab

  • D365-221 Profile Picture
    D365-221 15 on at
    RE: JSON create new incident (case) against an account using the web API

    Thank you, this has helped so much, shame it doesn't have a JSON Format unless I am missing something but give you the details you need to figure it out.

    Working code:

    {

       "title":"Test Web API Case",

       "customerid_account@odata.bind":"/accounts({{ID}})"

    }

  • Verified answer
    Guido Preite Profile Picture
    Guido Preite 54,087 Super User 2024 Season 1 on at
    RE: JSON create new incident (case) against an account using the web API

    you can use my tool Dataverse REST Builder to create a request against Web API

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans