I'm not sure this created the workbook in the right format. When I run PUT, the workbook is created but cannot be opened due to this error.
PUT https://graph.microsoft.com/v1.0/me/drive/root:/MyShop.xlsx:/content
I observe it does not have any worksheets by default. Curious if the PUT should have a body that adds in some of that. Output when trying to create a new worksheet in it:
{
"error": {
"code": "MetroFileFormatMismatch",
"message": "This workbook couldn't be opened because the file format may not be matching with the file extension.",
"innerError": {
"code": "unsupportedWorkbook",
"message": "The request failed. The workbook contains unsupported features or exceeds the size limit.",
"innerError": {
"code": "MetroFileFormatMismatch",
"message": "This workbook couldn't be opened because the file format may not be matching with the file extension."
},
"date": "2022-08-23T08:09:54",
"request-id": "**",
"client-request-id": "**"
}
}
}
When I try to manually open it, I get the same error:
@Zehui Yao_MSFT yes, it works when I upload a file with the same extension. It's quite the hack. I was looking for a direct POST endpoint.
This helps, we are hoping to run this endpoint in the background without having prior access or upload for any .xlsx file. We may have to think of a workaround to make this PUT method work for us.