Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

590
Views
How to get google drive folders path

I have authenticated for google drive using passport js

Now I have access token

So I am looking for to get all folders path with their respective folder Id.

I am not aware what parameters need to set to get only folders path and folder id

I am using google-drive library for fetching lists

Here is my code

var googleDrive = require('google-drive')
 var param={}
 googleDrive(accessToken).files().list(params, (err, response, body) => {
                       //fetch folders path
                    })

Thanks.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try changing

var param={}

to

var param={q: "mimeType='application/vnd.google-apps.folder' and trashed=false"}

With all due respect to the authors of the library you are using, be very careful. Either a library deal with all of Drive's subtleties (eg. following nextPageTokens) or it will cause you problems. The Drive REST API is a very well formed API, and you could just as easily access it using Fetch, which, being Promise based, makes for much cleaner code and allows you to use async await.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!