.png)
Microsoft OneDrive Integration Guide
Integrate Microsoft OneDrive with enterprise systems through Microsoft Graph REST APIs, OAuth 2.0, file operations, delta synchronization, and selected change notifications.
Microsoft OneDrive integration options at a glance
Microsoft OneDrive integrations use Microsoft Graph as the primary REST API for drives, folders, DriveItems, file content, permissions, sharing links, versions, and search. Martini can consume these APIs from workflows, upload small files directly, and coordinate resumable upload sessions for larger files. Microsoft Graph change notifications can trigger synchronization for selected resources, while delta queries provide the durable mechanism for incremental DriveItem synchronization. OAuth 2.0 through Microsoft Entra ID supports delegated and application permissions, subject to scopes and consent. JSON batching can reduce network round trips, although each request remains independently subject to authorization, throttling, and error handling.
| Integration point | Supported by Microsoft OneDrive? | Common use cases | How Martini supports it |
|---|---|---|---|
| Microsoft Graph REST APIs | Yes | Use Microsoft Graph to list drives and folders, create and update DriveItems, search files, manage permissions, read versions, and retrieve file content. | Martini can consume REST endpoints from workflows, map JSON responses, apply business rules, and expose reusable APIs that encapsulate OneDrive operations. |
| File and attachment APIs | Yes | DriveItem APIs support folder creation, metadata operations, direct file upload and download, movement, sharing information, versions, and conflict handling. | Martini can separate metadata and binary-content processing, route files to other systems, and select direct uploads or upload sessions based on file size. |
| Delta synchronization | Yes | Delta queries track created, updated, moved, and deleted DriveItems without repeatedly scanning an entire drive. | Martini can persist delta links, process incremental results, recover from invalid cursors through a new initial sync, and update checkpoints only after successful processing. |
| Webhooks and change notifications | Limited | Microsoft Graph subscriptions provide notifications for selected OneDrive resources and scenarios, but coverage is not universal and subscriptions expire. | Martini can expose a webhook endpoint or receive notifications in a workflow, validate the request, renew subscriptions, and reconcile actual state with a follow-up Graph or delta query. |
| Bulk, batch, and resumable operations | Yes | Microsoft Graph JSON batching combines requests, while upload sessions support large files through multiple resumable requests. | Martini can orchestrate batched calls and upload-session state, handle each response independently, retry failed chunks, and verify the completed DriveItem. |
| OAuth 2.0 and Microsoft Entra ID | Yes | Delegated permissions support user-context access, while application permissions support background services; scopes and administrator consent depend on the operation. | Martini can use secured environment configuration for client credentials, certificates, tokens, and permissions while workflows call Microsoft Graph with bearer authentication. |
| SDKs | Yes | Microsoft provides Graph SDKs for several languages, but SDK use is optional because the primary integration surface is the Microsoft Graph REST API. | Martini can implement API-led workflows directly against documented REST endpoints and use custom JVM-compatible logic only when specialized behavior is required. |
| Database or direct storage access | No | OneDrive does not expose a conventional relational database interface for application integrations. | Martini should access OneDrive through Microsoft Graph, file operations, change notifications, and delta queries rather than a direct database connection. |
How Microsoft OneDrive exposes data and business events
Microsoft Graph REST APIs
Microsoft Graph is the primary REST interface for Microsoft OneDrive. It exposes drives, DriveItems, folders, content, permissions, sharing links, versions, search, and OData query capabilities. OneDrive for Business and SharePoint document libraries are represented through related drive and site resources.
Martini implementation pattern
Martini workflows authenticate with Microsoft Graph, call the required endpoint, handle pagination and response status, map JSON payloads into an internal model, and invoke downstream APIs, databases, or file processes. Reusable Martini APIs can expose controlled OneDrive operations without exposing Microsoft Graph credentials to every caller.
Implementation sequence
File upload and download
OneDrive supports direct content operations for smaller files and resumable upload sessions for larger files. Metadata updates and binary content updates are separate concerns, and upload behavior should define conflict handling explicitly.
Martini implementation pattern
Martini receives or retrieves the file, validates content and metadata, and chooses a direct upload or upload-session workflow based on size and operational requirements. For large files, the workflow persists upload-session state, retries failed chunks, and confirms the resulting DriveItem.
Implementation sequence
Delta synchronization
Microsoft Graph delta queries provide incremental changes for DriveItems, including created, updated, moved, and removed items. A synchronization process stores the returned delta link and uses it as the cursor for the next run.
Martini implementation pattern
Martini starts with an initial listing when no cursor exists, persists the returned delta link, and uses scheduled workflows or another trigger for subsequent calls. The workflow processes removals and updates idempotently, then stores the next cursor only after successful downstream processing.
Implementation sequence
Microsoft Graph change notifications
Microsoft Graph supports change notifications for selected OneDrive-related resources and scenarios. Subscriptions require endpoint validation and renewal, do not cover every OneDrive action, and should not be treated as a complete event history.
Martini implementation pattern
Martini can expose an API or receive a webhook-style notification through a workflow. The notification triggers retrieval of current state or a delta reconciliation, while a separate scheduled process renews subscriptions and detects missed notifications or expired cursors.
Implementation sequence
JSON batching
Microsoft Graph JSON batching combines multiple requests in one HTTP request, which can reduce network round trips. Batching does not remove per-request authorization, throttling, limits, or error handling requirements.
Martini implementation pattern
Martini can construct a batch payload for compatible operations, submit it through Microsoft Graph, and inspect each individual response. The workflow separates retryable and non-retryable results so one failed operation does not obscure the outcome of other requests.
Implementation sequence
Common Microsoft OneDrive integration patterns
Pattern 1: Synchronize OneDrive documents to a records system
When to use this pattern
Use this pattern when an external records, document-indexing, or database system needs an incremental view of OneDrive content. Delta queries avoid repeatedly scanning the full drive, while the DriveItem ID provides a stable idempotency key.
Integration direction
Example Mapping
| Microsoft OneDrive Field | Canonical Field | Target Field |
|---|---|---|
| id | sourceDocumentId | externalDocumentKey |
| name | documentName | title |
| parentReference.path | folderPath | repositoryPath |
| lastModifiedDateTime | modifiedAt | lastUpdated |
Martini implementation pattern
A scheduled Martini workflow loads the stored delta link, retrieves pages of changes, maps DriveItem metadata, downloads content only for relevant files, and writes idempotent upserts or deletions to the target. The workflow persists the new delta link after successful processing and re-establishes an initial synchronization if Microsoft Graph invalidates the cursor.
Martini capabilities used
- scheduled workflows
- API consumption
- delta synchronization
- data mapping
- business rules
- error handling
Pattern 2: Automate document intake from a OneDrive folder
When to use this pattern
Use this pattern when files placed in a designated OneDrive folder must be routed to invoice processing, contract review, records classification, or another downstream workflow. It is suitable for scheduled polling or selected change-notification triggers.
Integration direction
Example Mapping
| Microsoft OneDrive Field | Canonical Field | Target Field |
|---|---|---|
| name | fileName | inputFileName |
| file.mimeType | contentType | documentType |
| size | fileSize | payloadSize |
| webUrl | sourceUrl | sourceDocumentUrl |
Martini implementation pattern
Martini receives a notification or scheduled change result, checks whether the DriveItem is complete and within the intended folder, retrieves the content when required, and submits it to the processing API. A durable DriveItem-based key prevents duplicate submissions, while retry and quarantine paths handle transient failures or unsupported files.
Martini capabilities used
- workflow triggers
- API consumption
- file handling
- data transformation
- validation
- duplicate prevention
- error handling
Pattern 3: Publish application documents to OneDrive
When to use this pattern
Use this pattern when a business application needs to publish generated documents into a user’s OneDrive or a SharePoint-backed document library while keeping Microsoft Graph credentials and folder rules centralized.
Integration direction
Example Mapping
| Microsoft OneDrive Field | Canonical Field | Target Field |
|---|---|---|
| documentId | businessDocumentId | name |
| documentContent | fileBytes | fileContent |
| documentType | documentCategory | folderPath |
| ownerId | businessOwner | driveOwner |
Martini implementation pattern
A Martini API validates the request, resolves the target user, site, drive, and folder, applies naming and authorization rules, and selects direct upload or an upload session. It returns the created DriveItem reference to the caller and records the operation so a retried request does not create an unintended duplicate.
Martini capabilities used
- API exposure
- API consumption
- OAuth 2.0 configuration
- file processing
- business rules
- idempotency
- reusable workflows
Pattern 4: Archive selected OneDrive files
When to use this pattern
Use this pattern when files meeting policy criteria must be copied to an approved external storage or records platform. Selection may depend on folder, extension, owner, modification date, or other metadata available to the integration.
Integration direction
Example Mapping
| Microsoft OneDrive Field | Canonical Field | Target Field |
|---|---|---|
| id | sourceFileId | sourceReference |
| name | fileName | archivedName |
| createdDateTime | createdAt | originalCreatedAt |
| eTag | sourceVersion | contentVersion |
Martini implementation pattern
A scheduled or notification-driven workflow identifies eligible DriveItems, applies retention and permission rules, downloads content only when archiving requires it, and writes the file and metadata to the archive. The workflow records source identifiers and versions, handles deleted or moved items explicitly, and retries transient Graph throttling without duplicating archived content.
Martini capabilities used
- scheduled workflows
- delta synchronization
- file transfer
- data mapping
- policy rules
- retry handling
- audit logging
Applications commonly integrated with Microsoft OneDrive
Microsoft OneDrive can participate in Microsoft 365 document flows and broader enterprise architectures. The following are practical integration examples; outside the Microsoft 365 resource model, the exact file, metadata, and governance design depends on the other application’s APIs and organizational policies.
| Application | Scenario | Direction | Martini Pattern |
|---|---|---|---|
| Microsoft SharePoint Online | OneDrive for Business and SharePoint document libraries use related Microsoft 365 storage and sharing models, allowing organizations to route or synchronize documents between personal work storage and team sites. | Microsoft OneDrive → Martini → Microsoft SharePoint Online | Use Microsoft Graph drive and site resources to identify the source and target libraries, retrieve DriveItem metadata or content, apply document-governance rules, and create or update the destination item with idempotent handling. |
| Microsoft Teams | Teams users share files through channel and chat experiences backed by SharePoint and OneDrive, so generated documents or collaboration references may need to be published into Microsoft 365 storage. | Microsoft Teams → Martini → Microsoft OneDrive | Receive an application request or Microsoft 365 event, resolve the relevant drive and folder, upload or locate the file through Microsoft Graph, and return the DriveItem identifier or sharing URL to the collaboration workflow. |
| Microsoft Outlook | Email attachments may be captured into OneDrive, while OneDrive links can be distributed through email workflows to avoid repeatedly sending large file contents. | Microsoft Outlook → Martini → Microsoft OneDrive | Orchestrate Microsoft Graph mail and file operations, validate attachment metadata, upload content using direct operations or an upload session, and generate a controlled response containing the resulting file reference. |
| Salesforce | Sales documents, account files, and generated proposals may be stored in OneDrive while Salesforce retains business metadata and relationship context. | Salesforce → Martini → Microsoft OneDrive | Use Salesforce APIs and Microsoft Graph in a Martini workflow, map Salesforce identifiers to DriveItem metadata, apply folder and naming rules, and persist the OneDrive ID and URL back to Salesforce with retry-safe updates. |
| ServiceNow | Incident, request, knowledge, or case-related documents can be archived in OneDrive or exposed through controlled OneDrive links. | ServiceNow → Martini → Microsoft OneDrive | Trigger a workflow from ServiceNow or a schedule, validate the case and document metadata, upload the file through Microsoft Graph, and write the resulting DriveItem reference back to ServiceNow while handling duplicate submissions. |
| SAP S/4HANA | Finance, procurement, and operational documents can be published to controlled Microsoft 365 storage while SAP remains the system of record. | SAP S/4HANA → Martini → Microsoft OneDrive | Consume SAP business APIs and Microsoft Graph REST endpoints, derive destination folders from business keys, use upload sessions for large documents, and record the resulting OneDrive identifier and status in the SAP-facing process. |
| Workday | HR documents and generated reports may require controlled file exchange with Microsoft 365 storage, subject to privacy, access, and retention policies. | Workday → Martini → Microsoft OneDrive | Schedule or trigger a Martini workflow, validate employee or report context, apply least-privilege routing rules, transfer content through Microsoft Graph, and log only the metadata required for auditability. |
| Jira | Project requirements, release documents, and issue-related files may be shared through OneDrive links or synchronized into project workflows. | Jira → Martini → Microsoft OneDrive | Use Jira APIs and Microsoft Graph to exchange issue metadata and file references, map stable issue and DriveItem identifiers, and use idempotent updates so repeated notifications do not create duplicate documents. |
How to build a Microsoft OneDrive integration in Martini
Objective
Establish Microsoft Graph access using an appropriate Microsoft Entra ID application and the narrowest delegated or application permissions required by the process.
Instructions in Martini
- Configure OAuth 2.0 settings and Microsoft Graph scopes in secure environment configuration
- Choose delegated access for user-context operations or application permissions for background processing
- Obtain required administrative consent without embedding secrets in workflow definitions
- Confirm whether the target is personal OneDrive, OneDrive for Business, or a SharePoint document library
Objective
Select a trigger that matches the required freshness and event coverage rather than assuming every OneDrive action produces a notification.
Instructions in Martini
- Use a scheduler for reliable incremental synchronization
- Use selected Microsoft Graph change notifications for lower-latency triggers where supported
- Expose a Martini API when another application initiates a file operation
- Combine notifications with delta reconciliation to detect missed or duplicate changes
Objective
Retrieve drives, folders, DriveItems, metadata, or file content through Microsoft Graph while respecting pagination and file-size behavior.
Instructions in Martini
- Resolve the correct drive and destination hierarchy
- Follow @odata.nextLink values for collection responses
- Use delta links for incremental DriveItem synchronization
- Download file bytes only when required by the target process
- Use upload sessions for large files and preserve their state for retries
Objective
Coordinate Microsoft Graph calls, downstream operations, checkpoints, and alternate paths in a maintainable Martini workflow.
Instructions in Martini
- Separate metadata processing from binary-content processing
- Route created, updated, moved, and removed items to explicit branches
- Persist delta links and upload-session state durably
- Use reusable workflow logic for common authentication, mapping, and retry behavior
Objective
Convert Microsoft Graph JSON and file metadata into the canonical model required by the destination system.
Instructions in Martini
- Map DriveItem identifiers, names, paths, timestamps, URLs, and version attributes
- Normalize folder and file naming conventions
- Transform metadata and content references for the target API or database
- Validate required fields before writing downstream
Objective
Apply document-governance, authorization, conflict, retention, and routing rules before changing either system.
Instructions in Martini
- Check the source drive, folder, owner, file type, and business status
- Select replace, rename, or fail behavior for upload conflicts
- Prevent duplicate processing with DriveItem IDs and versions
- Handle personal accounts and SharePoint-backed drives according to their different permission models
Common Microsoft OneDrive data objects used in integrations
| Object | Typical Use | Common target systems | Martini handling |
|---|---|---|---|
| Drive | Represents a user’s OneDrive or a document library and provides the storage context for folders and files. | Microsoft SharePoint Online, Microsoft Teams, document repositories, databases | Martini resolves the correct drive before operating on DriveItems and distinguishes a personal OneDrive from a SharePoint-backed library. |
| DriveItem | Represents a file or folder, including metadata, hierarchy, content, sharing information, and version details. | Salesforce, ServiceNow, SAP S/4HANA, Workday, Jira, databases | Martini maps DriveItem IDs, names, paths, timestamps, parent references, and content attributes, then retrieves binary content only when required. |
| User | Identifies the Microsoft Entra ID or Microsoft 365 user associated with ownership, delegated access, permissions, and sharing. | Microsoft Entra ID, Microsoft 365 applications, HR and identity systems | Martini uses user context to resolve drives and apply authorization or routing rules without embedding user-specific assumptions in workflow logic. |
| Permission | Represents a user, group, link, or inherited access entry for a DriveItem. | Microsoft Entra ID, Microsoft SharePoint Online, governance and records systems | Martini can read or manage permission-related data through Microsoft Graph while enforcing least-privilege and approval rules. |
| SharePoint site resource | Identifies a SharePoint site associated with document libraries exposed through Microsoft Graph drive resources. | Microsoft SharePoint Online, Microsoft Teams, enterprise content systems | Martini resolves the site and associated drive when a business process targets a team library rather than a user’s personal OneDrive. |
| Delta link | Represents the continuation state for incremental DriveItem synchronization. | Databases, synchronization state stores, integration audit stores | Martini stores the delta link securely, processes the returned changes, and replaces the checkpoint only after the workflow completes successfully. |
Authentication and security considerations
OAuth 2.0 and Microsoft Entra ID
Microsoft Graph uses bearer access tokens issued through the Microsoft identity platform. Integrations can use delegated permissions for signed-in user context or application permissions for background services.
Least-privilege permissions
Request only the scopes required for the workflow, such as file read or write access. Broad application permissions and certain delegated permissions may require administrator consent.
Secure configuration
- Store client secrets, certificates, tokens, and related configuration in secure Martini environment settings.
- Do not expose access tokens in logs or workflow payloads.
- Distinguish personal OneDrive accounts from Microsoft 365 work or school accounts when designing permissions.
- Use controlled Martini APIs to centralize Microsoft Graph access and business authorization.
Operational considerations for Microsoft OneDrive integrations
Throttling and retries
Microsoft Graph can return HTTP 429 responses. Honor Retry-After, use exponential backoff when needed, limit concurrency, and avoid unnecessary polling.
Pagination and checkpoints
Follow @odata.nextLink for collections and persist delta links only after successful downstream processing. Expired or invalid delta links require a new initial synchronization.
Idempotency
Notifications and scheduled jobs may overlap or arrive out of order. Use Drive ID, DriveItem ID, ETag, cTag, or another stable source identifier to prevent duplicate writes.
Large files and conflicts
Use resumable upload sessions for large files, retry failed chunks, and explicitly choose replace, rename, or fail behavior for conflicts.
Subscription lifecycle
Change-notification subscriptions require validation, expiration tracking, renewal, and a delta-based reconciliation strategy for missed notifications.
API versioning and testing
Prefer Microsoft Graph v1.0 for stable integrations unless a required capability is available only in beta. Test permissions, pagination, throttling, deletion, file conflicts, and both personal and business account scenarios.
Why use Martini instead of scripts or point-to-point integrations?
Orchestrate more than one API call
OneDrive integrations often combine authentication, drive resolution, metadata retrieval, binary transfer, downstream writes, checkpoint persistence, and retry handling. Martini keeps that behavior in maintainable workflows rather than scattered scripts.
Centralize business rules
Martini can apply folder, file-type, owner, retention, naming, conflict, and authorization rules consistently before data or content is written to another system.
Support multiple integration styles
The same integration estate can use scheduled workflows, Microsoft Graph change notifications, exposed Martini APIs, delta synchronization, direct file transfers, and resumable upload sessions.
Improve operational control
- Use reusable mappings and workflow logic across document processes.
- Persist checkpoints and upload state for reliable recovery.
- Handle throttling, pagination, duplicate notifications, and partial failures explicitly.
- Keep credentials and environment-specific configuration outside workflow definitions.
Frequently asked questions
Microsoft OneDrive is integrated primarily through Microsoft Graph REST APIs and Microsoft identity platform OAuth 2.0. Enterprise workflows can list drives and DriveItems, upload or download files, manage folders and permissions, use delta queries for incremental synchronization, and receive selected Microsoft Graph change notifications.
Yes. Martini can consume Microsoft Graph REST APIs, authenticate with OAuth 2.0, orchestrate file and metadata workflows, use delta queries, coordinate large-file upload sessions, and receive supported Microsoft Graph change notifications through an exposed API or webhook workflow.
No. A dedicated Microsoft OneDrive connector is not required. Martini can integrate using Microsoft Graph REST APIs, Microsoft Entra ID OAuth 2.0 authentication, file upload and download endpoints, upload sessions, delta queries, and selected change-notification resources.
Lonti does not charge an additional per-connector or per-vendor fee to integrate Microsoft OneDrive. The integration is subject to the provisioned capacity of the Martini environment. Separate costs may apply from Microsoft, cloud infrastructure, or other third-party systems based on subscriptions, usage, permissions, and deployment model.
Microsoft Graph REST APIs are the primary method. Use DriveItem and file-content operations for document processing, delta queries for durable incremental synchronization, change notifications for selected low-latency triggers, JSON batching where appropriate, and resumable upload sessions for large files.
Microsoft Graph supports change notifications for selected OneDrive-related resources and scenarios. Coverage is not universal, subscriptions require validation and renewal, and notifications should trigger a follow-up retrieval or delta reconciliation rather than be treated as a complete event history.
A workflow performs an initial DriveItem listing, stores the returned delta link, and later calls that link to process created, updated, moved, and removed items. Martini can persist checkpoints, follow pagination, use stable DriveItem identifiers for idempotency, and rebuild the synchronization cursor when a delta link expires or becomes invalid.
Martini can map Microsoft Graph JSON fields such as DriveItem IDs, names, paths, timestamps, URLs, versions, and parent references into a canonical model. Workflows can apply naming, routing, validation, permission, and content-selection rules before writing metadata or file bytes to another API, database, or storage platform.
Related Martini documentation
Build your Microsoft OneDrive integration with Martini
Use Martini to connect Microsoft OneDrive through Microsoft Graph, automate document workflows, synchronize DriveItems incrementally, and expose controlled APIs for enterprise applications.