I have .dotnet core web application. I'm trying to add event by Google Calendar Api but getting error. The error
Google.Apis.Requests.RequestError Forbidden [403] Errors [ Message[Forbidden] Location[ - ] Reason[forbidden] Domain[global] ]
My code is
Event myEvent = new Event
{
Summary = "Appointment",
Location = "Dhaka",
Start = new EventDateTime()
{
DateTime = new DateTime(2018, 9, 17, 10, 0, 0),
TimeZone = "Asia/Dhaka"
},
End = new EventDateTime()
{
DateTime = new DateTime(2018, 9, 17, 10, 30, 0),
TimeZone = "Asia/Dhaka"
},
Recurrence = new String[] {
"RRULE:FREQ=WEEKLY;BYDAY=MO"
},
Attendees = new List<EventAttendee>()
{
new EventAttendee() { Email = "[email protected]" }
}
};
var newEventRequest = calendarService.Events.Insert(myEvent, calendarId);
var eventResult = newEventRequest.Execute();
It's getting error when execute run. By using same calendar service I had got calendar and event list successfully but can't adding event. Any one can help?