title: How to get the link after uploading to Google Drive via api in python?
body: <p>Here am using google drive API with python to upload files to google drive, how can I get the link of the uploaded file.</p>
  
  <p>I tried <code>print (res['exportLinks'])</code>, but it gives me this error.</p>
  
  <blockquote>
    <p>KeyError: 'exportLinks'</p>
  </blockquote>
  
  <p>Complete python code</p>
  
  <pre><code>#!/usr/bin/env python
  
  from __future__ import print_function
  import os
  
  from apiclient import discovery
  from httplib2 import Http
  from oauth2client import file, client, tools
  
  SCOPES = 'https://www.googleapis.com/auth/drive'
  store = file.Storage('storage.json')
  creds = store.get()
  if not creds or creds.invalid:
      flow = client.flow_from_clientsecrets('client_secrets.json', SCOPES)
      creds = tools.run_flow(flow, store)
  DRIVE = discovery.build('drive', 'v2', http=creds.authorize(Http()))
  
  FILES = (('hello.txt', False),)
  
  for filename, convert in FILES:
      metadata = {'title': filename}
      res = DRIVE.files().insert(convert=convert, body=metadata,
              media_body=filename, fields='mimeType,exportLinks').execute()
      if res:
          print (res['exportLinks'])
  </code></pre>
  
  <p>Is there any alternate way to do this.  </p>
  
  <p>thanks in advance.</p>