Unable to Create Event -Google.Apis.Requests.RequestError Not Found [404] Errors [ Message[Not Found] Location[ - ] Reason[notFound] Domain[global]

2,091 views
Skip to first unread message

Alka Shukla

unread,
Jun 16, 2015, 10:25:49 AM6/16/15
to google-ca...@googlegroups.com, viveksa...@gmail.com

String serviceAccountEmail = "....................................@developer.gserviceaccount.com";
             
var certificate = new X509Certificate2(DemelerResource.Sample_de2334d727a5, "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);

  ServiceAccountCredential credential = new ServiceAccountCredential(
   new ServiceAccountCredential.Initializer(serviceAccountEmail)
   {
       Scopes = new[] { CalendarService.Scope.Calendar },
       User = ".............@Sample.com"

   }.FromCertificate(certificate));


//  Create the service. 
gService = new CalendarService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
    ApplicationName = "App Sample",
});


//Code For Create Event

Event newEvent = new Event()

{
    Summary = "Today ",
    Location = "RoomAddress",
    Description = "Today",
    Organizer = User,


    Start = new EventDateTime()

    {
        DateTime = DateTime.Now,
       
        TimeZone = "America/Phoenix"
    },

    End = new EventDateTime()
    {
        DateTime = DateTime.Now.AddHours(1),
       
        TimeZone = "America/Phoenix"
    }

};

string url =  @"https://www.googleapis.com/calendar/v3/calendars/"+  "RoomA...@Sample.com" + "/events";

Event insertedEvent = gService.Events.Insert(newEvent, url).Execute();





Pls response me as soon as possible regarding this issue. Thanks  

Lucia Fedorova

unread,
Jun 23, 2015, 7:32:20 PM6/23/15
to google-ca...@googlegroups.com, alka....@demeler.com, viveksa...@gmail.com
Hi Alka,
one obvious issue is that you are passing in a url as the second argument while the expected argument is a calendar ID (so the room email). There might be more problems if you haven't correctly configured authority delegation for the domain but let's sort one thing at a time.
Reply all
Reply to author
Forward
0 new messages