Reputation: 305
I tried the calendar insert example from here : https://developers.google.com/google-apps/calendar/v3/reference/events/insert#examples No matter which property i use, i always get the 404 "not found" error. Anyone can shed some light on this? Many thanks!!!
POST https://www.googleapis.com/calendar/v3/calendars/test/events?sendNotifications=false&fields=start&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZQaT3-Tj_bviwaY9Xi3gDspuBbCtEKtidnZkTXuWpI
X-JavaScript-User-Agent: Google APIs Explorer
{
"end": {
"date": "2012-07-11"
},
"start": {
"date": "2012-07-09"
}
}
response: 404 Not Found
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
Upvotes: 28
Views: 35225
Reputation: 412
Today I had the same problem with non primary calendar. It's solved now, follow this steps:
Note: This solution serve me with PHP web app with Service account auth method. You have to use Service account method too instead of OAuth 2.0.
Upvotes: 13
Reputation: 1140
I had the same issue.
I was sending request using guzzleHttp (I mean not any official SDKs)
One of my calendar's id is en.usa#[email protected]
. and I needed to encode URL because of hashtag.
Upvotes: 1
Reputation: 9
There can be two problems: a). Either your calendar id is not correct. You can find it via following steps-
b) Daily limit of unauthenticated use may have exceed. Check it via https://www.googleapis.com/calendar/v3/calendars/primary12/events?alt=json primary12 is your calendar name
Upvotes: 1
Reputation: 61
To JuanPablo, Re non-primary calendar:
In case of non-primary calendar you have to use the id (in form of an email address) as the calendarId.
Example: Let's say you have a calendar named 'test'. You get its id like this
GET https://www.googleapis.com/calendar/v3/users/me/calendarList?key={YOUR_API_KEY}
->
{
"kind": "calendar#calendarList",
...
"items": [
{
"kind": "calendar#calendarListEntry",
"etag": ...,
"id": "[email protected]",
"summary": "test",
"description": "Testing calendar for development of Calendar related applications",
...
}
}
]
}
Your POST will then look like this
POST https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?sendNotifications=false&fields=start&key={YOUR_API_KEY}
Upvotes: 6
Reputation: 518
I am also getting the same problem with s=inserting the event, while getting a particular event. But i got an alternative just specify CalendarList asa = service.CalendarList.List().Execute(); before the execution of code where you are getting. I don't know the reason why it is running after specifying this code. If you find the correct way please update it here as it will consume more quota count.
Upvotes: -3
Reputation: 18531
I believe it's telling you that the calendar "test" resource cannot be found. Have you created a calendar called "test"? If you replace "test" with "primary" (your main calendar) then the Explorer should work.
Upvotes: 15