MS Entra – Calendars – Get Free/Busy Schedule
MS Entra – Calendars – Get Free/Busy Schedule
Get schedule information for users or resources.
Action details
| Property | Value |
|---|---|
| Action label | MS Entra – Calendars – Get Free/Busy Schedule |
| Category | CloudTools |
| Apex class and method | GetMSGraphSchedule.getSchedule |
| Input type | GetMSGraphSchedule.GetMSGraphScheduleInput |
| Output type | List<MSGraphScheduleInformation> |
| Authorization | Microsoft 365 connector; supported authorization depends on the endpoint and target. |
| Microsoft Graph request | POST /me/calendar/getSchedule or /users/{userEmail}/calendar/getSchedule |
Prerequisites and permissions
Configure a CloudTools Connector with Connector Type set to Microsoft 365. Complete sign-in for OAuth Delegated (Authorization Code). For supported OAuth Application (Client Credentials) requests, grant application permissions and administrator consent. The identity must have access to the selected resource; directory operations can also require Microsoft Entra roles. Use Creating an Entra ID App and Integration Connectors for setup.
The action permission provider declares these alternatives. They are not cumulative requirements or universally interchangeable; check the Microsoft reference for endpoint, target, and property restrictions.
| Permission type | Declared alternatives |
|---|---|
| Delegated | Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite |
| Application | Calendars.ReadBasic, Calendars.Read, Calendars.ReadWrite |
Endpoints: /me/calendar/getSchedule or /users/{userEmail}/calendar/getSchedule.
See the Microsoft operation and permissions reference.
Inputs
| Input | Apex field | Type | Required | Description |
|---|---|---|---|---|
| User Email | userEmail | String | No | Email address of the user |
| Schedules | schedules | List<String> | Yes | Email addresses or identifiers to query |
| Start Time | startTime | MSGraphDateTimeTimeZone | Yes | Start of the schedule window |
| End Time | endTime | MSGraphDateTimeTimeZone | Yes | End of the schedule window |
| Availability View Interval | availabilityViewInterval | Integer | No | Interval in minutes for the availability view |
Supply a nonempty list with a non-null first request. Graph actions process only that first request. Global inputs do not expose connectorId; subscriber Apex and Flow use CloudTools connector selection. Use Microsoft Graph resource IDs or the specifically documented user identifier, and resolve dynamic values before invocation.
Start Time fields (MSGraphDateTimeTimeZone)
| Field | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Date Time | dateTimeValue | String | No | Date and time in ISO 8601 format |
| Time Zone | timeZone | String | No | Time zone name. Refer to the CloudTools Picklists – Timezone Values object for valid values. |
End Time fields (MSGraphDateTimeTimeZone)
| Field | Apex field | Type | Required | Description |
|---|---|---|---|---|
| Date Time | dateTimeValue | String | No | Date and time in ISO 8601 format |
| Time Zone | timeZone | String | No | Time zone name. Refer to the CloudTools Picklists – Timezone Values object for valid values. |
Outputs
Returns a flat list of MSGraphScheduleInformation items, rather than the nested list used by most collection actions. An unmapped response produces an empty list.
| Output | Apex field | Type | Description |
|---|---|---|---|
| Schedule Id | scheduleId | String | Identifier for the schedule |
| Availability View | availabilityView | String | Aggregated availability view |
| Schedule Items | scheduleItems | List<MSGraphScheduleItem> | Scheduled availability items |
| Working Hours | workingHours | MSGraphWorkingHours | Working hours for the schedule |
Behavior and limits
This implementation maps the returned collection without following or exposing @odata.nextLink. A result can contain only the first page; do not treat it as a complete tenant or resource inventory.
Delegated authorization can select /me for user-calendar operations. Outside delegated access, supply the target user required by runtime validation; optional invocable user fields can still be conditionally required.
Start Time and End Time require both dateTimeValue and timeZone. Schedules is a list of addresses/identifiers. Supply a sensible start/end window and supported availability interval; this action queries free/busy information, not calendar event creation.
Use in Flow
Use MS Entra – Calendars – Get Free/Busy Schedule where supported. Use a Microsoft 365 application connector configured as Set as default for Flow automations only if the endpoint and target support application access. Supply required values, retain useful outputs, and add fault handling. Delegated connections are not supported for CloudTools Flow automation. The action processes only the first input request.
Use in custom Apex
This subscriber-org example uses the Apptigent namespace. Replace identifiers and example values before use. Configure the connector, complete authorization first, run in a context permitting callouts, and handle exceptions, empty results, and unmapped fields.
Apptigent.GetMSGraphSchedule.GetMSGraphScheduleInput request =
new Apptigent.GetMSGraphSchedule.GetMSGraphScheduleInput();
request.userEmail = 'someone@example.com';
request.schedules = new List<String>{ 'someone@example.com' };
request.startTime = new Apptigent.MSGraphDateTimeTimeZone();
request.endTime = new Apptigent.MSGraphDateTimeTimeZone();
request.availabilityViewInterval = 30;
request.startTime.dateTimeValue = '2026-10-13T09:00:00';
request.startTime.timeZone = 'UTC';
request.endTime.dateTimeValue = '2026-10-13T10:00:00';
request.endTime.timeZone = 'UTC';
List<Apptigent.MSGraphScheduleInformation> results =
Apptigent.GetMSGraphSchedule.getSchedule(
new List<Apptigent.GetMSGraphSchedule.GetMSGraphScheduleInput>{ request }
);
System.debug(results);
Use in a Lightning Web Component
Use getMSGraphSchedule from msEntraConnectorLib through MSEntraConnectorController. These c/ imports apply in the same namespace. Set request.connectorId for direct MSEntraAction calls. The controller captures the request selection for MSEntraAction.
| Global input | LWC request mapping |
|---|---|
userEmail | request.userIdOrPrincipalName |
schedules | request.schedules |
startTime | startDateTime and startTimeZone |
endTime | endDateTime and endTimeZone |
availabilityViewInterval | request.availabilityViewInterval |
entraActionExample.js
import { LightningElement } from 'lwc';
import { getMSGraphSchedule } from 'c/msEntraConnectorLib';
export default class EntraActionExample extends LightningElement {
result = null;
errorMessage = '';
isRunning = false;
completed = false;
async handleRun() {
if (this.isRunning || this.completed) return;
this.isRunning = true;
this.errorMessage = '';
try {
const request = { connectorId: 'REPLACE_WITH_CONNECTOR_RECORD_ID' };
request.userIdOrPrincipalName = 'someone@example.com';
request.schedules = ['someone@example.com'];
request.startDateTime = '2026-10-13T09:00:00';
request.startTimeZone = 'UTC';
request.endDateTime = '2026-10-13T10:00:00';
request.endTimeZone = 'UTC';
request.availabilityViewInterval = 30;
this.result = await getMSGraphSchedule(request);
this.completed = true;
} catch (error) {
this.errorMessage = error.requiresInteractiveAuthorization
? 'Sign in to Microsoft for the connector, then try again.'
: error.message || 'The Entra action failed.';
} finally {
this.isRunning = false;
}
}
}
entraActionExample.html
<template>
<lightning-button label="Run action" onclick={handleRun}
disabled={isRunning}></lightning-button>
<p role="alert">{errorMessage}</p>
</template>
The library returns an array of mapped DTOs. The controller can flatten nested fields, serialize data, or map an action result into an operation DTO. rawJson contains serialized mapped Apex data rather than the untouched Graph response.
Use getMSEntraAuthorizationState, beginMSEntraAuthorization, and createMSEntraOAuthMessageHandler to arrange delegated sign-in. The library normalizes errors but does not automatically sign in or retry. Reset completed for a new deliberate operation, and inspect resource state before retrying a mutation with an uncertain outcome.
Error handling and troubleshooting
| Symptom | What to check |
|---|---|
| Required fields error | Supply a nonempty request list and required or conditionally required inputs. For LWC, use the mapped field names. |
| Authorization or access denied | Check connector selection, sign-in, endpoint/target permission support, administrator consent, directory roles, and resource access. |
| Resource not found | Check Microsoft IDs and parent resource relationships. Preserve group/drive/item associations and mailbox/calendar/event IDs. |
| Missing or unexpected output | Check query support, pagination, wrapper versus item models, public-only properties, and mapped DTO fields. |
| Operation rejected | Inspect the Microsoft error, supported writable fields, group/calendar restrictions, recipient/license data, and file transfer limits. |