I am really confused. I am testing google task api, I can access my tasks but when I am tiring to insert a task it gives an error. in documentation this code is available, that dose not work because there is no Fetch function available.
Task task = new Task { Title = "New Task"};
task.Notes = "Please complete me";
task.Due = "2010-10-15T12:00:00.000Z";
Task result = service.Tasks.Insert(task, "@default").Fetch();
Console.WriteLine(result.Title);
I modified my code to,
Google.Apis.Tasks.v1.Data.Task task = new Google.Apis.Tasks.v1.Data.Task { Title = "five" };
task.Notes = "Please complete me";
task.Due = DateTime.Now;
Google.Apis.Tasks.v1.Data.Task result = service.Tasks.Insert(task,taskList.Id.ToString()).Execute();
Console.WriteLine(result.Title);
But I am facing an error and Execute line:
An unhandled exception of type 'Google.GoogleApiException' occurred in Google.Apis.dll
Additional information: Google.Apis.Requests.RequestError
Insufficient Permission [403]