title: Sorting a list of files by modifiedTime (Google Drive API)
body: <p>Im currently making a website with Google Drive integration and im running into a problem. The API docs state that i can sort a list of files based on <code>modifiedTime</code> but when i try to make this request, im getting an invalid value response.</p>
  
  <p><strong><em>Error calling GET <a href="https://www.googleapis.com/drive/v2/files?q=%270Bxm0A6z2alblOHk1ZEtrcUF0Slk%27+in+parents&amp;orderBy=folder%2CmodifiedTime%2Ctitle&amp;key=HIDDEN" rel="nofollow">https://www.googleapis.com/drive/v2/files?q=%270Bxm0A6z2alblOHk1ZEtrcUF0Slk%27+in+parents&amp;orderBy=folder%2CmodifiedTime%2Ctitle&amp;key=HIDDEN</a>: (400) Invalid Value</em></strong></p>
  
  <p>Excerpt from the Google Drive API docs:</p>
  
  <blockquote>
    <p>A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.</p>
  </blockquote>
  
  <p>This is my query (PHP) :</p>
  
  <pre><code>public function listFiles($folder_id)
  {
      return $this-&gt;drive-&gt;files-&gt;listFiles([
          "q" =&gt; "'$folder_id' in parents",
          "orderBy" =&gt; "folder,modifiedTime,title"
      ]);
  }
  </code></pre>
  
  <p>If i remove the <code>modifiedTime</code> from the <code>orderBy</code> values. The query completes successfully.</p>