I'm using Google Calendar API for one of my projects.
I want to import events to Google Calendar from my app, and lock them so the final user won't be able to modify them in Google Calendar.
The API works great so far, however, when I try to import an event, I get this error:
The owner of the calendar must either be the organizer or an attendee of an event that is imported.
Even if I set the organizer to be one of the calendar's owners.
Here is the POST sample from the API console:
POST https://www.googleapis.com/calendar/v3/calendars/_my_calendar_id%40group.calendar.google.com/events/import?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZTdiWGywGp2LLSUlc8BV-dVIwJET5azIkNekjNgRjHRWc_Ojg
X-JavaScript-User-Agent: Google APIs Explorer
{
"end": {
"dateTime": "2013-01-02T16:22:00+00:00"
},
"iCalUID": "123456789",
"start": {
"dateTime": "2013-01-02T14:22:00+00:00"
},
"organizer": {
"email": "_this_is_the_owner@gmail.com",
"displayName": "Owner Guy"
},
"attendees": [
{
"email": "_this_is_the_owner@gmail.com"
}
]
}
Steps to reproduce:
- Create a calendar and get the ID or use "primary" for your primary calendar.
- Share it with somebody, or make somebody the owner.
- Go to the Calendar API Reference/events/import -> "Try it!", and use oAuth to authenticate before submitting the POST.
- Complete the required fields (start, end, icaluid, etc)
- Try to set the organizer or any attendee as one of the calendar's owners.