I'm looking to connect to the Microsoft Graph API and interact with a small Excel workbook on my OneDrive.
I am able to successfully authorize & connect to OneDrive through the Graph API, query my personal OneDrive contents, and I can even find the .xlsx workbook and grab its ID. A GET
request to this endpoint is successful:
https://graph.microsoft.com/v1.0/me/drive/recent
The response to that above GET
request includes (some data omitted):
{createdDateTime: "2017-12-13T04:24:57Z", lastModifiedDateTime: "2017-12-13T04:26:09Z"}
id:"{id}"
name:"transactions.xlsx"
However, connecting to this "transactions.xlsx" workbook through a graph API call seems to struggle in my web application. For example a GET
request here:
https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets('Sheet1')/usedRange
returns workbook data successfully through the Graph Explorer. But merely copying + pasting that API call into my app then fails with:
{
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"request-id": "7716493f-cc32-413e-b4fa-5855df7ad181",
"date": "2017-12-13T14:54:43"
}
}
}
What am I missing about Graph API calls that is allowing my OneDrive queries to pass but the Excel queries to claim item not found
?
This is a business Microsoft Graph/O365 account
/workbook
but on/items/{id}
) work? It sounds like the file itself is not resolving. Could you try and update the results? – Sudhi Ramamurthy