Here's the related info on this.
Unable to create ToDo Task using Graph API v1.0
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.
Microsoft Security | Microsoft Graph
4 answers
Sort by: Most helpful
-
Deva-MSFT 2,271 Reputation points Microsoft Employee
2020-11-26T15:50:03.447+00:00 -
Sunil Singh 1 Reputation point
2021-02-15T09:28:35.763+00:00 I am also facing the same issue
-
Rudy De Maeyer 21 Reputation points
2021-06-24T15:23:42.053+00:00 Same here. This is a major block in our progress. We already successfully managed integration of calendar events, and assumed the todotasks would work too...
-
George Samy 1 Reputation point
2022-10-04T13:59:28.75+00:00 What worked for me was setting the Odatatype to nil, in my golang code:
requestBody.SetOdataType(nil)
Found the solution at https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/909#issuecomment-782212535