Google Drive/Doc API Saving and Importing - download

My website currently creates a word document for users (docx format) and sends it to them as a downloadable so they can save it to their computer.
What I would like to know is if an Open in Google Doc "Button/Feature" exists. So instead of downloading the docx, the user could open it directly into their Google Drive and/or Google Doc account.
Is this possible?
Thanks,

Related

Cannot download docx file submitted to google drive through google classroom

So when I submit a .docx file through google classroom it gets converted into a file with mimetype application/vnd.openxmlformats-officedocument.wordprocessingml.document and stored in the Classroom folder of the teacher's google drive.
I want to read the contents of this file so I can do analysis on them, but cannot find a suitable way to do this.
Initially, I tried using the google docs api
GET https://docs.googleapis.com/v1/documents/{documentId}
This threw an error that the mimetype was incorrect.
The google drive api for files/get allows me to get a download url for the document, but unfortunately this requires in browser authentication so I cannot make this work programmatically.
How shall I proceed to read the contents of this file?
I believe some possible solutions are converting the application/vnd.openxmlformats-officedocument.wordprocessingml.document mimetype into the standard google docs mimetype, or having a download url that doesnt require authentication, but I do not know how to do either of these!
Thanks in advance!

Where can I store a user accessible Google Slides template?

I'm currently working on a website which allows reports to be generated and saved as a Google Slide via the Google Slides API. The reports are generated using a template slide which contains placeholder shapes which are then populated with graphs and text.
My problem is that the template Google Slides file needs to be accessible to any user who decides to generate a report. But...
Google Drive can only be authorized via oAuth. Users coming to the site will not be able to authenticate any drive which does not belong to them
The template cannot be stored in the codebase as the slides API is only able to interact with files stored in the cloud AND it is not possible to download a file in 'Google Slides format'
It could be possible to store the template on Google Cloud Storage, but it is not possible to import a Slides file without converting it to another format. Attempting to convert the file once it has been uploaded does not produce a new slides file within the cloud storage
Is there anywhere I could store my Google Slides template and have it accessible to my application at all times so that it may generate reports based on that template?

Generate Google Photo link from Google Picasa Web API data call

I am currently trying to generate a url to link to a public Google Photos gallery. I am aware from some research that all calls regarding Google Photos go through the Picasa API. So, by running file_get_contents on the following URL, I have retrieved a full listing of all public albums on my user account
http://picasaweb.google.com/data/feed/api/user/<USERNAME>?alt=json&kind=album&hl=en_US
This works perfectly and includes links to the gallery in Picasa. However, I would much prefer to be able to generate a link to the corresponding Google Photos gallery. On sharing Google photos, a shortened url is generated, like
https://goo.gl/photos/code
I was wondering if there was any possible way, given the album ID from the API call that such a link could be generated
Previous questions on this subject haven't generated much response unfortunately - is anyone aware of any such Google link generation capability?

Save uploaded files to Google Drive from website built on Ruby Volt

I'm building a web site using Ruby Volt for a publication. I'd like users to be able to upload images that will be stored on Google Drive. The Google Drive will belong to the publication, not to the site users who are uploading the images. If possible, I'd like the fact the images are being stored on Google Drive to be transparent to the site users.
The publication staff will access the images via their Google Drive.
My head is swimming with the Google documentation… Does anybody know if this is doable? If it is can you offer any pointers to example code or suggestions on how to get started?
So I can't help with the google drive API side of things, but in Volt, you can use a HttpController to post a input type="field". In the http controller, you can call params._field_name to get the data from rest. That will provide a tempfile you can copy out. Once I get time I'll make a demo app for file upload.

Is there a way to levearge Google Drive API to allow your application to create Google Docs from within your own system?

We were using an Iframe, then we started to use the API for Google Drive. We want to allow users to create a Google Doc from within our system w/o leaving our application. Does anyone know if this is possible?
Insert a new file with one of the Google Docs mimeTypes and wait for the response.
POST https://developers.google.com/drive/v2/reference/files/insert
{ "mimeType": "application/vnd.google-apps.document" }
Once response arrives, it'll contain an attribute called embedLink. Use embed link on iframe.
All available Google Docs mime types are on https://developers.google.com/drive/mime-types

Resources