Hi,

I am trying to use a winform to create an event with a reminder on my
default calendar. I can create the event fine, but when I go to update
it to add the reminder, I get the following excpetion:

ex.message = Event Create Failed:Execution of request failed:
http://www.google.com/calendar/feeds/default/private/full/pcpb4fpnhvv51rtoj40pvk6gec/63394421740

ex.innerexception.message: The remote server returned an error: (403)
Forbidden.

Has anyone else experienced this? I know I am doing something wrong,
but I can't figure out what. Especially odd is that this seemed to be
working yesterday.

Here is the code:

private void btnCreateGoogleEvent_Click(object sender, EventArgs e)
        {
            EventEntry entry = new EventEntry();
            entry.Title.Text = this.txtEventName.Text;

            entry.Content.Content = this.rtbDescription.Text;

            //Set Location
            Where eventLocation = new Where();
            eventLocation.ValueString = this.txtLocation.Text;
            entry.Locations.Add(eventLocation);

            //set time
            When eventTime = new When();
            eventTime.StartTime = this.dateTimePicker1.Value;
            eventTime.EndTime = this.dateTimePicker1.Value.AddMinutes
(30);
            eventTime.AllDay = false;



            //add the event
            url = "http://www.google.com/calendar/feeds/default/
private/full";
            Uri posturl =new Uri (url);

                //authenticate the service
            try
            {
                service.setUserCredentials(uname, pw);
                EventEntry insertedEntry = (EventEntry)service.Insert
(posturl, entry);
                Reminder rem = new Reminder();
                rem.Minutes = 15;
                rem.Method = Reminder.ReminderMethod.alert;
                insertedEntry.Reminders.Add(rem);

                this.rtbResults.AppendText("\r\nEvent Created. Edit
URI " + insertedEntry.EditUri+ "\r\n");
                this.rtbResults.AppendText("\r\nEvent Created. Self
URI " + insertedEntry.EditUri + "\r\n");
                AtomEntry ae = insertedEntry.Update();
            }
            catch(Exception ex)
            {
                this.rtbResults.AppendText("\r\nEvent Create Failed:"
+ ex.Message + "\r\n" +  ex.InnerException.Message+"\r\n");
            }



        }

--

You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en.


Reply via email to