Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:51:12+00:00 2026-06-08T13:51:12+00:00

I had written a program that creates a file object, which by defaults gets

  • 0

I had written a program that creates a file object, which by defaults gets created in the root folder if no parent is specified. Then given the id of the file’s parent it retrieves the root folder.

For some strange reason this no longer works, instead of returning the root folder I get a File Not Found error. Any ideas?

Thanks

Update

I tried retrieving the file by passing in “root” as the file_id and I encountered the same error.

Get File By ID Error: File not found: 0AFrTA6Qc9-_TU9PVA

Below is the function used

def get_file_by_id session, file_id
  drive = session.discovered_api("drive", "v2")
  result = session.execute api_method: drive.files.get, parameters: {'fileId' => file_id}
  if result.status == 200
    return result.data
  else
    raise "Get File By ID Error: #{result.data['error']['message']}"
  end
end

I am however able to get other file’s by ID except the root.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:51:14+00:00Added an answer on June 8, 2026 at 1:51 pm

    Without seeing code, hard to say what you’re doing wrong. But, there’s a much easier way to go about getting the root folder for a user than what you’re doing!

    You can use the special ‘root’ ID to reference the root folder of the current user.

    GET https://www.googleapis.com/drive/v2/files/root

    That will return back info about the root folder. It’s also available in the about collection.

    Update: Details about the root folder are only available using the https://www.googleapis.com/auth/drive scope. When using the file scope, there isn’t a way to ‘open’ the root folder from the Drive UI or Picker in order to authorize access by the app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had earlier written a program in java which takes in as input a
I've written a program in Haskell which had to load and parse big text
I am trying to write a program in PHP which I had already written
I have written a C++ program that reads in a file and outputs the
I had written a program in Python 3, but now want to convert it
This question has baffled myself and my cohorts. In the program I had written
I had written a small utility app just for my phone, which stopped the
I have written a COM object that in turn uses a thrid party ActiveX
I have created a program in Java using eclipse that contains a couple of
I'm looking for a regular expression testing program that I had installed on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.