You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Google Calendar API查询指定日历的删除状态?

How to Check if a Google Calendar is Deleted via API

Hey there, based on your previous API call to fetch calendar details, here's how you can verify if that calendar has been deleted:

1. Reuse the Calendar Details API Call

The simplest and most reliable method is to call the same endpoint you used before:

GET https://www.googleapis.com/calendar/v3/calendars/877rak5vqdsj68q52tehukeopg@group.calendar.google.com
  • If the calendar exists: You'll get a normal response like the one you received earlier, with fields like summary, id, and timeZone.
  • If the calendar is deleted: The API will return a 404 Not Found error. A typical error response looks like this:

{
"error": {
"code": 404,
"message": "Not Found",
"errors": [
{
"message": "Not Found",
"domain": "global",
"reason": "notFound"
}
],
"status": "NOT_FOUND"
}
}

2. Check the Calendar List (Alternative Method)

You can also fetch your full list of accessible calendars using this endpoint:

GET https://www.googleapis.com/calendar/v3/users/me/calendarList
  • If your target calendar ID appears in the returned list, it's active and accessible to you.
  • If it's missing, it’s either been deleted or you no longer have permissions to access it. Since you previously could fetch its details directly, deletion is the more likely scenario here.

Key Note

Make sure your API credentials are still valid (same as when you made the original call). A 404 could also happen if your auth is invalid, but assuming your permissions are intact, this status code is a clear indicator the calendar no longer exists.

内容的提问来源于stack exchange,提问作者Varshini

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:16:44