Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Drive API - Can I integrate Google Docs in my web application?

One of the requirements for the web application I'm creating is that users should be able to create and edit documents. I've been searching around and I came across the Google Drive REST API, however I'm a little unsure about what it can do.

From what I understand, the API allows my application to access a user's Google Drive account and their files, being able to open and edit them, as well as create documents using my application.

However, I was hoping that I could be able to use the Google Docs editor itself to create and open/edit documents, but from what I can gather is that the editor is up to me to create, and that I can use the Realtime API to enable the collaboration feature that Google Docs offers.

Is this the case? Is Google leaving the job of actually creating the document editor itself up to me (sorry if I sound like a whiny child here, it's an honest question), or does Drive API also provide their editor? The reason I want to use their editors is because it perfectly fits the requirements for the application, and it will be near impossible for me to compete with their document editor.

If I do I have to create the editor myself, can anyone recommend any open source/free document editors with similar features to that of the Google Docs editor that works with C# ASP.NET, or a way that I could somehow use the Google Docs editor in my application?

like image 294
RoyalSwish Avatar asked Apr 04 '16 18:04

RoyalSwish


2 Answers

The short answer is no, Google does not allow directly editing Google Docs themselves, nor is there an API for recreating the Docs editor.

Bear in mind also that realtime data is not actually stored in Google Drive. Google uses Drive as its organisation method for realtime data, but the data itself, being collaborative, is not just a simple file. What is stored in Drive is a shortcut which links to your app's realtime data. In the case of an existing file (text etc), a shortcut is attached to the file, but it can also be a pure shortcut file, with no non-realtime data at all. Only your app can read or modify that realtime data, in much the same way that only Docs can (directly) work with its realtime data.

You can definitely re-create the capabilities of Google Docs using the realtime API, by exporting from Docs, using the realtime API to collaborate on the exported data, then re-import into Docs if necessary. At that point, Google Docs themselves may be superfluous.

What's involved will be something like this:

  • Set up an app in the Google developers console
  • Write the editor, and incorporate it in your app
  • Get the user to authorize your app to access their Drive
  • Using the picker, or another method, get the user to select a file.
  • Import that file from Docs
  • Collaboratively edit it within your app
  • Export it back to Docs.
like image 59
HeyHeyJC Avatar answered Nov 15 '22 03:11

HeyHeyJC


You can embed Google Editor in to your web app and use it to edit, comment or read files, that are stored on Google Drive. You need:

  1. click share button in the file
  2. chose emails you want to share document with (or you can choose any one who has link, or even make it public)
  3. choose permissions you want to grant: read, comment, edit
  4. copy that link and paste it in the <iframe src=google_link width=x height=y></iframe> tag in your UI.
like image 39
Oleg Kuts Avatar answered Nov 15 '22 04:11

Oleg Kuts