1
votes

As may devs, I want to get a list of all files in a specific folder. I have the following basic tree structure

root
   swimmer
      trainings
         test1.doc
         test2.doc
      logs
         resultsA.csv
         resultsB.csv

trying to list files in root/swimmer/trainings , I tried to use :

 GET https://www.googleapis.com/drive/v2/files/trainings/children

and tested it within https://developers.google.com/drive/v2/reference/children/list

but I get the 404 response :

404 Not Found
- Show headers -
  {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "File not found: trainings"
   }
  ],
  "code": 404,
  "message": "File not found: trainings"
 }
}

I also tried : GET https://www.googleapis.com/drive/v2/files?maxResults=10&projection=BASIC&q='trainings'+in+parents&key={YOUR_API_KEY}

same result not found ..

where am I wrong ?

1

1 Answers

1
votes

Many things wrong in both your http urls. Look up the docs carefully. In #1 its not the folder name, its the folder id (or else how do you think it would know which of the possibly several folders named 'trainings' to use?)