CalendarList: patch
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
更新使用者日曆清單中的現有日曆。這個方法支援 patch 語意。請注意,每個修補要求都會消耗三個配額單位;建議使用 get
後接 update
。您指定的欄位值會取代現有值。您在要求中未指定的欄位會維持不變。如果指定陣列欄位,系統會覆寫現有的陣列,並捨棄任何先前的陣列元素。立即試用。
要求
HTTP 要求
PATCH https://www.googleapis.com/calendar/v3/users/me/calendarList/calendarId
參數
參數名稱 |
值 |
說明 |
路徑參數 |
calendarId |
string |
日曆 ID。如要擷取日曆 ID,請呼叫 calendarList.list 方法。如果您想存取目前登入使用者的主日曆,請使用「primary 」關鍵字。
|
選用查詢參數 |
colorRgbFormat |
boolean |
是否要使用 foregroundColor 和 backgroundColor 欄位寫入日曆顏色 (RGB)。如果使用這項功能,系統會自動將以索引為準的 colorId 欄位設為最相符的選項。選用設定。預設值為 False。
|
授權
這項要求需要至少具備下列其中一個範圍的授權:
範圍 |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.app.created |
https://www.googleapis.com/auth/calendar.calendarlist |
詳情請參閱「驗證與授權」頁面。
要求主體
在要求內容中,根據修補語義規則提供 CalendarList 資源的相關部分。
試試看!
您可以使用下方的 API Explorer,針對即時資料呼叫這個方法,然後查看回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# CalendarList: patch\n\n| **Note:** Requires [authorization](#auth).\n\nUpdates an existing calendar on the user's calendar list. This method supports patch semantics. Note that each patch request consumes three quota units; prefer using a `get` followed by an `update`. The field values you specify replace the existing values. Fields that you don't specify in the request remain unchanged. Array fields, if specified, overwrite the existing arrays; this discards any previous array elements.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPATCH https://www.googleapis.com/calendar/v3/users/me/calendarList/calendarId\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `calendarId` | `string` | Calendar identifier. To retrieve calendar IDs call the [calendarList.list](/workspace/calendar/api/v3/reference/calendarList/list) method. If you want to access the primary calendar of the currently logged in user, use the \"`primary`\" keyword. |\n| **Optional query parameters** |||\n| `colorRgbFormat` | `boolean` | Whether to use the `foregroundColor` and `backgroundColor` fields to write the calendar colors (RGB). If this feature is used, the index-based `colorId` field will be set to the best matching option automatically. Optional. The default is False. |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes:\n\n| Scope |\n|---------------------------------------------------------|\n| `https://www.googleapis.com/auth/calendar` |\n| `https://www.googleapis.com/auth/calendar.app.created` |\n| `https://www.googleapis.com/auth/calendar.calendarlist` |\n\nFor more information, see the [authentication and authorization](/workspace/guides/configure-oauth-consent) page.\n\n### Request body\n\nIn the request body, supply the relevant portions of a [CalendarList resource](/workspace/calendar/api/v3/reference/calendarList#resource), according to the rules of patch semantics.\n\nResponse\n--------\n\nIf successful, this method returns a [CalendarList resource](/workspace/calendar/api/v3/reference/calendarList#resource) in the response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]