I am trying to use the ToDo Task feature of graph api v1.0 to create a task using the following code
var result = graphServiceClient.Users[outlookUserId].Todo.Lists[listid].Tasks.Request().AddAsync(todoTask).Result;
However, I am getting the following the error:
Code: invalidRequest
Message: A type named 'microsoft.toDo.todoTask' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
Inner error:
Code: InvalidModel
AdditionalData:
date: 2020-11-25T09:41:04
request-id: 39794548-8f63-443e-a8bc-76ad6091dc8d
client-request-id: 39794548-8f63-443e-a8bc-76ad6091dc8d
ClientRequestId: 39794548-8f63-443e-a8bc-76ad6091dc8d
To resolve above, I had set the odatatype of todoTask to null, but got another exception:
Code: invalidRequest
Message: A type named 'microsoft.toDo.dateTimeTimeZone' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
Inner error:
Code: InvalidModel
AdditionalData:
date: 2020-11-25T09:43:27
request-id: 0780add8-3f17-40c5-a92b-e9e62ad08bf8
client-request-id: 0780add8-3f17-40c5-a92b-e9e62ad08bf8
ClientRequestId: 0780add8-3f17-40c5-a92b-e9e62ad08bf8
To resolve above I set the odatatype of all data members of todoTask of type DateTimeZone to null, but then getting the following exception:
Code: invalidRequest
Message: A type named 'microsoft.toDo.itemBody' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
Inner error:
Code: InvalidModel
AdditionalData:
date: 2020-11-25T09:46:11
request-id: 5bafbcab-5090-47b5-ac8e-8c96ec1d6592
client-request-id: 5bafbcab-5090-47b5-ac8e-8c96ec1d6592
ClientRequestId: 5bafbcab-5090-47b5-ac8e-8c96ec1d6592
To resolve above, I set the odatatype of todoTask body to null, but now I am getting following exception which I am unable to resolve:
Code: generalException
Message: Internal Server Error
Inner error:
AdditionalData:
date: 2020-11-25T09:48:23
request-id: f5d52f43-c0b4-425e-83ec-652fadb7abf9
client-request-id: f5d52f43-c0b4-425e-83ec-652fadb7abf9
ClientRequestId: f5d52f43-c0b4-425e-83ec-652fadb7abf9
For our application, we need to create task and sync to outlook and since, this will go into production, we cannot use the beta version. Can anybody please help me in saving the task.