Google: Returns free busy information for a set of calendars
Google calendarFreebusy.calendarFreebusyQuery: arguments, response, policy and SDK examples.
← Calendar freebusy operations · Get started
Operation google.calendar_freebusy_query
Provider route: POST /calendar/v3/freeBusy. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/google with npm, or alter-sdk-google with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { GoogleIntegration } from "@alter-ai/google";
async function execute(input: Parameters<GoogleIntegration["calendarFreebusy"]["calendarFreebusyQuery"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new GoogleIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.calendarFreebusy.calendarFreebusyQuery(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_google import GoogleIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = GoogleIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.calendar_freebusy.calendar_freebusy_query(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | Model | Optional | Expand Returns a single user setting — request body — query |
body | Model | Required within parent | Expand Returns free busy information for a set of calendars — request body — body |
Referenced models: Returns free busy information for a set of calendars — request body — body, Returns a single user setting — request body — query
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Returns free busy information for a set of calendars — response body |
Referenced models: Returns free busy information for a set of calendars — response body
Schemas
Section titled “Schemas”Returns free busy information for a set of calendars — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
calendars | object | Optional | List of free/busy information for calendars. Additional keys: see wildcard field |
calendars.* | Model | Additional keys | Expand Returns free busy information for a set of calendars — response body — calendars value Free/busy expansions for a single calendar. |
groups | object | Optional | Expansion of groups. Additional keys: see wildcard field |
groups.* | Model | Additional keys | Expand Returns free busy information for a set of calendars — response body — groups value List of calendars that are members of this group. |
kind | string | Optional | Type of the resource ("calendar#freeBusy"). Default: calendar#freeBusy |
timeMax | string | Optional | The end of the interval. Format: date-time |
timeMin | string | Optional | The start of the interval. Format: date-time |
Referenced models: Returns free busy information for a set of calendars — response body — calendars value, Returns free busy information for a set of calendars — response body — groups value
Returns free busy information for a set of calendars — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
calendarExpansionMax | integer | Optional | Maximal number of calendars for which FreeBusy information is to be provided. Optional. Maximum value is 50. Format: int32 |
groupExpansionMax | integer | Optional | Maximal number of calendar identifiers to be provided for a single group. Optional. An error is returned for a group with more members than this value. Maximum value is 100. Format: int32 |
items | array | Optional | List of calendars and/or groups to query. |
items[] | Model | Each item | Expand Returns free busy information for a set of calendars — request body — body items item |
timeMax | string | Optional | The end of the interval for the query formatted as per RFC3339. Format: date-time |
timeMin | string | Optional | The start of the interval for the query formatted as per RFC3339. Format: date-time |
timeZone | string | Optional | Time zone used in the response. Optional. The default is UTC. Default: UTC |
Referenced models: Returns free busy information for a set of calendars — request body — body items item
Returns a single user setting — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
fields | string | Optional | Selector specifying which fields to include in a partial response. |
prettyPrint | boolean | Optional | Returns response with indentations and line breaks. Default: true |
quotaUser | string | Optional | An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
userIp | string | Optional | Deprecated. Please use quotaUser instead. |
Returns free busy information for a set of calendars — response body — calendars value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
busy | array | Optional | List of time ranges during which this calendar should be regarded as busy. |
busy[] | Model | Each item | Expand Returns free busy information for a set of calendars — response body — calendars value busy item |
errors | array | Optional | Optional error(s) (if computation for the calendar failed). |
errors[] | Model | Each item | Expand Returns free busy information for a set of calendars — response body — groups value errors item |
Referenced models: Returns free busy information for a set of calendars — response body — groups value errors item, Returns free busy information for a set of calendars — response body — calendars value busy item
Returns free busy information for a set of calendars — response body — groups value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
calendars | array | Optional | List of calendars' identifiers within a group. |
calendars[] | string | Each item | |
errors | array | Optional | Optional error(s) (if computation for the group failed). |
errors[] | Model | Each item | Expand Returns free busy information for a set of calendars — response body — groups value errors item |
Referenced models: Returns free busy information for a set of calendars — response body — groups value errors item
Returns free busy information for a set of calendars — request body — body items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Optional | The identifier of a calendar or a group. |
Returns free busy information for a set of calendars — response body — groups value errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
domain | string | Optional | Domain, or broad category, of the error. |
reason | string | Optional | Specific reason for the error. Some of the possible values are: - "groupTooBig" - The group of users requested is too large for a single query. - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query. - "notFound" - The requested resource was not found. - "internalError" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list. |
Returns free busy information for a set of calendars — response body — calendars value busy item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
end | string | Optional | The (exclusive) end of the time period. Format: date-time |
start | string | Optional | The (inclusive) start of the time period. Format: date-time |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: google.calendar_freebusy_query. Catalog operation: calendar.freebusy.query. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events.freebusy", "https://www.googleapis.com/auth/calendar.freebusy", "https://www.googleapis.com/auth/calendar.readonly"]