.png)

Microsoft 365 Integration Guide
Integrate Microsoft 365 workloads through Microsoft Graph REST APIs, OAuth 2.0, change notifications, delta queries, and file interfaces.
Microsoft 365 integration options at a glance
Microsoft Graph is the primary integration surface for Microsoft 365, providing REST APIs for directory users and groups, Outlook messages and events, OneDrive and SharePoint files, Teams, Planner, and selected reporting resources. Graph change notifications support event-driven processing for selected resources, while delta queries support incremental synchronization where available. JSON batching, asynchronous operations, and DriveItem upload sessions support higher-volume and large-file scenarios. Microsoft Entra ID provides OAuth 2.0 delegated or application authentication. Martini can consume Graph APIs, receive notifications through an HTTPS API, schedule reconciliation workflows, map data, manage pagination and retries, and expose controlled APIs to downstream systems.
Common Microsoft 365 integration patterns
Common Microsoft 365 data objects used in integrations
Authentication and security considerations
Microsoft Entra ID and OAuth 2.0
Microsoft Graph access is generally authenticated through Microsoft Entra ID. Martini workflows can use delegated permissions for user-context scenarios or application permissions with client credentials for backend and scheduled processing.
Least privilege
Permissions vary by workload and operation. Select the smallest delegated scopes or application roles possible, obtain administrator consent where required, and validate tenant, Exchange, SharePoint, OneDrive, and Teams policies.
Secrets and tenant controls
- Store tenant IDs, client settings, certificates, and secrets in protected environment configuration.
- Prefer certificates or supported managed identities over long-lived client secrets where the deployment architecture allows.
- Restrict logs so tokens, authorization headers, message content, and sensitive file data are not exposed.
- Account for Conditional Access, resource-specific consent, licensing, and national-cloud differences.
Operational considerations for Microsoft 365 integrations
Throttling and retries
Microsoft Graph can return HTTP 429 responses and may provide Retry-After guidance. Respect that value, use bounded exponential backoff, and distinguish transient failures from permission, validation, and resource errors.
Pagination and synchronization state
Follow @odata.nextLink values rather than assuming page sizes. Persist delta links as opaque values, handle expiration or invalidation, and retain a full or partial reconciliation path.
Notifications and idempotency
Change notification subscriptions require validation, renewal, expiration handling, and recovery for missed notifications. Use Graph IDs, iCalUId where appropriate, message IDs, DriveItem IDs, eTags, and target identifiers to prevent duplicate processing.
Files, concurrency, and schema changes
- Use upload sessions for large DriveItems and retry safe ranges.
- Use eTags and conditional requests where supported to avoid overwriting newer changes.
- Handle optional properties, time zones, recurrence, deletion markers, and tenant-specific behavior.
- Test documented v1.0 behavior separately from beta APIs and monitor Microsoft Graph changes.
Why use Martini instead of scripts or point-to-point integrations?
Coordinate more than API calls
Scripts often combine authentication, paging, mapping, retries, state, and target writes in code that becomes difficult to operate. Martini represents this behavior as maintainable workflows and reusable APIs.
Support multiple Microsoft 365 workloads
A single integration may involve Users, Events, Messages, DriveItems, SharePoint Lists, and Teams resources. Martini can orchestrate these Graph operations with explicit mappings, validation, and business rules.
Operate reliably
- Use scheduled reconciliation alongside change notifications and delta queries.
- Centralize error handling, retry behavior, correlation state, and monitoring.
- Expose controlled APIs so downstream applications do not need direct Microsoft Graph permissions.
- Extend workflows with custom logic when resource-specific processing requires it.