I'm trying to create an empty Excel workbook in OneDrive using the Microsoft Graph API. I've tried a variety of requests but OneDrive does not pick up that it is Excel just based on the extension. The only examples I've found are C# SDK examples and I'm looking to do this in another language without an SDK
The following creates the file but creates it with a mime-type of application/octet-stream
PUT /v1.0/me/drive/items/root:/NewWorkbook.xlxs:/content HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer <REDACTED>
{
"name": "NewWorkbook.xlxs",
"file": {
}
}
I found a similar ask from a few years ago but Microsoft Graph has undergone a lot of changes since then so I would assume the answers to be somewhat dated https://stackoverflow.com/a/38901596/10255083