I am trying to get the public URL of a given file stored in Google Drive. I want to do it for general binary files (ie: no PDFs, TXT, etc., but a general file).
Looking at https://developers.google.com/google-apps/documents-list/#downloading_documents_and_files works to download the file, but I do not want to download. I want to get the public URL to post it somewhere else.
Note that the file is shared at "visible to anyone with link" level (so if I get the link anybody with the link can see it).
I found a hack, using the suggestion from here: Getting the download link for a public Google Docs file.
I build the URL like https://docs.google.com/uc?export=download&id={Insert DocId here}. I get the DocId using the Google Data .NET API.
The thing is that the URL (https://docs.google.com/uc?export=download&id=) is hardcoded in my code. I have been looking in the classes to get the complete URL from the API, instead of building it myself.
BTW: I am using the Google Data API 2.1 http://code.google.com/p/google-gdata
Thanks.