API v3, create new event in C# ?

5,955 views
Skip to first unread message

Volkan Senguel

unread,
Sep 4, 2012, 9:48:15 AM9/4/12
to google-ca...@googlegroups.com
Hi, i'm new here with google calendar v3 api.
 
I have tryed to create a event on a test calendar and it hapens nothing, no exception and no entry :(
 
My test code is this:
 

using Google.GData.Client;
using Google.Apis.Calendar.v3.Data;

using Google.GData.Client;
using Google.Apis.Calendar.v3.Data;

private void TestEvent()
 {
  try(
   Service service = new Service("cl", "MyTestApp");
   service.setUserCredentials("userName", "password");
    
   Google.Apis.Calendar.v3.CalendarService g = new Google.Apis.Calendar.v3.CalendarService();
   Google.Apis.Calendar.v3.Data.Event ev = new Google.Apis.Calendar.v3.Data.Event();

   EventDateTime start = new EventDateTime();
   start.DateTime = "09/09/2012 15:00";

   EventDateTime end = new EventDateTime();
   end.DateTime = "09/09/2012 18:00";

   //ev.Title < ?????
   ev.Start = start;
   ev.End = end;
   ev.Description = "Description...";
   g.Events.Insert(ev, "sdfskdjfj3...@group.calendar.google.com");
   }   
   catch( Exception ex)
   {
   string error = ex.Message;
   }
 }

 

What is wrong here, and how can i define the title of the event?

Thank you for any help.

Volkan

Andrew Truckle

unread,
Sep 18, 2012, 5:22:31 PM9/18/12
to google-ca...@googlegroups.com
Did any one help? There seems to be so many questions about V3 and not alot of direct responses for us users. :(
 
I gave up on V3.
 
Hope you got it working.

--
You received this message because you are subscribed to the Google Groups "Google Calendar API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-calendar-api/-/-E9H7ETWAe8J.
To post to this group, send email to google-ca...@googlegroups.com.
To unsubscribe from this group, send email to google-calendar...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-calendar-api?hl=en.

Czarek Żurawski

unread,
Sep 24, 2012, 6:11:49 AM9/24/12
to google-ca...@googlegroups.com
There is a necesity to authenticate against google using for example OAUTH2 trying to use API v.3
I'm using php version of library but i'm sure in this version you can't authenticate using only credentials.
mixing GData protocol inside API v3 is not allowed
did you read documentation?
it says directly what classes use to authenticate:

You can now import the classes you will need using the following statements:

using Google.Apis.Authentication;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Calendar.v3;
using Google.Apis.Calendar.v3.Data;

link for you
https://developers.google.com/google-apps/calendar/instantiate
good luck
hesar
To unsubscribe from this group, send email to google-calendar-api+unsub...@googlegroups.com.

Himanshu Jain

unread,
Jul 15, 2013, 12:41:07 AM7/15/13
to google-ca...@googlegroups.com
i am using ASP.NET C# for implementing Google Calendar V3. I am getting a problem of "Missing system.net.http.primities".Kindly check the below details.

var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description);
        provider.ClientSecret = "gguLpZVVfu9X-yxGVYb6VIWt";
        var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, GetAuthentication);
        Google.Apis.Services.BaseClientService.Initializer initt = new Google.Apis.Services.BaseClientService.Initializer();
        initt.Authenticator = auth;
        CalendarService service = new CalendarService(initt);

Himanshu Jain

unread,
Jul 18, 2013, 12:21:41 AM7/18/13
to google-ca...@googlegroups.com
If i am using the method that is specified in https://developers.google.com/google-apps/calendar/instantiate then it showing an error that AuthenticatorFactory is unknown and one more error that in below mentioned code it is generating an error of providing wrong parameters to OAuth2Authenticator. Accorning to me OAuth2Authenticator should takes two parameters first one is for Application name and Second one is for OAuth2AuthenticatorParameters. So please help me out from this.
AuthenticatorFactory.GetInstance().RegisterAuthenticator(() => new OAuth2Authenticator(provider, GetAuthentication));
Message has been deleted

Himanshu Jain

unread,
Oct 7, 2013, 1:19:26 AM10/7/13
to google-ca...@googlegroups.com
You are passing the wrong date format your dormat should be YYYY-MM-DDTHH:mm:ss.000Z


On Mon, Oct 7, 2013 at 2:40 AM, Péter Kadosa <kadosa...@gmail.com> wrote:
service.Events.Insert(event, CalendarId).Execute();

"EXECUTE ();" !!!

ev.Summary = "My Event Title"

i hope this help

--
You received this message because you are subscribed to the Google Groups "Google Calendar API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-calendar...@googlegroups.com.

To post to this group, send email to google-ca...@googlegroups.com.



--
Himanshu Jain
Reply all
Reply to author
Forward
0 new messages