I am trying to download a file from SharePoint Online using the app-only token. I can get file information using this URL
https://graph.microsoft.com:443/v1.0/sites/{siteId}/drives/{driveId}/list/items/{itemId}/driveItem
But when I try to upload a file with this URL
https://graph.microsoft.com:443/v1.0/sites/{siteId}/drives/{driveId}/list/items/{itemId}/driveItem/content
I get the following error
403 FORBIDDEN
Content-Length →13
Content-Type →text/plain; charset=utf-8
Date →Fri, 13 Apr 2018 08:47:12 GMT
MicrosoftSharePointTeamServices →16.0.0.7604
P3P →CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"
SPIisLatency →2
SPRequestDuration →53
X-Content-Type-Options →nosniff
X-MS-InvokeApp →1; RequireReadOnly
X-MSDAVEXT_Error →917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
X-MSEdge-Ref →Ref A: B9E0C567B0CC4E60AEE93EEB8DC06AF1 Ref B: VIEEDGE0813 Ref C: 2018-04-13T08:47:12Z
X-Powered-By →ASP.NET
X-SharePointHealthScore →0
what's wrong?
it seems that inside it generates a download link (... / _ layouts / 15 / download.aspx? UniqueId = ...), which works with the username / pwd token, but does not work with the "application only" token
I have another Office 365 subscription that works with the app-only token. The other subscription has its own domain, but I do not see other differences in the configuration (both have the LegacyAuthProtocolsEnabled property set to true, the same sharing options ...)
EDIT: , , , !