【问题标题】:Getting PERMISSION_DENIED when try to access Google Sheets with API Key尝试使用 API 密钥访问 Google 表格时获得 PERMISSION_DENIED
【发布时间】:2016-09-27 11:29:51
【问题描述】:

如果我尝试使用像这样的基本电子表格.values.get 请求从 Google 表格中获取数据

https://sheets.googleapis.com/v4/spreadsheets/1p7sFt.....gRu9A/values/Sheet!1A1:L7?key=AIza.....oTXg it works.

但是,如果我向请求中添加更多参数,它会失败。 例如:

https://sheets.googleapis.com/v4/spreadsheets/1p7sFt.....gRu9A/values/Sheet1!A1:L7**?majorDimension=COLUMNS**?key=AIza.....oTXg

然后返回:

{
  "error": {
    "code": 403,
    "message": "The request cannot be identified with a client project. Please pass a valid API key with the request.",
    "status": "PERMISSION_DENIED"
  }
}

【问题讨论】:

    标签: api-key google-sheets-api


    【解决方案1】:

    对多个查询字符串参数使用和号&,而不是多个?

    https://sheets.googleapis.com/v4/spreadsheets/1p7sFt.....gRu9A/values/Sheet1A1:L7**?majorDimension=COLUMNS**&key=AIza.....oTXg
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-16
      • 2018-07-03
      • 2014-09-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多