首页 > 解决方案 > Google Sheets API 适用于一张纸,但不适用于另一张

问题描述

以下代码有效:

let sheet = "c750833d5021f60a1b9cc9bf0a21bb9dc74cff12"
let range = "Sheet1"
let apiKey = "6e0ece719a48d1337e69bd881b4324aa957e4407"

let url = `https://sheets.googleapis.com/v4/spreadsheets/${sheet}/values/${range}?key=${apiKey}`

fetch(url)
    .then(res => res.json())
    .then(data => {
        console.log(data)
    })
    .catch(err => err);

但是,对于另一张纸,代码在执行时什么也不做。可能是什么问题?

两张表都有链接共享。

标签: javascriptgoogle-sheetsgoogle-api

解决方案


推荐阅读