Currently stuck with getting the filename of a ressource from SharePoint online aka Office 365. Authentication and refresh token is from the Unified Api example aka Microsoft Graph.
var authResult = await authContext.AcquireTokenByAuthorizationCodeAsync(
...
var imgBytes = await httpClient.GetByteArrayAsync(parameters.FileGet);
return File(imgBytes, "application/specialFormat", "File1.specialFormat");
At the moment I have to define my own filename. I' ve already seen the example at http://graph.microsoft.io/en-us/docs/overview/overview, but the "GET my files" example shows only how to get the files of one person and not how to get a filename based upon a file Id. I hope someone could clarify this.
https://graph.microsoft.com/v1.0/me/drive/root/children
Is getting a filename based upon the file id with the Graph api possible or do I have to use something else?
EDIT Some queries that would work:
https://graph.microsoft.com/v1.0/me/drive/root/children?$select=id
https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=name eq 'testfile.office'
But if I try to search for the specific id the query fails and I get none information.
https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=id eq '01QXOQU7OCV7FW2BQNAZD3KNZMYXVMNJD6'