添加 Google Drive 账户
Google Drive 设置
Section titled “Google Drive 设置”以下步骤需要在 Google Cloud Console 中完成,以创建 PlaidCloud 可用于访问 Google Drive 的服务账户。
创建 Google Cloud 项目
Section titled “创建 Google Cloud 项目”- 登录 Google Cloud Console
- 创建新项目或选择现有项目
启用 Google Drive API
Section titled “启用 Google Drive API”- 导航到 APIs & Services > Library
- 搜索 Google Drive API
- 选择它并点击 Enable
创建服务账户
Section titled “创建服务账户”- 导航到 APIs & Services > Credentials
- 选择 + Create Credentials > Service account
- 输入服务账户的名称(例如
plaidcloud-drive) - 选择 Create and Continue
- 可选择授予角色(例如只读用 Viewer,读写用 Editor)。选择 Continue。
- 选择 Done
生成服务账户密钥
Section titled “生成服务账户密钥”- 在 Service Accounts 列表中,选择刚创建的服务账户
- 导航到 Keys 选项卡
- 选择 Add Key > Create new key
- 选择 JSON 格式并选择 Create
- 将下载一个 JSON 密钥文件。请妥善保存该文件,其中包含 PlaidCloud 将使用的凭据。
与服务账户共享 Drive 内容
Section titled “与服务账户共享 Drive 内容”- 复制服务账户的电子邮件地址(例如
plaidcloud-drive@your-project.iam.gserviceaccount.com) - 在 Google Drive 中,将希望 PlaidCloud 访问的文件夹与该电子邮件地址共享,并授予 Editor 访问权限
现在,您应该已具备将 Google Drive 账户添加到 PlaidCloud 文档所需的一切。
PlaidCloud 文档设置
Section titled “PlaidCloud 文档设置”- 登录 PlaidCloud
- 选择新文档账户所在的工作区
- 转到
Document > Manage Accounts - 选择
+ New Account按钮 - 选择
Google Drive作为服务类型 - 填写名称和说明
- 在 起始路径 字段中输入共享文件夹路径,或留空以访问所有共享内容
- 根据您的使用场景选择合适的 安全模型。如果不确定,请保持为
Private。 - 将 JSON 密钥文件的全部内容粘贴到“身份验证凭据”下的“OAuth2 凭据 JSON”字段中
- 选择“保存”按钮,您的新文档账户即可使用