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)