77 lines
2.1 KiB
Markdown
77 lines
2.1 KiB
Markdown
---
|
|
name: microsoft-graph
|
|
description: Microsoft Graph API access for Mikkel's Outlook (mikpar@outlook.dk) and OneDrive. Use for reading/writing emails, calendar, and files. Triggers on Outlook, OneDrive, Microsoft 365 tasks.
|
|
---
|
|
|
|
# Microsoft Graph Skill
|
|
|
|
Access to Mikkel's Microsoft 365 account (mikpar@outlook.dk) via Graph API.
|
|
|
|
## Capabilities
|
|
|
|
- 📧 **Mail** — Read, send, organize emails
|
|
- 📁 **OneDrive** — Read/write files
|
|
- 📅 **Calendar** — Read events (if permitted)
|
|
- 👤 **Profile** — User info
|
|
|
|
## Authentication
|
|
|
|
Uses OAuth 2.0 device code flow with delegated permissions.
|
|
|
|
**Credentials:**
|
|
- **Account:** mikpar@outlook.dk
|
|
- **Client ID:** 14d82eec-204b-4c2f-b7e8-296a70dab67e
|
|
- **Tenant:** consumers
|
|
- **Token file:** `~/.config/microsoft-graph-tokens.json`
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
# List mail folders
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/graph_api.py folders
|
|
|
|
# List emails in Inbox
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/graph_api.py emails --folder Indbakke --limit 10
|
|
|
|
# Get email by ID
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/graph_api.py email --id <message_id>
|
|
|
|
# List OneDrive root
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/graph_api.py onedrive
|
|
|
|
# Refresh token (when expired)
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/graph_api.py refresh
|
|
```
|
|
|
|
## Token Refresh
|
|
|
|
Tokens expire after ~1 hour. Use refresh command or re-authenticate:
|
|
|
|
```bash
|
|
python3 ~/.openclaw/skills/microsoft-graph/scripts/auth.py
|
|
```
|
|
|
|
## Folder Structure (mikpar@outlook.dk)
|
|
|
|
```
|
|
📥 Indbakke
|
|
├─ Aftaler og bookinger (99)
|
|
├─ CHRISTIAN - ADMINISTRATION (1915)
|
|
├─ JOAKIM - PROJEKT (3)
|
|
├─ MESTER MANUALEN (8)
|
|
├─ MICHELLE - SUPPORT (2813)
|
|
├─ Online Handel (1022)
|
|
├─ ERHVERV
|
|
│ ├─ PARLO BYG ApS
|
|
│ └─ Parlo Holding ApS
|
|
├─ ROUND TABLE
|
|
│ ├─ Frederik Stenild
|
|
│ └─ Lasse Olsen
|
|
└─ PRIVAT (+ subfolders)
|
|
```
|
|
|
|
## References
|
|
|
|
- [Graph API Reference](references/graph-api.md)
|
|
- [Mail API](https://learn.microsoft.com/en-us/graph/api/resources/mail-api-overview)
|
|
- [OneDrive API](https://learn.microsoft.com/en-us/graph/api/resources/onedrive)
|