Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

432
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda