2012-09-10 64 views
0

我是新的使用谷歌脚本和驱动器sdk。谷歌驱动器sdk:致电谷歌驱动器sdk

我想调用drive-sdk的复制功能。当我尝试它时,我收到一条消息,说我需要验证。

我在哪里可以找到一个如何从谷歌脚本进行身份验证以验证de drive-sdk的示例?

在此先感谢。

比亚

+0

您需要使用OAuth 2.0与谷歌,它使用访问令牌机制进行身份验证。 –

回答

0

首先,查看Google的authorising with the Drive API的信息。

然后,选择您希望使用的语言,如果您想玩或正在制作网络应用程序,我会推荐使用JavaScript(或Node.js)。如果你愿意,你可以查看simplified explanation of the OAuth2.0 flow

为了澄清,你可以用它来获得在JavaScript中去(作为一个例子)的基本步骤是:

  1. 查看this official Google getting started page
  2. Set up the Drive API in the Google Developers Console
  3. 复制从
  4. 入门页面的代码
  5. 确保将您的ClientID从Google Developer Console放入复制的代码
  6. 如果您还没有安装Python(版本2或3)
  7. 开始使用Python(python -m SimpleHTTPServer 8000为第2版)和负载“http://localhost:8000/quickstart.html” Web服务器到浏览器