Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
Fetching Google Sheets API v4 receives 401

I am using GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId} to get some data from my Google Sheets by using fetch API + Sheet v4 API

let fetch_url = "https://sheets.googleapis.com/v4/spreadsheets/1UOaYEl8i33Bco5PaIXAljWkPFmt3j3i1tohXwNl3vvs?key=" + apiKey
    let fetch_option = {
        method: 'GET',
        headers: {
            Authorization: `Bearer ${accessToken}`,
            'Content-Type': 'application/json'
        }
    }
    fetch(fetch_url,fetch_option)
    .then(res => function(res){
        console.log(res.JSON())
    })

But I have received 401 when I am running this fetch function. May I know what am I missing?

"permissions":[
    "activeTab",
    "identity",
    "http://*/"
],
"background":{
    "scripts":["src/script/background.js","src/script/jsrsasign-all-min.js"],
    "persistent": false
},
"oauth2": {
    "client_id": "Client ID",
    "scopes":["https://www.googleapis.com/auth/spreadsheets",
        "https://sheets.googleapis.com/v4/spreadsheets/*"]
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda