Google Calendar API .NET

Posted on 2009-12-21
Last Modified: 2014-11-12
I am starting at ground one with this.  I want to return a set of
calendar events for a range of dates.  I  found some sample c# code
and have a few questions.

1)  What is feedUri in the code below?  What should its value be?

static void Main(string[] args)
        userName = "";
        userPassword = "pass1234";
        feedUri = @"";

2)  What is the CalendarService parameter?  What value should I

CalendarService service = new CalendarService("exampleCo-
service.setUserCredentials(userName, userPassword);

3)  The code follows.  I am getting an Invalid Credentials error

static void PrintUserCalendars(CalendarService service)
            FeedQuery query = new FeedQuery();
            query.Uri = new Uri("
            AtomFeed calFeed = service.Query(query);  //Error here -
Invalid Credentials

-- Any help would be appreciated.


Question by:lplasc
    LVL 5

    Expert Comment

    try to use this line to authenticate the user to the service

    service.setUserCredentials("username", "password");
    LVL 11

    Accepted Solution

    these informations are actually provided in google's dev guide, you probably over looked them so here they are:
    1) "The feedUri value is typically for working with your primary calendar"
    2) "Create a new CalendarService instance, setting your application's name (in the form companyName-applicationName-versionID). "
    3) you need to call "service.setUserCredentials()" with the right usernames and password before calling "Query". You probably need to double check your login info (remember to include the full user name including the domain name).

    documenation reminder:

    Good luck and let us know if it's not working for you !
    LVL 5

    Expert Comment

    this is the same what i said

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Last month, Google released a new update for Google Sheets. This new update offers new ways to visualize and analyze data. Use this article to learn how to take advantage of the new tools now available for charts, cells and collaboration with Google…
    There are many add-ons for Google docs, slides and sheets that can be extremely helpful in keeping your files organized and simple to use. Add-ons are installed into your Google docs, slides or sheets through Google's Add-On Store. One of my favorit…
    This Micro Tutorial demonstrates in Google Analytics how to create a custom report that shows you traffic over time using the month of year dimensions. There are also instructions on how to fix Google's odd month of year formatting, which Microsoft …
    This Micro Tutorial demonstrates how to quickly find related content for YourTango's posts using MozBar Chrome extension.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now