Get file's links with google-drive-api python
<p>I've worked with <code>Google Drive</code> <code>Api</code> some time and I can't find the way to get the link for file's view on Drive pragramatically.<br>
There is <code>function</code> which creates folder and returns its id, however additionally I need to return a <code>link</code> for <code>view</code> only. 
Thank you!</p>

<pre><code>def create_folder(folder_name='no_name', parent_id=''):
    data = {'name': folder_name,
            'mimeType': 'application/vnd.google-apps.folder',
            'parents': [parent_id],
            }
    new = DRIVE.files().create(body=data, fields='id').execute()
    return new.get('id')

folder = create_folder('some_name', 'some_parent_id')
</code></pre>

<p>So, create folder and return a View link is possible by adding "webViewLink" to fields in method files().create(). The function will be the next:</p>

<pre><code>def create_folder(parent_id, folder_name='no_name', ):
data = {'name': folder_name,
        'mimeType': 'application/vnd.google-apps.folder',
        'parents': ['{0}'.format(parent_id)],
        }
new = DRIVE.files().create(body=data, fields='webViewLink, id').execute()
return new.get('webViewLink')
</code></pre>

python google-drive-sdk