Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!