How can I retrieve document IDs for all files a user can access in Google Drive?

I’m trying to fetch a complete list of all files and documents that a specific user has access to in their Google Drive account. I attempted to use the Google Document List API with the endpoint https://docs.google.com/feeds/default/private/full?max-results=100&showfolders=true but I keep getting an “Invalid request URI” error message. I’m not sure what I’m doing wrong here. Has anyone successfully implemented this functionality before? What am I missing in my approach? I need to programmatically access all document IDs that belong to or are shared with a particular user. Any guidance on the correct API endpoint or method to achieve this would be really helpful.

The Google Document List API died in 2012 - that’s why you’re getting invalid request errors. You’ll need to switch to Google Drive API v3. Set up OAuth authentication, then use the files.list endpoint with query parameters to filter what you want. Here’s what I learned the hard way: Google caps responses at 1000 items per request, so you’ve got to handle pagination properly. The API pulls files from the user’s Drive plus any shared files they can access. Don’t forget to include the nextPageToken in follow-up requests or you’ll miss stuff. You’ll get back file IDs, names, and metadata for everything the authenticated user can see.

That Document List API got deprecated years ago - that’s why you’re seeing the error. You’ll need to switch to Google Drive API v3. Use the files.list method instead, but make sure you’ve got proper auth set up first. Enable the Drive API in your Google Cloud Console and use OAuth 2.0 scopes like https://www.googleapis.com/auth/drive.readonly. Hit https://www.googleapis.com/drive/v3/files with parameters like pageSize and fields to control what comes back. I hit the same wall building a document management system - getting the scopes right was key for accessing shared files.

yep, that Docs API is ancient. try switching to Drive API v3 instead. you can hit https://www.googleapis.com/drive/v3/files with your OAuth token and it’ll list all files the user has access to, even the shared ones.