[C#/Service] Windows Service to update calendar - Calendar API or CalDAV

1,095 views
Skip to first unread message

Markusr

unread,
Dec 1, 2011, 9:02:08 AM12/1/11
to google-ca...@googlegroups.com
Good day,

We have a proprietary calendar. I would like to write a windows service to sync the calendar TO the google app business calendar.

Should I use the Calendar API or CalDAV? How would should the service authentication in v3?

-Markus

Alain Vongsouvanh

unread,
Dec 2, 2011, 10:03:12 AM12/2/11
to google-ca...@googlegroups.com
Hello,

Please use Calendar API v3 and have a look at the Using Guide for how to authorize your requests using the .NET client library:
Alain


--
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/-/rnIGy0lvQZMJ.
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.



--
Alain Vongsouvanh | Developer Programs Engineer

Markusr

unread,
Dec 5, 2011, 12:32:11 PM12/5/11
to google-ca...@googlegroups.com
Thanks much! I guess I kept overlooking that sample!

-Markus

Markusr

unread,
Dec 6, 2011, 2:15:18 PM12/6/11
to google-ca...@googlegroups.com
I am using the sample code for .Net and getting the following errors:

Error    2    Using the generic type 'Google.Apis.Authentication.OAuth2.OAuth2Authenticator<TClient>' requires 1 type arguments    C:\scratch\OAuthDemo\OAuthDemo\Form1.cs    65    31    OAuthDemo
Error    1    The name 'AuthenticatorFactory' does not exist in the current context    C:\scratch\OAuthDemo\OAuthDemo\Form1.cs    64    13    OAuthDemo

http://code.google.com/apis/calendar/v3/using.html#client-dotnet

using VS2010, c#, .Net Framework 4

I've downloaded the latest .NET core client library and Google Calendar API .dll file.

#Markus

Dan B

unread,
Dec 6, 2011, 3:23:27 PM12/6/11
to google-ca...@googlegroups.com
I am getting the same error using using VS2010, c#, .Net Framework 4. I have tried to make a direct reference to the Authorization Factory in my code based on documentation i found while searching for a solution:

http://code.google.com/r/krishanu007-krishanu007/source/browse/Src/GoogleApis/Apis/Authentication/AuthenticatorFactory.cs?spec=svn6775c0879f8188928e1e955dbf144e037fa4fd0e&r=6775c0879f8188928e1e955dbf144e037fa4fd0e

But even with an explicit reference I get that the Authorization Factory does not exist. If any one has a solution to this, please post it.

Alain Vongsouvanh

unread,
Dec 7, 2011, 12:09:40 PM12/7/11
to google-ca...@googlegroups.com
Hello,

It seems that our documentation is out-of-date due to a new version of the client library. It will be updated later today, but in the mean time, please refer to the google-api-dotnet-client project's Getting Started guide for instantiating your client:

Best,
Alain

--
You received this message because you are subscribed to the Google Groups "Google Calendar API" group.

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.

Dan B

unread,
Dec 9, 2011, 4:58:20 PM12/9/11
to google-ca...@googlegroups.com
Works great. Thanks.

Markusr

unread,
Dec 27, 2011, 1:05:23 PM12/27/11
to google-ca...@googlegroups.com
Hey Alain,

I am still at a loss here. What I want to do is display the Google Calendar in an embedded browser, preferably without manually logging in.

How does OAuth2 help?

-Markus

Markusr

unread,
Dec 27, 2011, 5:50:26 PM12/27/11
to google-ca...@googlegroups.com
Dan,

I am getting the following error:

Google.Apis.Calendar.v3.CalendarService.Scopes' does not contain a definition for 'GetStringValue'

in:

        private static IAuthorizationState GetAuthentication(NativeApplicationClient arg)
        {
            // Get the auth URL:
            IAuthorizationState state = new AuthorizationState(new[] { Google.Apis.Calendar.v3.CalendarService.Scopes.Calendar.GetStringValue()  });
            state.Callback = new Uri(NativeApplicationClient.OutOfBandCallbackUrl);
            Uri authUri = arg.RequestUserAuthorization(state);
            ...

What am I missing?

-Markus

Markusr

unread,
Dec 27, 2011, 5:59:17 PM12/27/11
to google-ca...@googlegroups.com
found it...

Had to add: "using Google.Apis.Util;"

Why do I find the answer a minute after posting? :)

-Markus
Message has been deleted

Alain Vongsouvanh

unread,
Dec 28, 2011, 11:53:24 AM12/28/11
to google-ca...@googlegroups.com
Hello,

Having OAuth 2.0 working will let you retrieve events for the authenticated user's calendar. However, you will have to do the UI yourself as the API only returns data.

Best,
Alain

On Tue, Dec 27, 2011 at 3:00 PM, Markusr <mris...@gmail.com> wrote:
Ok, I have google OAuth2 working. How do I visually display the user's calendar?


-Markus

--
You received this message because you are subscribed to the Google Groups "Google Calendar API" group.

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.

Bleih Serghei

unread,
Dec 28, 2011, 1:20:12 PM12/28/11
to google-ca...@googlegroups.com
Hi,

I don't know if it's useful in your case, but I've used this plugin to display calendars with events in browser.
It's Jquery based.

Markusr

unread,
Jan 3, 2012, 10:53:03 AM1/3/12
to Google Calendar API
Thanks Bleih,

I will check it out. It isn't c# but anything is worth a look!

-Markus

On Dec 28 2011, 10:20 am, Bleih Serghei <serj.bl...@gmail.com> wrote:
> Hi,
>
> I don't know if it's useful in your case, but I've used this plugin<http://arshaw.com/fullcalendar/>to display calendars with events in browser.
> It's Jquery based.
Reply all
Reply to author
Forward
0 new messages