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

425
Views
Google Drive API: Is it necessary to be logged in to perform create, delete, etc?

Have been working through the docs but can't reconcile some things I clearly don't understand. Javascript on client side.

gapi.client.init({
        apiKey: API_KEY,
        clientId: CLIENT_ID,
        discoveryDocs: DISCOVERY_DOCS,
        scope: SCOPES
      })

used as per the docs

scopes have been set to either https://www.googleapis.com/auth/drive or https://drive.google.com/drive/folders/somestringoflettersannumbersanddashes-?usp=sharing

But am trying to avoid needing to log in, especially as the latter scope has full editing permissions enabled and does seem to be able to access the folder.

gapi.client.drive.files.list({q:string,fields:string}) is able to generate a list, but gapi.client.drive.files.create and delete({fileId:someid}) return a 401 error - login required.

I don't know where I'm going wrong and the docs make it painfully UNclear what the requirements are, etc, why accessing the folder list seems to work while doing anything to it seems blocked off.

Or maybe I'm missing a parameter, who knows, it's a mystery. Can anybody tell me if I am doing something wrong with the calls or if, in the end, a user needs to be logged in to their google account to make changes.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sorry, but I think your misunderstanding is incorrect. Being authenticated as a user is the only way of editing a file/folder, even if the file is publically editable. The change has to be attested to someone and for that the API needs to know who you are.

This is different to the UI where you can edit a public-facing document when not logged in.

about 4 years ago · Juan Pablo Isaza Report
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!