I'm building an api that uses google drive with a service account.
Google Drive objects come with a @web_view_link
property that looks like:
"https://drive.google.com/file/d/0B9eyEerjltIgZ2dyUTB1eGNjYUk/view?usp=drivesdk"
When I access this @web_view_link
in the browser using a personal account, the link is functional and the object can be downloaded from there.
When I paste the @web_view_link
in the browser using a service account, Google Drive complains about permissions and I cannot access it, even tho I am accessing with an account owner.
Is it possible to access a download link from google drive using a service account?
I'm using google-drive-ruby
gem and this is the code to retrieve that @web_view_link
url:
def create_url
folder_name = Discourse.current_hostname
found = google_files.select { |f| f.id == id }
file_title = found.first.title
file_url = session.collection_by_title(folder_name).file_by_title(file_title).human_url
end