title: Google Drive API v3 (googleapiclient.errors.HttpError 404 File not found)
body: <p>I'm trying to upload a pdf file created on my computer with path <code>output_pdfs/&lt;pdf-name&gt;.pdf</code>. I'm using the <code>id</code> of the parent folder of where I want to upload the files to in my code. I'm getting an HttpError 404 &quot;File Not Found .&quot;, referring to the parent ID (parent folder). I've read <a href="https://stackoverflow.com/a/34279002">here</a> I can get the parentID by using the childID but that doesn't work as I want to create a sub-folder (child) because it might not exist yet.</p>
  <p>Steps I've done:</p>
  <ol>
  <li>Shared the Google Drive folder with the service account and set it to &quot;Content Manager&quot;</li>
  <li>Added auth scopes for my service account in my python code <code>&quot;https://www.googleapis.com/auth/drive&quot;</code></li>
  <li>Ensured that my gcloud credentials are set correctly, <code>gcloud auth list</code> shows I'm using the same credentials that I shared the sheet with.</li>
  </ol>
  <pre><code>def deliver_to_google_drive(output_pdf, creds, parentFolderID, folderToCreate):
      drive_service = build('drive', 'v3', credentials=creds)
      file_metadata = {
          'parents':[parentFolderID],
          'name': output_pdf
      }
      media = MediaFileUpload(output_pdf, mimetype='application/pdf',resumable=True)
      file = drive_service.files().create(body=file_metadata, &quot;&quot;&quot;&lt;-- 404 error here&quot;&quot;&quot;
                                          media_body=media,
                                          fields='id').execute() 
      print('File ID: %s' % file.get('id'))
      file.Upload()
  </code></pre>
  <p>Thank you.</p>