title: google-api-javascript-client : How to get contents of file using Drive API?
body: <p>First off, if there is a question/answer that solves my problem already then I sincerely apologize for creating a new one. However, I have been searching for 3 days now, and have not found an answer...</p>
  
  <p>My problem is, I cannot for the life of me figure out how to pull the contents of a file(any file). From reading the docs I've discovered that my returned file resource object is supposed to have a property named "downloadUrl", and from this I should be able to access the file contents.</p>
  
  <p>None of the file resource objects that are returned to me(via gapi.client.request) have this field/property. Below is the function I am using to get a file.
  Can someone please help point me in the right direction? I have to have this demo done by Monday and I've been stuck on this for 2 days....</p>
  
  <p>Here is the code for my get function :</p>
  
  <pre><code>Client.getFileContent = function getFileContent() {
       gapi.client.load('drive', 'v2', function() {
            var request = gapi.client.request({
                 path : '/drive/v2/files/1QmaofXyVqnw6ODXHE5KWlUTcWbA9KkLyb-lBdh_FLUs',
                 method : 'GET',
                 params : {
                      projection: "FULL"
                 }
            });
            request.execute(function(response) {
                 console.log(response);   
            });
       });
  };
  </code></pre>
  
  <p>The file resource object that is returned to me does not have the downloadUrl property.</p>
  
  <p>As requested, here is the response object I get back for a text file. Note, I replaced some of the ids with "fileid" for posting here.</p>
  
  <pre><code>"kind": "drive#file",
     "id": "fileID",
     "etag": "\"-tJAWr_lbRQU2o8gZ0X7BCBIlVk/MTM0MjYyODQ1MTQ2Nw\"",
     "selfLink": "https://www.googleapis.com/drive/v2/files/fileID",
     "alternateLink": "https://docs.google.com/document/d/fileID/edit",
     "embedLink": "https://docs.google.com/document/d/fileID/preview",
     "thumbnailLink": "https://docs.google.com/feeds/vt?gd=true&amp;id=fileID&amp;v=1&amp;s=AMedNnoAAAAAUAfLhbYIDsNIn40k7DfRYBsrquijmCii&amp;sz=s220",
     "permissionsLink": "https://www.googleapis.com/drive/v2/files/fileID/permissions",
     "title": "Copied filed.txt",
     "mimeType": "application/vnd.google-apps.document",
     "labels": {
      "starred": false,
      "hidden": false,
      "trashed": false,
      "restricted": false,
      "viewed": true
     },
     "createdDate": "2012-07-18T16:20:51.132Z",
     "modifiedDate": "2012-07-18T16:20:51.467Z",
     "modifiedByMeDate": "2012-07-18T16:20:51.467Z",
     "lastViewedByMeDate": "2012-07-18T16:20:51.467Z",
     "parents": [
      {
       "kind": "drive#parentReference",
       "id": "0AAAYYkwdgVqHUk9PVA",
       "selfLink": "https://www.googleapis.com/drive/v2/files/fileID/parents/0AAAYYkwdgVqHUk9PVA",
       "parentLink": "https://www.googleapis.com/drive/v2/files/0AAAYYkwdgVqHUk9PVA",
       "isRoot": true
      }
     ],
     "exportLinks": {
      "application/vnd.oasis.opendocument.text": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=odt",
      "application/msword": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=doc",
      "text/html": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=html",
      "application/rtf": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=rtf",
      "text/plain": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=txt",
      "application/pdf": "https://docs.google.com/feeds/download/documents/export/Export?id=fileID&amp;exportFormat=pdf"
     },
     "userPermission": {
      "kind": "drive#permission",
      "etag": "\"-tJAWr_lbRQU2o8gZ0X7BCBIlVk/9STkNeCmz61YXorH3hoJimnEgfM\"",
      "id": "current",
      "role": "owner",
      "type": "user"
     },
     "quotaBytesUsed": "0",
     "ownerNames": [
      "Joshua.morine"
     ],
     "lastModifyingUserName": "Joshua.morine",
     "editable": true,
     "writersCanShare": true
    }
  </code></pre>