I am using https://graph.microsoft.com/v1.0/drives/{drive id}/items/{item id}/content?format=pdf and downloading docx/xlsx file.
I am getting below error when user1 has no permission to download the file.
HTTP Status Code: 400, body: {'error': {'code': 'generalException', 'message': 'Error from Office Service. Url=https://wordcs.officeapps.live.com/document/export/pdf HttpCode=BadRequest cert=subject:;thumbprint: ResponseHeaders=X-ErrorCode: WordFileDownloadFailed\r\nX-ClientCorrelationId: 2*****************************d\r\nX-ServiceCorrelationId: ********************\r\nX-ErrorCategory: BadRequest\r\nX-IsRetriable: False\r\nCache-Control: private\r\nDate: Fri, 11 Feb 2022 17:23:27 GMT\r\nServer: Microsoft-IIS/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-Powered-By: ASP.NET\r\n', 'innererror': {'code': 'OfficeConversion_RemoteDownload'}}}
However, when another user2 which has download permission, downloaded it once, then user1 which doesn't have download permission can also download the file using the same above endpoint.
I followed API docs from Microsoft but no help.