Hi,
I am having an error when using the Microsoft Graph. I am using the .NET SDK version 5.19.0.
I am using the Graph with the application permissions: Task.ReadAll, Task.ReadWriteAll
I am trying to create or update a PlannerDetails item which is a ChecklistItem using the code below:
public async Task<PlannerTask> InsertTarefa(string bucketId, string idPlanner, Dictionary<string, string> conteudoTask)
{
GraphServiceClient graphClient = CriarGraphClient(await gah.ObterTokenGraphAsync());
var requestBody = new PlannerTask
{
PlanId = idPlanner,
BucketId = bucketId,
Title = conteudoTask["titulo"],
DueDateTime = DateTime.Parse(conteudoTask["dataFim"]),
StartDateTime = DateTime.UtcNow,
Details = new PlannerTaskDetails
{
Description = conteudoTask["descricao"],
Checklist = new PlannerChecklistItems()
{
AdditionalData = new Dictionary<string, object>
{
{
"95e27074-6c4a-447a-aa24-9d718a0b86fa", new
{
OdataType = "microsoft.graph.plannerChecklistItem",
Title = "Update task details",
IsChecked = true
}
}
}
}
}
};
try
{
return await graphClient.Planner.Tasks.PostAsync(requestBody);
}
catch (ODataError error)
{
Console.WriteLine(error.Error.Message);
throw new Exception(error.Error.Message);
}
}
I used the example on the Learn website to create my request:
https://learn.microsoft.com/pt-br/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=csharp
I always get the following error:
"The request is invalid:\r\nValue cannot be null.\r\nParameter name: qualifiedName"
I have tried to search for information on these issues and the most I could find was addressed in this issue:
https://learn.microsoft.com/en-us/answers/questions/1192857/planner-task-assigned-to-user-using-graph-api
In the above case, the parameter has a corresponding class. The checklist parameter does not.