Google Calendar API .NET

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 = "joe@gmail.com";
        userPassword = "pass1234";
        feedUri = @"http://gmail.com";
        }

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

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

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

PrintUserCalendars(service);
.
.
static void PrintUserCalendars(CalendarService service)
        {
            FeedQuery query = new FeedQuery();
            query.Uri = new Uri("http://www.google.com/calendar/feeds/
default");
            AtomFeed calFeed = service.Query(query);  //Error here -
Invalid Credentials

-- Any help would be appreciated.

Thanks.


lplascAsked:
Who is Participating?
 
lenordisteConnect With a Mentor Commented:
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 http://www.google.com/calendar/feeds/default/private/full 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:
http://code.google.com/intl/fr/apis/calendar/data/2.0/developers_guide_dotnet.html#Auth

Good luck and let us know if it's not working for you !
0
 
gemailjCommented:
try to use this line to authenticate the user to the service

service.setUserCredentials("username", "password");
0
 
gemailjCommented:
this is the same what i said
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.