Open document from one-drive directly in office365 using microsoft graph api

Tomas Gil 11 Reputation points
2022-06-15T12:08:41.95+00:00

I'm using the graph API to access the documents in SharePoint. The response I'm getting looks like this:
211618-image.png

I want to let the user open this file (an excel file in this example) using excel desktop app. In other words, I want to resemble in my app the "Open in desktop app" functionality Excel for the web already provides:

211693-image.png

Is that possible?

Thanks in advance.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. ShivaniRai-MSFT-7217 2,746 Reputation points
    2022-06-15T15:09:18.083+00:00

    Hi @Tomas Gil ,

    This functionality which you are looking for is not supported by Microsoft Graph. You can access the document using webUrl property present in the response.

    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.

    1 person found this answer helpful.

  2. Zehui Yao_MSFT 5,876 Reputation points
    2022-06-20T08:56:53.807+00:00

    Hello @Tomas Gil , , currently the Graph API only supports calling data. To open it with a desktop application, the only thing I can think of is to use GET /drives/{drive-id}/items/{item-id} to get @microsoft.graph.downloadUrl Download the file and then open it with the desktop application, or you can submit a feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Microsoft Graph APIs. I will also upvote for you. I hope it can help you.
    212848-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

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.