APIs
75 TopicsSize Discrepancy Between /drives & /root Endpoints
To preface this post, please view the below link. https://learn.microsoft.com/en-us/answers/questions/1257868/microsoft-onedrive-drive-size-is-different-in-driv When retrieving the total size of a drive via the /drives endpoint - one gets a response as follows. { "deleted": 3143, "remaining": 212025579370, "state": "normal", "total": 1099511627776, "used": 887486045263 } When retrieving the same drive via its /drives/{id}/root endpoint - it returns the following metric. "size": 75217259136 The 'used' metric matches the Microsoft Admin Center OneDrive usage panel. The 'size' metric matches the actual downloaded size of the drive. What is the cause for a discrepancy of 800 GB? A response to the other post details, "The difference between the two values is the additional space used by the system." Could I have some specifics of where I could acquire this system data (or at the very least view some metadata for it)? Thanks!14Views0likes0CommentsUploading files to OneDrive Personal via API fails when filename starts with "Windows"
Hi everyone, We've encountered a strange issue with our backup tool that affects random users. Files with names starting with "Windows" (e.g., Windows.gif) fail to upload to OneDrive Personal accounts, regardless of whether we're using: Simple Item Upload (PUT request) Resumable Item Upload (POST to create an upload session) Both methods return a 404 Not Found error. Details: Simple Upload Fails after the PUT completes. Resumable Upload Fails during the session creation call. No issues with filenames not starting with "Windows." A similar unresolved issue was reported here. Sample Request & Response: Simple Upload: PUT /v1.0/drive/items/{item-id}:/Windows.gif:/content Authorization: Bearer [token] Host: api.onedrive.com Response: HTTP/1.1 404 Not Found Payload: json { "error": { "code": "itemNotFound", "message": "Item does not exist" } } Resumable Upload: bash POST /v1.0/drive/items/{item-id}:/Windows.gif:/upload.createSession Authorization: Bearer [token] Content-Type: application/json Response: HTTP/1.1 404 Not Found Payload: json { "error": { "code": "itemNotFound", "message": "Item does not exist" } } Key Observations: Random Accounts Affected: Issue occurs inconsistently across different OneDrive Personal accounts. No Request ID: Failed responses lack request IDs, making tracing difficult. Inconsistent Reproduction: I can't reproduce it on my account, but my colleague can. Uploading the same file via the OneDrive web interface works fine. Trying to force URL-encode the filename in the request results in the same error Questions: Has anyone encountered this before? Could this be related to reserved keywords or API filtering rules? Any advice on debugging this further, given the lack of request IDs? Thanks.26Views0likes0CommentsOneDrive direct download link
Hi, We have tried to get direct download link or to access publicly shared drive file with Graph API . It seems that the the URL structure has changed as well as the API. The thing behind the API is that i cant access file though https://graph.microsoft.com/v1.0/shares/{sharedDriveItem-id} this endpoint since when i get the link and try to encode it to get sharedDriveItem-id the response is that the "The sharing link no longer exists, or you do not have permission to access it.". Anyone has any idea how to get direct download URL from initial public share URL give by someone? Thank you.90Views0likes0Commentspersonal account can't search files
hello,recently I found that personal account can't search files by GET /me/drive/root/search(q='{search-text}') . I am sure the target file exist in OneDrive. I can access it by GET /me/drive/root/children. is anyone know why and how can I solve it? here are my personal account testing result screenshot: the folder named "Documents" is exist. and the search result is a empty array also, here are communications records in Microsoft Q&A: https://learn.microsoft.com/zh-cn/answers/questions/2133894/onedrive-rest-api103Views0likes0CommentsApp Folder is being named "Graph"
There is an issue where the App Folder is being named "Graph" instead of the intended Application Name for some users, specifically those uploading to "my.microsoftpersonalcontent.com." Scenario: 1 A user logs in to the application and OneDrive via OAuth. 2 The user uploads a file to OneDrive. Expected Outcome: The file should be uploaded to /apps/**MyApp**/SomeFile.txt Actual Outcome: The file is uploaded to /apps/**Graph**/SomeFile.txt The upload process utilizes the following special URL: OneDrive API: Get Special Folder https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder?view=odsp-graph-online The request is made using: POST https://graph.microsoft.com/v1.0/me/drive/special/approot:/SomeFile.txt:/createUploadSession This returns a URL for posting the upload: https://my.microsoftpersonalcontent.com/personal/XXXXXXX/_api/v2.0/drive/items/YYYYYYYY/uploadSession?guid='XXXXX4-4YYYY-bCCCDDDDDDD'&overwrite=True&rename=False&dc=0&tempauth=d3f4f4f4f4f....61Views1like0CommentsUrl encoded folder names not decoded on server end
When using the OneDrive API I am url encoding the file names so for example a file with a plus or hash symbol would get encoded the the percent symbol escape sequence. This works correctly for files and they are created on OneDrive with the correct characters. When I create a folder this does not work correctly. I encode the name in the same way but when the folder is created on OneDrive it still contains the percent symbol so it seems not to be decoding server side. Does anyone know how to fix this? ThanksSolved190Views0likes2CommentsOneDrive API and the standard Attribute enum
I need to iterate over many user's OneDrives and set the PINNED attribute ("Always keep on this device"): FILE_ATTRIBUTE_PINNED 0x00080000. In looking at drive/driveitem via the Graph API I can get a reference to a user's OneDrive and a file, but I don't see the "real" attributes. Are these not exposed by the Graph API? If not, is there another way to automate this?166Views0likes0CommentsSpecial appfolder is sometimes named Graph
Expected or Desired Behavior According to the documentation at https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder the special appfolder should be named /Apps/{Application Name} Observed Behavior For some users the appfolder is named /Apps/Graph even though the app name is not Graph. For users with the appfolder named Graph the create subscription request fails. The create subscription request for the resource /me/drive/special/approot fails with 503 and the message [Status Code: ServiceUnavailable; Reason: User content migrated. Cannot access disabled item.] Steps to Reproduce This happens for some of our users, but not all. I have been able to reproduce it on one onedrive-user that i have personal access to. Does anyone have any idea how to resolve this? OneDrive is unusable for 50% of our users at the moment.255Views2likes0CommentsBase URL used for Multi Tenants
Hello, I want users to select files from their personal and company drive but it requires a base url which is used to authenticate the user into the drive but the code examples and the docs don't have any indication of where to get a dynamic base url or the base url to use for the multiple tenants. Right now it only works for users in my organisation but I need it for users. Edit: I am using the v8 file picker Thank you3.6KViews1like5Comments