Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Creating a work order using API (online)

Posted on by
I am trying to create a work order by using API post method but it gives me a 400 error ( bad request). 
 
the error msg as follow: 
{/error/:{/code/:/0x80048d19/,/message/:/Error identified in Payload provided by the user for Entity ://'msdyn_workorders//'.............}
 
I am using the following code:
url = https://Dynamic365-instiance/api/data/v9.2/msdyn_workorders/
headers = {
    /Content-Type/: /application/json; charset=utf-8/,
    /Accept/: /application/json/,
}
payload = {
    /msdyn_name/: /Work Order Name/,
    /msdyn_serviceaccount@odata.etag/: //accounts(bda958a1-7ff7-4f69-9812-83d77efe0cc8)/,
    /msdyn_primaryincidentdescription/: /Issue description/,
    /msdyn_serviceTerritory@odata.etag/: //territories(6ad7533b-8e0a-ea11-a811-000d3a1b1f2c)/,
}
requests.request(/POST/, url, headers=headers, data=payload)
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans