Calendar API 提供不同類型的活動資源,詳情請參閱「關於活動」。
如需本資源的方法清單,請見本頁結尾。
資源表示法
{
"kind": "calendar#event",
"etag": etag,
"id": string,
"status": string,
"htmlLink": string,
"created": datetime,
"updated": datetime,
"summary": string,
"description": string,
"location": string,
"colorId": string,
"creator": {
"id": string,
"email": string,
"displayName": string,
"self": boolean
},
"organizer": {
"id": string,
"email": string,
"displayName": string,
"self": boolean
},
"start": {
"date": date,
"dateTime": datetime,
"timeZone": string
},
"end": {
"date": date,
"dateTime": datetime,
"timeZone": string
},
"endTimeUnspecified": boolean,
"recurrence": [
string
],
"recurringEventId": string,
"originalStartTime": {
"date": date,
"dateTime": datetime,
"timeZone": string
},
"transparency": string,
"visibility": string,
"iCalUID": string,
"sequence": integer,
"attendees": [
{
"id": string,
"email": string,
"displayName": string,
"organizer": boolean,
"self": boolean,
"resource": boolean,
"optional": boolean,
"responseStatus": string,
"comment": string,
"additionalGuests": integer
}
],
"attendeesOmitted": boolean,
"extendedProperties": {
"private": {
(key): string
},
"shared": {
(key): string
}
},
"hangoutLink": string,
"conferenceData": {
"createRequest": {
"requestId": string,
"conferenceSolutionKey": {
"type": string
},
"status": {
"statusCode": string
}
},
"entryPoints": [
{
"entryPointType": string,
"uri": string,
"label": string,
"pin": string,
"accessCode": string,
"meetingCode": string,
"passcode": string,
"password": string
}
],
"conferenceSolution": {
"key": {
"type": string
},
"name": string,
"iconUri": string
},
"conferenceId": string,
"signature": string,
"notes": string,
},
"gadget": {
"type": string,
"title": string,
"link": string,
"iconLink": string,
"width": integer,
"height": integer,
"display": string,
"preferences": {
(key): string
}
},
"anyoneCanAddSelf": boolean,
"guestsCanInviteOthers": boolean,
"guestsCanModify": boolean,
"guestsCanSeeOtherGuests": boolean,
"privateCopy": boolean,
"locked": boolean,
"reminders": {
"useDefault": boolean,
"overrides": [
{
"method": string,
"minutes": integer
}
]
},
"source": {
"url": string,
"title": string
},
"workingLocationProperties": {
"type": string,
"homeOffice": (value),
"customLocation": {
"label": string
},
"officeLocation": {
"buildingId": string,
"floorId": string,
"floorSectionId": string,
"deskId": string,
"label": string
}
},
"outOfOfficeProperties": {
"autoDeclineMode": string,
"declineMessage": string
},
"focusTimeProperties": {
"autoDeclineMode": string,
"declineMessage": string,
"chatStatus": string
},
"attachments": [
{
"fileUrl": string,
"title": string,
"mimeType": string,
"iconLink": string,
"fileId": string
}
],
"birthdayProperties": {
"contact": string,
"type": string,
"customTypeName": string
},
"eventType": string
}| 屬性名稱 | 值 | 說明 | 附註 |
|---|---|---|---|
anyoneCanAddSelf |
boolean |
是否允許任何人自行邀請參加活動 (已淘汰)。(選用步驟) 預設值為 False。 | 可寫入 |
attachments[] |
list |
活動的附加檔案。 如要修改附件,請將 每個活動最多可附加 25 個檔案, |
|
attachments[].fileId |
string |
附加檔案的 ID。唯讀。 如果是 Google 雲端硬碟檔案,這是 Drive API 中對應 |
|
attachments[].fileUrl |
string |
附件的網址連結。 如要新增 Google 雲端硬碟檔案附件,請使用與 Drive API 中 新增附件時必須提供。 |
可寫入 |
attachments[].iconLink |
string |
附件圖示的網址連結。這個欄位只能修改自訂第三方附件。 | |
attachments[].mimeType |
string |
附件的網際網路媒體類型 (MIME 類型)。 | |
attachments[].title |
string |
附件名稱。 | |
attendeesOmitted |
boolean |
與會者是否可能從活動的代表中省略。擷取事件時,這可能是因為 maxAttendee 查詢參數指定的限制。更新活動時,這項屬性可用於只更新參與者的回覆。(選用步驟) 預設值為 False。 |
可寫入 |
attendees[] |
list |
活動與會者。如要進一步瞭解如何與其他日曆使用者安排活動,請參閱「有參與者的活動」指南。服務帳戶必須使用全網域授權委派功能,才能填入出席者名單。 | 可寫入 |
attendees[].additionalGuests |
integer |
額外房客人數。(選用步驟) 預設值為 0。 | 可寫入 |
attendees[].comment |
string |
與會者的回覆留言。選填。 | 可寫入 |
attendees[].displayName |
string |
出席者的姓名 (如有)。選填。 | 可寫入 |
attendees[].email |
string |
如果有的話,請提供與會者的電子郵件地址。新增出席者時,必須提供這個欄位。必須是符合 RFC5322 規範的有效電子郵件地址。 新增出席者時必須提供。 |
可寫入 |
attendees[].id |
string |
出席者的設定檔 ID (如有)。 | |
attendees[].optional |
boolean |
這是否為選填出席者。(選用步驟) 預設值為 False。 | 可寫入 |
attendees[].organizer |
boolean |
出席者是否為活動主辦人。這個唯讀設定檔預設值為 False。 | |
attendees[].resource |
boolean |
出席者是否為資源。只有在首次將出席者新增至活動時,才能設定此屬性。系統會忽略後續修改。(選用步驟) 預設值為 False。 | 可寫入 |
attendees[].responseStatus |
string |
出席者的回覆狀態。可能的值包括:
|
可寫入 |
attendees[].self |
boolean |
這個項目是否代表顯示活動副本的日曆。這個唯讀設定檔預設值為 False。 | |
birthdayProperties |
nested object |
生日或特別活動資料。如果 eventType 為 "birthday",則使用這個屬性。不可變更。 |
可寫入 |
birthdayProperties.contact |
string |
這個生日活動所連結的聯絡人資源名稱。可用於從 People API 擷取聯絡人詳細資料。格式:"people/c12345"。唯讀。 |
|
birthdayProperties.customTypeName |
string |
為這個事件指定的自訂類型標籤。如果 birthdayProperties.type 設為 "custom",系統就會填入這個欄位。唯讀。 |
|
birthdayProperties.type |
string |
生日或特別活動類型。可能的值包括:
"birthday" 類型的活動。活動建立後即無法變更類型。 |
可寫入 |
colorId |
string |
活動的顏色。這是指顏色定義的 event 區段中的項目 ID (請參閱 顏色端點)。選填。 |
可寫入 |
conferenceData |
nested object |
會議相關資訊,例如 Google Meet 會議的詳細資料。如要建立新的會議詳細資料,請使用 createRequest 欄位。如要保留變更,請記得將所有事件修改要求的 conferenceDataVersion 請求參數設為 1。 |
可寫入 |
conferenceData.conferenceId |
string |
會議 ID。 開發人員可用於追蹤會議,不應向使用者顯示。 不同會議解決方案類型的 ID 值格式不同:
|
|
conferenceData.conferenceSolution |
nested object |
會議解決方案,例如 Google Meet。 如果建立要求失敗,則會議會處於未設定狀態。 你必須提供 |
|
conferenceData.conferenceSolution.iconUri |
string |
這項解決方案向使用者顯示的圖示。 | |
conferenceData.conferenceSolution.key |
nested object |
可專屬識別這項活動會議解決方案的金鑰。 | |
conferenceData.conferenceSolution.key.type |
string |
會議解決方案類型。 如果用戶端遇到不熟悉或空白的類型,仍應能顯示進入點。不過,應該禁止修改。 可能的值為:
|
|
conferenceData.conferenceSolution.name |
string |
使用者看到的解決方案名稱。未本地化。 | |
conferenceData.createRequest |
nested object |
要求產生新會議並附加至活動。資料是以非同步方式產生。如要查看資料是否存在,請檢查 status 欄位。你必須提供 |
|
conferenceData.createRequest.conferenceSolutionKey |
nested object |
會議解決方案,例如 Hangouts 或 Google Meet。 | |
conferenceData.createRequest.conferenceSolutionKey.type |
string |
會議解決方案類型。 如果用戶端遇到不熟悉或空白的類型,仍應能顯示進入點。不過,應該禁止修改。 可能的值為:
|
|
conferenceData.createRequest.requestId |
string |
這項要求由用戶端產生的專屬 ID。 用戶端應為每項新要求重新產生這個 ID。如果提供的 ID 與先前的要求相同,系統會忽略該要求。 |
|
conferenceData.createRequest.status |
nested object |
會議建立要求的狀態。 | |
conferenceData.createRequest.status.statusCode |
string |
會議建立要求的目前狀態。唯讀。 可能的值為:
|
|
conferenceData.entryPoints[] |
list |
個別會議進入點的相關資訊,例如網址或電話號碼。 所有參與者都必須加入同一個會議。 你必須提供 |
|
conferenceData.entryPoints[].accessCode |
string |
存取會議的存取代碼。長度上限為 128 個字元。 建立新的會議資料時,請只填入與會議服務供應商所用術語相符的 { 選填。 |
|
conferenceData.entryPoints[].entryPointType |
string |
會議進入點的類型。 可能的值為:
|
|
conferenceData.entryPoints[].label |
string |
URI 的標籤。向使用者顯示。未本地化。長度上限為 512 個半形字元。 範例:
選填。 |
|
conferenceData.entryPoints[].meetingCode |
string |
存取電話會議的會議代碼。長度上限為 128 個字元。 建立新的會議資料時,請只填入與會議服務供應商所用術語相符的 { 選填。 |
|
conferenceData.entryPoints[].passcode |
string |
存取電話會議的通行碼。長度上限為 128 個字元。 建立新的會議資料時,請只填入與會議服務供應商所用術語相符的 { |
|
conferenceData.entryPoints[].password |
string |
存取會議的密碼。長度上限為 128 個字元。 建立新的會議資料時,請只填入與會議服務供應商所用術語相符的 { 選填。 |
|
conferenceData.entryPoints[].pin |
string |
存取電話會議的 PIN 碼。長度上限為 128 個字元。 建立新的會議資料時,請只填入與會議服務供應商所用術語相符的 { 選填。 |
|
conferenceData.entryPoints[].uri |
string |
進入點的 URI。長度上限為 1300 個半形字元。 格式:
|
|
conferenceData.notes |
string |
向使用者顯示的其他附註 (例如網域管理員的指示、法律聲明)。可包含 HTML。長度上限為 2048 個半形字元。選填。 | |
conferenceData.signature |
string |
會議資料的簽章。 在伺服器端產生。 如果建立要求失敗,則會議會處於未設定狀態。 如果會議有待處理的建立要求,則為選用。 |
|
created |
datetime |
事件的建立時間 (以 RFC3339 時間戳記表示)。唯讀。 | |
creator |
object |
活動建立者。唯讀。 | |
creator.displayName |
string |
創作者名稱 (如有)。 | |
creator.email |
string |
創作者的電子郵件地址 (如有)。 | |
creator.id |
string |
創作者的設定檔 ID (如有)。 | |
creator.self |
boolean |
建立者是否對應於顯示這個活動副本的日曆。這個唯讀設定檔預設值為 False。 | |
description |
string |
活動的說明。可包含 HTML。選填。 | 可寫入 |
end |
nested object |
活動的結束時間 (不包含在內)。如果是週期性活動,這是指第一個例項的結束時間。 | |
end.date |
date |
如果這是全天活動,則為日期,格式為「yyyy-mm-dd」。 | 可寫入 |
end.dateTime |
datetime |
時間,以合併的日期時間值表示 (格式符合 RFC3339)。除非在 timeZone 中明確指定時區,否則必須提供時區偏移量。 |
可寫入 |
end.timeZone |
string |
指定時間的時區。(格式為 IANA 時區資料庫名稱,例如「Europe/Zurich」)。如果是週期性活動,這個欄位為必填,並指定週期性活動展開的時區。如果是單一活動,這個欄位為選填,可指出活動開始/結束的自訂時區。 | 可寫入 |
endTimeUnspecified |
boolean |
結束時間是否未指定。即使這個屬性設為 True,系統仍會提供結束時間,以確保相容性。預設值為 False。 | |
etag |
etag |
資源的 ETag。 | |
eventType |
string |
事件的具體類型。建立活動後即無法修改這項設定。可能的值包括:
|
可寫入 |
extendedProperties |
object |
活動的擴充屬性。 | |
extendedProperties.private |
object |
活動副本的私人屬性,只會顯示在這個日曆上。 | 可寫入 |
extendedProperties.private.(key) |
string |
私人屬性的名稱和對應值。 | |
extendedProperties.shared |
object |
其他參與者日曆上活動副本之間共用的屬性。 | 可寫入 |
extendedProperties.shared.(key) |
string |
共用屬性的名稱和對應值。 | |
focusTimeProperties |
nested object |
專注時間活動資料。如果 eventType 為 focusTime,則使用這個屬性。 |
可寫入 |
focusTimeProperties.autoDeclineMode |
string |
是否要拒絕與專注時間活動重疊的會議邀請。有效值為 declineNone,表示不會拒絕任何會議邀請;declineAllConflictingInvitations,表示會拒絕所有與活動衝突的會議邀請;以及 declineOnlyNewConflictingInvitations,表示只會拒絕在專注時間活動期間收到的新會議邀請。 |
|
focusTimeProperties.chatStatus |
string |
在 Google Chat 和相關產品中標記使用者的狀態。可以是 available 或 doNotDisturb。 |
|
focusTimeProperties.declineMessage |
string |
回覆訊息:設定日曆是否自動拒絕現有活動或新邀請。 | |
gadget |
object |
擴充此事件的小工具。小工具已淘汰,這個結構現在只用於傳回生日日曆中繼資料。 | |
gadget.display |
string |
小工具的顯示模式。已淘汰,可能的值包括:
|
可寫入 |
gadget.height |
integer |
小工具的高度 (以像素為單位)。高度必須是大於 0 的整數。(選用步驟) 已淘汰。 | 可寫入 |
gadget.iconLink |
string |
小工具的圖示網址。網址架構必須是 HTTPS。已淘汰。 | 可寫入 |
gadget.link |
string |
小工具的網址。網址架構必須是 HTTPS。已淘汰。 | 可寫入 |
gadget.preferences |
object |
。 | 可寫入 |
gadget.preferences.(key) |
string |
偏好設定名稱和對應值。 | |
gadget.title |
string |
小工具的標題,已淘汰。 | 可寫入 |
gadget.type |
string |
小工具類型。已淘汰。 | 可寫入 |
gadget.width |
integer |
小工具的寬度 (以像素為單位)。寬度必須是大於 0 的整數。(選用步驟) 已淘汰。 | 可寫入 |
guestsCanInviteOthers |
boolean |
除了主辦人以外,其他出席者能否邀請他人參加活動。(選用步驟) 預設值為 True。 | 可寫入 |
guestsCanModify |
boolean |
除了主辦人以外,其他與會者是否可以修改活動。(選用步驟) 預設值為 False。 | 可寫入 |
guestsCanSeeOtherGuests |
boolean |
主辦人以外的與會者是否可以查看活動與會者名單。(選用步驟) 預設值為 True。 | 可寫入 |
hangoutLink |
string |
這項活動相關聯的 Google Hangouts 絕對連結。唯讀。 | |
htmlLink |
string |
Google 日曆網頁版使用者介面中,這個活動的絕對連結。唯讀。 | |
iCalUID |
string |
符合 RFC5545 定義的事件專屬 ID。這個 ID 可用來在不同日曆系統中找出特定事件,透過 import 方法匯入事件時,必須提供這個 ID。 請注意, |
|
id |
string |
事件的不透明 ID。建立新的單一或週期性活動時,可以指定活動 ID。提供的 ID 必須符合下列規則:
如未指定 ID,伺服器會自動產生。 請注意, |
可寫入 |
kind |
string |
資源類型 (「calendar#event」)。 |
|
location |
string |
活動的地理位置,格式不限。選填。 | 可寫入 |
locked |
boolean |
這是否為鎖定的活動副本,無法變更主要活動欄位「摘要」、「說明」、「地點」、「開始」、「結束」或「重複」。預設值為 False。唯讀。 | |
organizer |
object |
活動主辦人。如果主辦人也是與會者,attendees 中會顯示個別項目,且 organizer 欄位會設為 True。如要變更主辦人,請使用「移動」作業。唯讀,匯入活動時除外。 |
可寫入 |
organizer.displayName |
string |
主辦者的名稱 (如有)。 | 可寫入 |
organizer.email |
string |
主辦人的電子郵件地址 (如有)。必須是符合 RFC5322 規範的有效電子郵件地址。 | 可寫入 |
organizer.id |
string |
主辦人的設定檔 ID (如有)。 | |
organizer.self |
boolean |
發起人是否對應於顯示這個活動副本的日曆。這個唯讀設定檔預設值為 False。 | |
originalStartTime |
nested object |
如果是週期性活動的執行個體,這是根據 recurringEventId 所識別週期性活動中的週期性資料,此活動的開始時間。即使執行個體已移至其他時間,這個 ID 仍可在週期性事件系列中唯一識別該執行個體。不可變更。 | |
originalStartTime.date |
date |
如果這是全天活動,則為日期,格式為「yyyy-mm-dd」。 | 可寫入 |
originalStartTime.dateTime |
datetime |
時間,以合併的日期時間值表示 (格式符合 RFC3339)。除非在 timeZone 中明確指定時區,否則必須提供時區偏移量。 |
可寫入 |
originalStartTime.timeZone |
string |
指定時間的時區。(格式為 IANA 時區資料庫名稱,例如「Europe/Zurich」)。如果是週期性活動,這個欄位為必填,並指定週期性活動展開的時區。如果是單一活動,這個欄位為選填,可指出活動開始/結束的自訂時區。 | 可寫入 |
outOfOfficeProperties |
nested object |
不在辦公室的活動資料。如果 eventType 為 outOfOffice,則使用這個屬性。 |
可寫入 |
outOfOfficeProperties.autoDeclineMode |
string |
是否要拒絕與「不在辦公室」活動重疊的會議邀請。有效值為 declineNone,表示不會拒絕任何會議邀請;declineAllConflictingInvitations,表示會拒絕所有與活動衝突的會議邀請;以及 declineOnlyNewConflictingInvitations,表示只會拒絕在「不在辦公室」活動期間收到的新會議邀請。 |
|
outOfOfficeProperties.declineMessage |
string |
回覆訊息:設定日曆是否自動拒絕現有活動或新邀請。 | |
privateCopy |
boolean |
如果設為 True,系統會停用事件傳播。請注意,這與私人事件屬性不同。(選用步驟) 不可變動。預設值為 False。 | |
recurrence[] |
list |
重複活動的 RRULE、EXRULE、RDATE 和 EXDATE 行清單,如 RFC5545 所述。請注意,這個欄位不允許 DTSTART 和 DTEND 行;活動開始和結束時間是在 start 和 end 欄位中指定。如果是單一活動或週期性活動的執行個體,系統會省略這個欄位。 |
可寫入 |
recurringEventId |
string |
如果是週期性活動的執行個體,這是指該執行個體所屬週期性活動的 id。不可變更。 |
|
reminders |
object |
已驗證使用者活動的提醒資訊。請注意,變更提醒事項不會同時變更封閉事件的 updated 屬性。 |
|
reminders.overrides[] |
list |
如果活動未使用預設提醒,這個部分會列出活動專屬的提醒,或指出活動未設定任何提醒。最多只能有 5 個覆寫提醒。 | 可寫入 |
reminders.overrides[].method |
string |
這個提醒事項所用的方法。可能的值包括:
新增提醒時必須填寫。 |
可寫入 |
reminders.overrides[].minutes |
integer |
提醒通知應在活動開始前幾分鐘觸發。有效值介於 0 和 40320 (4 週,以分鐘為單位)。 新增提醒時必須填寫。 |
可寫入 |
reminders.useDefault |
boolean |
日曆的預設提醒事項是否適用於活動。 | 可寫入 |
sequence |
integer |
iCalendar 格式的序號。 | 可寫入 |
source |
object |
建立活動的來源。例如網頁、電子郵件訊息,或任何可透過 HTTP 或 HTTPS 通訊協定網址識別的文件。只有活動建立者可以查看或修改。 | |
source.title |
string |
來源的標題,例如網頁標題或電子郵件主旨。 | 可寫入 |
source.url |
string |
指向資源的來源網址。網址架構必須是 HTTP 或 HTTPS。 | 可寫入 |
start |
nested object |
活動的開始時間 (包含在內)。如果是週期性活動,這是第一個例項的開始時間。 | |
start.date |
date |
如果這是全天活動,則為日期,格式為「yyyy-mm-dd」。 | 可寫入 |
start.dateTime |
datetime |
時間,以合併的日期時間值表示 (格式符合 RFC3339)。除非在 timeZone 中明確指定時區,否則必須提供時區偏移量。 |
可寫入 |
start.timeZone |
string |
指定時間的時區。(格式為 IANA 時區資料庫名稱,例如「Europe/Zurich」)。如果是週期性活動,這個欄位為必填,並指定週期性活動展開的時區。如果是單一活動,這個欄位為選填,可指出活動開始/結束的自訂時區。 | 可寫入 |
status |
string |
活動的狀態。(選用步驟) 可能的值包括:
|
可寫入 |
summary |
string |
活動名稱。 | 可寫入 |
transparency |
string |
活動是否會占用日曆上的時間。(選用步驟) 可能的值包括:
|
可寫入 |
updated |
datetime |
主要活動資料的上次修改時間 (以 RFC3339 時間戳記表示)。更新活動提醒不會導致這項設定變更。唯讀。 | |
visibility |
string |
活動的顯示設定。(選用步驟) 可能的值包括:
|
可寫入 |
workingLocationProperties |
nested object |
工作地點活動資料。 | 可寫入 |
workingLocationProperties.customLocation |
object |
如果存在,則表示使用者在自訂地點工作。 | 可寫入 |
workingLocationProperties.customLocation.label |
string |
額外標籤 (選用),可提供其他資訊。 | 可寫入 |
workingLocationProperties.homeOffice |
any value |
如果存在,表示使用者在家工作。 | 可寫入 |
workingLocationProperties.officeLocation |
object |
如果有的話,表示使用者在辦公室工作。 | 可寫入 |
workingLocationProperties.officeLocation.buildingId |
string |
選用的建築物 ID。這應參照機構資源資料庫中的建築物 ID。 | 可寫入 |
workingLocationProperties.officeLocation.deskId |
string |
選用辦公桌 ID。 | 可寫入 |
workingLocationProperties.officeLocation.floorId |
string |
樓層 ID (選填)。 | 可寫入 |
workingLocationProperties.officeLocation.floorSectionId |
string |
選用的樓層分區 ID。 | 可寫入 |
workingLocationProperties.officeLocation.label |
string |
顯示在 Google 日曆網頁版和行動版用戶端中的辦公室名稱。建議您參考機構資源資料庫中的建築物名稱。 | 可寫入 |
workingLocationProperties.type |
string |
工作地點類型。可能的值包括:
新增工作地點屬性時為必要屬性。 |
可寫入 |
方法
- 刪除
- 刪除活動。
- get
- 根據 Google 日曆 ID 傳回活動。如要使用 iCalendar ID 擷取活動,請使用
iCalUID參數呼叫 events.list 方法。 - import
- 匯入活動。這項作業用於將現有活動的私人副本新增至日曆。您只能匯入
eventType為default的事件。已淘汰的行為:如果匯入非
default事件,系統會將其類型變更為default,並捨棄可能有的任何事件類型專屬屬性。 - 插入
- 建立活動。
- 執行個體
- 傳回指定週期性活動的執行個體。
- list
- 傳回指定日曆中的活動。
- 移動
- 將活動移至其他日曆,也就是變更活動主辦人。請注意,只有
default事件可以移動,birthday、focusTime、fromGmail、outOfOffice和workingLocation事件則無法移動。 - 修補程式
- 更新活動。這個方法支援 patch 語意。請注意,每個修補程式要求會耗用三個配額單位,建議使用
get,然後再使用update。您指定的欄位值會取代現有值。要求中未指定的欄位會維持不變。如果指定陣列欄位,系統會覆寫現有陣列,並捨棄先前的陣列元素。 - quickAdd
- 根據簡單的文字字串建立事件。
- 更新
- 更新活動。這個方法不支援 patch 語意,一律會更新整個活動資源。如要進行部分更新,請執行
get,然後使用 etag 執行update,確保原子性。 - 智慧手錶
- 留意 Events 資源的變更。