I am trying to get all the items underneath a specific folder.
I was using this documentation:
https://developers.google.com/drive/v2/reference/files/list
And based on it I wrote the following:
string url = string.Format("https://www.googleapis.com/drive/v2/files?'q'=\"'{0}' in parents\"", folderId);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = WebRequestMethods.Http.Get;
WebResponse response = request.GetResponse();
And I get an error:
(401) UnAuthorized
Or when I copy-paste the request to the browser I get this:
{ "error": { "errors": [ { "domain": "global", "reason": "required", "message": "Login Required", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Login Required" } }
I also used this question as a reference:
Getting a list of files by folder on Drive SDK
And I can't see what I've done differently
EDIT:
I have this parameter that contains the authentication:
DriveService service
Before, in order to get ALL files I was doing this:
FilesResource.ListRequest request = service.Files.List();
But now when I'm trying to take specific items, I'm not sure how to combine that service