MS Graph WorkbookApplication/Calculate API With Application Permissions

Tommy He 5 Reputation points
2025-01-09T18:48:58.86+00:00

Hello,

We are interested in using the API call here: https://learn.microsoft.com/en-us/graph/api/workbookapplication-calculate with Application permissions. It is ran on an internal server without needing a user auth workflow.

A similar thread is here: https://learn.microsoft.com/en-us/answers/questions/560738/ms-graph-workbookapplication-calculate-api-call-pe?page=1&orderby=helpful&comment=answer-563574

Calling this endpoint with user_id and file_id also worked with this url:

f"{GRAPH_MS_URL}/v1.0/users/{C.MS_USER_ID}/drive/items/{ms_file_id}/workbook/application/calculate"

(though with code 204 similar to Zachary's screenshots rather than the documented code 200); however, there was delay between when we received a response in the API and when it actually seemed to persist for the next GET request on the same file (a few secs).

It would be great if there are answers for:

  1. Is this supposed to be supported or could it be terminated at any point? FWIW this is an important use case for us and would definitely prefer it to be officially in the docs : )
  2. Is there a way to "sync" the persisted file with the edits or only have the edits to the file return once the changes have fully persisted?

Appreciate any insights / plans!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,748 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,073 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,141 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Akhil Nasalwai - MSFT 165 Reputation points Microsoft Vendor
    2025-01-10T15:12:39.5633333+00:00

    Hello Tommy He,

    Thank you for contacting Microsoft!

    Regarding the query of using application permissions for the Graph API Endpoint, currently this API does not support using application permissions as per the official documentation as referenced below.

    Link: Workbook application calculate

    User's image

    It might be working with application permissions, in such cases if there is important use case for you and if you would definitely prefer it to be officially in the docs, you can submit this feature request using this support link, which will be monitored by Microsoft team and make the enhancements to Graph API.

    For Syncing persisted edits, to ensure that changes are immediately reflected, you can use the persistent session mode which ensures that all changes made to the workbook are saved and persisted. You can set the persistChanges parameter to true in your API requests to enable this mode. This should help minimize the delay between making edits and having them available for subsequent GET requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.