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

时间:2016-04-04 18:15:24

标签: c# asp.net-mvc google-drive-realtime-api

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?

2 个答案:

答案 0 :(得分:2)

简短的回答是否定的,谷歌不允许自己直接编辑Google文档,也没有用于重新创建文档编辑器的API。

请记住,实时数据实际上并未存储在Google云端硬盘中。谷歌使用Drive作为实时数据的组织方法,但协作的数据本身不仅仅是一个简单的文件。存储在云端硬盘中的 是一种链接到应用实时数据的快捷方式。在现有文件(文本等)的情况下,快捷方式附加到文件,但它也可以是纯快捷方式文件,根本没有非实时数据。只有您的应用才能读取或修改实时数据,这与只有文档可以(直接)使用实时数据的方式相同。

您绝对可以使用实时API重新创建Google文档的功能,从文档导出,使用实时API协作处理导出的数据,然后在必要时重新导入到文档中。那时,Google Docs本身可能是多余的。

涉及的内容将是这样的:

答案 1 :(得分:1)

可以 嵌入 Google编辑器进入您的网络应用,并使用它来编辑,评论或阅读文件,这些文件存储在Google上驾驶。你需要:

  1. 点击文件
  2. 中的分享按钮
  3. 选择了您要与之共享文档的电子邮件(或者您可以选择任何有链接的人,甚至将其公开)
  4. 选择您要授予的权限:阅读,评论,编辑
  5. 复制该链接并将其粘贴到用户界面中的<iframe src=google_link width=x height=y></iframe>标记中。