客户没有足够的权限

时间:2020-04-22 02:18:16

标签: r google-sheets-api googlesheets4

我当前正在运行

library(googlesheets4)
sheets_auth()

dat=read_sheet("https://docs.google.com/spreadsheets/d/1R9XuH9Wej-p6HdkFGV2IsHuCmA9w0s7M3-jzE3S-Qrs/edit#gid=950673024", sheet="Summary", range=cell_rows(1:777))

并获得以下输出。

Suitable tokens found in the cache, associated with these emails:
  * dcallow@umd.edu
  * ddcc2442@gmail.com
The first will be used.
Using an auto-discovered, cached token.
To suppress this message, modify your code or options to clearly consent to the use of a cached token.
See gargle's "Non-interactive auth" vignette for more details:
https://gargle.r-lib.org/articles/non-interactive-auth.html
The googlesheets4 package is using a cached token for dcallow@umd.edu.
> 
> dat=read_sheet("https://docs.google.com/spreadsheets/d/1R9XuH9Wej-p6HdkFGV2IsHuCmA9w0s7M3-jzE3S-Qrs/edit#gid=950673024", sheet="Summary", range=cell_rows(1:777))
Error: Client error: (403) PERMISSION_DENIED
  * Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project.
  * The caller does not have permission

我不确定是否是强迫我使用第一封电子邮件的问题?是否可以更改为第二个令牌?但是我也对为什么不再要求我进入我的Google帐户进行身份验证感到困惑?

有什么想法可能会发生这种情况吗?我是API的新手。

1 个答案:

答案 0 :(得分:1)

你可以试试这个

图书馆(googlesheets4)

gs4_auth_configure(api_key = "A........bMGBUA")

您应该在凭据中创建一个 api 密钥 https://console.cloud.google.com/apis/credentials

我等待它可以帮助您