0👍
✅
When you perform the list request, speicfy the properties fields
In your case:
return gapi.client.drive.files.list({
"fields": "files/webViewLink"
})
To perform a gapi.client.drive.files.list()
request – please follow the quickstart for Drive API which is available among others for client-side Javascript and for node.js.
Another way to retrieve the webViewLink
– if you know the fileId
and it is more feasible for vue.js would be hardcode it as
var webcontentlink = ' https://docs.google.com/uc?id='+fileId+'&export=download'
Source:stackexchange.com