I tried to download a file with Grpah API.
Tested with API browser, https://graph.microsoft.io/en-us/graph-explorer#
Ran following request, got list of file/fold
It is not supported to perform request to https://graph.microsoft.com/beta/me/drive/items/<itemid>/content
endpoint via Graph Explorer.
The request sent to https://graph.microsoft.com/beta/me/drive/items/<itemid>/content
endpoint via Grath Explorer is issued as a preflight request. The server responds with 302-Redirect
but redirects are not allowed for preflighted requests due to CORS behavior.
Here is a workaround on how to download a file
The following drive item resource request:
https://graph.microsoft.com/beta/me/drive/items/<itemId>
returns @microsoft.graph.downloadUrl
annotation which contains the actual link to file resource.
Once the drive item resource is retrieved, perform another GET request to url from @microsoft.graph.downloadUrl
to return the actual file.