I have enabled the Document ID feature in my Office 365 Sharepoint collections. I would like to store the Document ID on our php server and then be able to allow the server to download the document using the document ID.
I have successfully set up both the microsoft-sdk-php (using the app only tenant permissions) and the phpSPO libraries (using the microsoft graph api interface). In both cases, I cannot figure out how to use the document ID to retrieve the actual name and path of a document. If I use the standard name/path of the file, I can successfully download it to the server.
With the microsoft-sdk-php library, I have tried searching the drive items, but cannot determine how to search by the document ID. The documentation on the Microsoft Graph API on using DriveItems/Search (using the filter q="...") seems very incomplete. I've tried multiple variations using in attempting to filter using DocId, _dlc_DocId, and other variations (again, the exact name of this field is not clear from the documentation).
I have also tried using curl to capture the redirect of the Document ID URL (xxxxxx.sharepoint.com/_layouts/15/DocIdRedir.aspx?ID=XXXXXXX-2222222222-86), but I either get forbidden errors or it fails to properly redirect.
I've also looked into using a query to search a sharepoint drive, but I haven't had success - in part because I cannot determine where and how the 'Document Id' field is stored.