onedrive-api-docs: OneDrive item ID is undefined when selecting a SharePoint file
Category
- Question
- Documentation issue
- Bug
Expected or Desired Behavior
Using the OneDrive JS file picker v7.2, selecting a SharePoint file from the Recent tab should properly generate the API request URL.
Observed Behavior
After successfully opening the picker, navigating to Recent, and selecting a SharePoint file from the UI, the request made by the SDK is missing the driveitem ID in the URL.
GET https://graph.microsoft.com/v1.0/drives/<user_drive_id>/items/undefined/?expand=etc...

This, understandably, results in a 404 Not Found response:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ResourceNotFoundException",
"message": "Cannot find resource for the request undefined.",
"innerError": {
"request-id": "59d430ec-47d8-49fb-8271-6620e0b9611c",
"date": "2019-02-25T22:24:52"
}
}
}
Note that selecting this exact same file when navigating the SharePoint Document hierarchy works just fine. It’s only when selecting this file from the “Recent” tab that the error occurs.
Steps to Reproduce
This is the configuration we are using to open the file picker:
let options = {
clientId: <client_id>,
action: 'query',
multiSelect: false,
advanced: {
redirectUri: <redirectUri>,
queryParameters: 'select=id,name,size,file,package,@microsoft.graph.downloadUrl&expand=thumbnails',
},
success: () => {},
error: () => {},
cancel: () => {},
};
OneDrive.open(options);
From what I understand, our specified scopes are simply the defaults: User.Read, Files.Read.All.
Please let me know if I’ve left anything out that might be helpful!
Thank you.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15 (8 by maintainers)
Tentative ETA for fix rolled-out to 100% of PROD is 4/8 EOD
It looks like the build containing the fix didn’t make it out due to unrelated circumstances. We’re working to cherry-pick the change.
@elidupuis @ldcm3 it looks like this is a bug with how the hosted page maps the Graph ID for the selected entity / entities in “Recent” tab under
-mytenant… We’re working on a patch to the hosted page that will need to roll-out to address.The item id is currently being omitted from the response under the
-mytenant. Without that information neither the SDK nor additional Graph API calls will resolve.Will follow-up with additional information re: roll-out status as I have it.
cc: @aditima @ThomasMichon
Since we have confirmations that this fix is available in prod, I’m going to let the bot close this out over the next few days.
Thanks to @elidupuis and @ldcm3 for reporting and coordination. Special thanks to @ThomasMichon for the fix.
Oh thats unfortunate. =/ Could you please share a new ETA when you have one?
Thanks for reporting this @elidupuis. This looks like it may be related to an API change with “Recent items”. I’m following-up with the internal group cc: @ificator. Hope to provide a fix ETA soon.