Hiroki
Hiroki

Reputation: 4173

Google Drive API: How to get a sharable link to Google docs? (alternateLink, webViewLink return null)

I referred to this posting and this posting, still clueless as to how to get a link to a Google Doc.

According to the offical document, webViewLink is "A link for opening the file in a relevant Google editor or viewer in a browser". However, it doesn't return anything but null, while other properties, such as id or mimeType, return expected values. (webContentLink returns null too.)

I could simply use this URL, https://drive.google.com/open?FILE_ID_HERE, but I'm not sure this works in other people's browser.

I'd appreciate any advice!

Upvotes: 0

Views: 1414

Answers (1)

Amit Agarwal
Amit Agarwal

Reputation: 11268

If you know the file ID of a Google Document, you can use the following URL to access the file in the browser.

https://drive.google.com/open?id=FILE_ID

The link will be accessible to anyone with whom you have shared the file.

Upvotes: 7

Related Questions