RedPlanetHQ / RedPlanetHQ/core
New Integration: OneDrive
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 194
- Avg merge
- 12m
- Merged PRs (30d)
- 2
Description
Description
Add OneDrive integration to sync files, folders, and document activity into CORE via Microsoft Graph API.
Reference Implementations
Existing Integrations (use as templates)
integrations/google-docs/- Similar cloud document integrationintegrations/google-sheets/- Google Workspace file integrationintegrations/github/- For webhook and event patterns
Required Files Structure
integrations/onedrive/
├── src/
│ ├── index.ts # Main entry, OAuth spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # Microsoft Graph API utilities
│ ├── account-create.ts # OAuth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
OneDrive API Integration (via Microsoft Graph)
OAuth Setup
- Use OAuth 2.0 with Microsoft Identity Platform
- Microsoft Graph base URL:
https://graph.microsoft.com/v1.0 - Required scopes:
Files.Read- Read user's filesFiles.Read.All- Read all files user can accessFiles.ReadWrite- Read and write user's filesUser.Read- Read user profileoffline_access- Refresh tokens for long-lived access
Key Endpoints
GET /me/drive- Get current user's OneDriveGET /me/drive/root/children- List items in root folderGET /me/drive/items/{item-id}- Get item metadataGET /me/drive/items/{item-id}/children- List folder contentsGET /me/drive/root:/{path}- Access items by pathGET /me/drive/items/{item-id}/content- Download file contentGET /drives/{drive-id}/items/{item-id}- Access shared drivesGET /me/drive/items/{item-id}/delta- Track changes (delta sync)POST /subscriptions- Create webhook subscriptions for change notifications
Core Resources
- Drive - Logical container of files (document library or user's OneDrive)
- DriveItem - Item within a drive (document, photo, video, folder)
Events to Track
- Files - File created, modified, renamed, deleted, moved
- Folders - Folder created, renamed, deleted, reorganized
- Sharing - Files shared, permissions changed
- Versions - File version history changes
- Sync Activity - Delta changes for incremental sync
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement OAuth 2.0 flow with Microsoft Identity Platform in
account-create.ts - Create API utilities in
utils.tsfor Microsoft Graph API - Implement sync logic in
schedule.tsusing delta queries for incremental sync - Set up webhook subscriptions for real-time change notifications
- Convert OneDrive events to CORE activity format
- Add error handling and rate limiting
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- OneDrive is accessed through the Microsoft Graph API, not a standalone API
- URL pattern:
https://graph.microsoft.com/v1.0/{root-resource}/{onedrive-resource} - Delta queries (
/deltaendpoint) enable efficient incremental sync - Webhook subscriptions require a publicly accessible notification URL
- Both personal OneDrive and OneDrive for Business are supported
- The same API can access SharePoint document libraries
Resources
- OneDrive File Storage API Overview
- Working with Files in Microsoft Graph
- OneDrive REST API Getting Started
- OneDrive API Docs (GitHub)
- Microsoft Graph API - Get Drive
Labels
enhancement, integration, new-feature
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing integrations/google-docs/, integrations/google-sheets/, and integrations/github/src/index.ts, then map the required files under integrations/onedrive/. Review the Microsoft Graph OAuth, delta, and subscription requirements before implementing. Done means the listed OAuth, sync, webhook, activity, error-handling, documentation, and integrations/README.md tasks are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100