abujehad139 / google-api-go-client

Automatically exported from code.google.com/p/google-api-go-client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Calendar.Events.Insert accepts "default" as calendarId, but returns 404 #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
# What steps will reproduce the problem?

1. Create a dummy Event struct:

  eventStart := calendar.EventDateTime {
    DateTime: "2013-03-30T02:10:45-03:00",
  }

  eventEnd := calendar.EventDateTime {
    DateTime: "2013-03-30T02:20:45-03:00",
  }

  eventNew := calendar.Event {
    Summary: "Test event",
    Start: &eventStart,
    End: &eventEnd,
  }

2. Attempt using Calendar.Events.Insert to insert it into the default calendar:

  calendarEvent, err := calendarApi.Events.Insert("@default", &eventNew).Do();

3. err says:

  googleapi: Error 404: Not Found

# What is the expected output? What do you see instead?

Expected output: successfully created event, inside the default calendar.

# What version of the product are you using? On what operating system?

go1.0.3
Mac OS X 10.8.2
google-api-go-client latest (53a9f7c3169a)

Original issue reported on code.google.com by m...@markbao.com on 30 Mar 2013 at 5:38

GoogleCodeExporter commented 9 years ago
Using either `@default` or `default` both result in the 404.

Using a proper Calendar ID results in a successful event insertion.

Original comment by m...@markbao.com on 30 Mar 2013 at 5:39

GoogleCodeExporter commented 9 years ago
Looking more into this, it looks like the API Console on 
https://developers.google.com/google-apps/calendar/v3/reference/events/insert#ex
amples shows that

POST 
https://www.googleapis.com/calendar/v3/calendars/default/events?sendNotification
s=false&key={YOUR_API_KEY}

...also returns a 404. The other APIs adhere to accepting "primary" as a value, 
though. How does that work in the other APIs, and should that functionality be 
added to the Go client as well?

Original comment by m...@markbao.com on 30 Mar 2013 at 6:55