如何让 GoogleSheet_ID 在 'google_drive' gem 中使用它
How to get GoogleSheet_ID to use it in 'google_drive' gem
我有用户 google_drive
gem,使用 oAuth2 我也收到了 access_token 详细信息。但是当我要获取我的 google sheet 之一的内容时,我发现找不到错误,如下所示:
notFound: File not found: 1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0
下面是我的代码:
session = GoogleDrive.login_with_oauth(@client) // @client is my googleAuth Object
sheet = session.spreadsheet_by_key("1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0").worksheets[0]
我的 Sheet URL 是:https://docs.google.com/spreadsheets/d/1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0/edit#gid=0
请帮我找一下Google Sheet Id.
我认为您使用的 ID 是正确的,可能是其他原因导致此问题。
如果您勾选 Google Drive API error,
404: File not found: {fileId}
The user does not have read access to a file, or the file does not
exist.
Suggested action: Report to users that they do not have read access to
the file or that the file does not exist. Tell them that they should
ask the owner for permission to the file.
也许您遗漏了一些 authorization scopes。尝试使用完全权限。
我有用户 google_drive
gem,使用 oAuth2 我也收到了 access_token 详细信息。但是当我要获取我的 google sheet 之一的内容时,我发现找不到错误,如下所示:
notFound: File not found: 1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0
下面是我的代码:
session = GoogleDrive.login_with_oauth(@client) // @client is my googleAuth Object
sheet = session.spreadsheet_by_key("1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0").worksheets[0]
我的 Sheet URL 是:https://docs.google.com/spreadsheets/d/1s-APBHuCQLhvAFUeAQyFpyJJiNwyy_ZenQUe91WDru0/edit#gid=0
请帮我找一下Google Sheet Id.
我认为您使用的 ID 是正确的,可能是其他原因导致此问题。
如果您勾选 Google Drive API error,
404: File not found: {fileId}
The user does not have read access to a file, or the file does not exist.
Suggested action: Report to users that they do not have read access to the file or that the file does not exist. Tell them that they should ask the owner for permission to the file.
也许您遗漏了一些 authorization scopes。尝试使用完全权限。