Get OneDrive Object ID for the current Word document

I am studying creating an add-in for Microsoft Word that involves making a copy of the current document.

I found where I can copy an item through the OneDrive API . However, this requires an item identifier to copy the document.

I cannot find how to get the item id for the current Word document through the Office JavaScript API.

I looked at the object Office.context.documentas well as the Office.context.document.getFileAsync()and functions Office.context.document.getFilePropertiesAysnc().

How will someone get the ID of the OneDrive item for the current Word document?

+2
source share
1 answer

, Office.js, Microsoft Graph, .

, URI, getFilePropertiesdAsync. URI. Children, , .

, URI https://d.docs.live.net/<id>/Documents/somedoc.docx, :

  • OneDrive ( URI live.net)
  • somedoc.docx
  • Documents

, Graph:

https://graph.microsoft.com/v1.0/me/drive/root/children/Documents?$filter=name eq 'somedoc.docx'

. , OneDrive, OneDrive . , , .

+2

Source: https://habr.com/ru/post/1685860/


All Articles