3.8 KiB
3.8 KiB
Microsoft Excel Routing Reference
App name: microsoft-excel
Base URL proxied: graph.microsoft.com
API Path Pattern
/microsoft-excel/v1.0/me/drive/items/{file-id}/workbook/{resource}
/microsoft-excel/v1.0/me/drive/root:/{path}:/workbook/{resource}
Common Endpoints
Drive Operations
Get Drive Info
GET /microsoft-excel/v1.0/me/drive
List Root Files
GET /microsoft-excel/v1.0/me/drive/root/children
Search Files
GET /microsoft-excel/v1.0/me/drive/root/search(q='.xlsx')
Session Management
Create Session
POST /microsoft-excel/v1.0/me/drive/root:/{path}:/workbook/createSession
Content-Type: application/json
{
"persistChanges": true
}
Worksheet Operations
List Worksheets
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets
Create Worksheet
POST /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets
Content-Type: application/json
{
"name": "NewSheet"
}
Delete Worksheet
DELETE /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('{id}')
Range Operations
Get Range
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/range(address='A1:B2')
Update Range
PATCH /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/range(address='A1:B2')
Content-Type: application/json
{
"values": [
["Value1", "Value2"],
[100, 200]
]
}
Get Used Range
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/usedRange
Table Operations
List Tables
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/tables
Create Table
POST /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/tables/add
Content-Type: application/json
{
"address": "A1:C4",
"hasHeaders": true
}
Get Table Rows
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/tables('Table1')/rows
Add Table Row
POST /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/tables('Table1')/rows
Content-Type: application/json
{
"values": [["Data1", "Data2", "Data3"]]
}
Delete Table Row
DELETE /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/tables('Table1')/rows/itemAt(index=0)
Get Table Columns
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/tables('Table1')/columns
Named Items
List Named Items
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/names
Charts
List Charts
GET /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/charts
Add Chart
POST /microsoft-excel/v1.0/me/drive/root:/workbook.xlsx:/workbook/worksheets('Sheet1')/charts/add
Content-Type: application/json
{
"type": "ColumnClustered",
"sourceData": "A1:C4",
"seriesBy": "Auto"
}
Notes
- Only
.xlsxfiles are supported (not legacy.xls) - Use path-based access (
/drive/root:/{path}:) or ID-based access (/drive/items/{id}) - Table/worksheet IDs with
{and}must be URL-encoded - Sessions improve performance for multiple operations
- Sessions expire after ~5 minutes (persistent) or ~7 minutes (non-persistent)
- Range addresses use A1 notation