I am trying to create leave requests in Dynamics HR programmatically using C# submitting JSON requests via the API.
I am submitting a JSON request to the Dynamics URL/namespace and "data/LeaveRequests" address. Sometimes it creates a leave request fine, so it definitely works ok on occasion. Most times it just says "record already exists". However a leave request on the leave date requested for the person definitely does not exist. So what record exists exactly (the error doesn't say)? Sometimes the submission works, but mostly it doesn't
{
"dataAreaId": "org",
"LeaveType": "Annual Leave",
"LeaveDate": "2021-02-11T00:00:00Z",
"PersonnelNumber": "10045",
"RequestDate": "2021-01-01T06:45:23Z",
"Comment": "Test comment",
"Status": "Completed",
"Amount": 1,
"HalfDayDefinition": "None"
}
Does anyone have any example of create leave request via the api? and also for multiple days?
I also tried adding leave requests via the Dynamics HR interface and this can also result in the record already exists message.
Any help greatly appreciated.