I have questions regarding the behavior of the Google Drive v3 API files resource thumbnailLink
property for Google Docs files. There are two different types of thumbnail links created depending if the file is a Google Doc or other type of file. When going to the thumbnailLink
URL for a Google Doc I always get a 404 response, unless I open it on a Chrome browser where I am logged in with the same Google account.
My questions about the thumbnail link are:
- What is the minimum OAuth scope required to access it?
- What are the exact criteria required for me to have see the thumbnail image in a browser instead of getting a 404?
- Is it possible to make the link to google doc thumbnails publicly accessible?
- If not, is there some alternative way to build the thumbnail url?
I preferably want to avoid this answer as it will either expose the access key or add complication by setting up a proxy.
This is the format of the google doc thumbnail link: https://docs.google.com/feeds/vt?gd=true&id=1TjchRkZ0MxurnBkKNitDtoMQiyJUV6rv0z9HQ7kHEg0&v=3&s=AMedNnoAAAAAXaTCgqfi_sjlT4SAGAEd_ZABNBoSvMnM&sz=s220
Other types of documents that use the following type of thumbnail link are publicly available: https://lh3.googleusercontent.com/JkrFnbTt-H1rJb-kXhjRsQI3NiiVu7DYD_L7kBLPvBzu4-ieXNB6Jb-ukQpHwujlzybaeirEyV0=s220
I see this behavior in the Drive v3 "Try This API" screen with all scopes authorized. I go to the thumbnailLink immediately after getting the response so it is not expired.
Edit: The webViewLink
works for me in the case of a google slide. So I am allowed to see the full contents publicly using that link but still get a 404 with the thumbnaiLink
. Based on that inconsistency this seems like a bug, not a security or permissions issue.