傳回一組日曆的有空/忙碌資訊。 立即試用。
要求
HTTP 要求
POST https://www.googleapis.com/calendar/v3/freeBusy
授權
這個要求需要下列至少一項範圍的授權:
範圍 |
---|
https://www.googleapis.com/auth/calendar.readonly |
https://www.googleapis.com/auth/calendar |
詳情請參閱驗證和授權頁面。
要求主體
在要求內容中,請按照下列結構提供資料:
{ "timeMin": datetime, "timeMax": datetime, "timeZone": string, "groupExpansionMax": integer, "calendarExpansionMax": integer, "items": [ { "id": string } ] }
資源名稱 | 值 | 說明 | Notes |
---|---|---|---|
timeMin |
datetime |
查詢的間隔時間,格式符合 RFC3339 規定。 | |
timeMax |
datetime |
查詢的間隔時間結束,格式符合 RFC3339 標準。 | |
timeZone |
string |
回應中使用的時區。選用,預設值為世界標準時間。 | |
groupExpansionMax |
integer |
單一群組提供的日曆 ID 數量上限。選用,如果成員人數超過這個值,系統就會傳回錯誤。上限為 100。 | |
calendarExpansionMax |
integer |
要提供 FreeBusy 資訊的日曆數量上限。選用,上限為 50。 | |
items[] |
list |
要查詢的日曆和/或群組清單。 | |
items[].id |
string |
日曆或群組的 ID。 |
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{ "kind": "calendar#freeBusy", "timeMin": datetime, "timeMax": datetime, "groups": { (key): { "errors": [ { "domain": string, "reason": string } ], "calendars": [ string ] } }, "calendars": { (key): { "errors": [ { "domain": string, "reason": string } ], "busy": [ { "start": datetime, "end": datetime } ] } } }
屬性名稱 | 值 | 說明 | Notes |
---|---|---|---|
kind |
string |
資源類型 (「calendar#freeBusy」)。 | |
timeMin |
datetime |
間隔開始。 | |
timeMax |
datetime |
間隔結束。 | |
groups |
object |
擴充群組。 | |
groups.(key) |
nested object |
這個群組成員的日曆清單。 | |
groups.(key).errors[] |
list |
選擇性錯誤 (如果群組計算失敗)。 | |
groups.(key).errors[].domain |
string |
錯誤所在的網域或廣泛類別。 | |
groups.(key).errors[].reason |
string |
錯誤原因。可能的值包括:
|
|
groups.(key).calendars[] |
list |
群組中的日曆 ID 清單。 | |
calendars |
object |
日曆的有空/忙碌資訊清單。 | |
calendars.(key) |
nested object |
適用於單一日曆的有空/忙碌資訊。 | |
calendars.(key).errors[] |
list |
選用錯誤 (如果日曆的計算失敗的話)。 | |
calendars.(key).errors[].domain |
string |
錯誤所在的網域或廣泛類別。 | |
calendars.(key).errors[].reason |
string |
錯誤原因。可能的值包括:
|
|
calendars.(key).busy[] |
list |
這個時段應將此日曆視為忙碌。 | |
calendars.(key).busy[].start |
datetime |
該時段的起始時間 (含)。 | |
calendars.(key).busy[].end |
datetime |
該時段的 (不含) 結束。 |
試試看!
使用 APIs Explorer 針對即時資料呼叫這個方法,並查看回應。