2017-10-31 4 views
0

So legen Sie Berechtigungen für Google Drive freigegebene Tabellenkalkulation fest, damit sie von Drive API V3 exportiert werden kann? (Tabelle geteilt für Sie durch andere Benutzer und Sie können es von GUI erhalten exportieren)Google Drive-Berechtigungen für den geteilten Tabellenkalkulationsexport nach API V3

ich habe dies:

Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden 
{ 
    "code" : 403, 
    "errors" : [ { 
    "domain" : "global", 
    "message" : "Insufficient Permission", 
    "reason" : "insufficientPermissions" 
    } ], 
    "message" : "Insufficient Permission" 
} 
     at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146) 
     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) 
     at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) 
     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321) 
     at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065) 
     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) 
     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) 
     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) 
     at Quickstart.main(Quickstart.java:121) 
+0

Der Code verursachte Ausnahme ist: service.files(). Export (i1.getId(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"). Execute(); –

Antwort

0

in dem Stützpfosten google definiert:

"Insufficient permissions" or "System busy"

These errors mean that Chrome couldn't save the file to your computer.

To fix the error:

  • Cancel the download and try again.
  • Instead of clicking the file to download, right-click the link and select Save link as.
  • Be sure to download files to a place on your computer you have access to, like your Desktop or Documents folder. You can change download locations .

Um zu erfahren, Weitere Informationen zu Berechtigungen finden Sie in der documentation.

Hier sind die Liste der Berechtigungen in jeder Datei und Ordner in Google Drive.

These values work together to limit the access appropriately. The type limits access to a set of users. The email address and domain fields specify which users can have access. Finally, the role gives these users the ability to do something to the file, like read it. When combined, these properties define a complete permission.

0

Das Problem war: Wenn Sie Java-Anwendung Tannen Zeit laufen, können Sie Web-Browser-Host auf ausgeführt wird, installiert sein, das sich öffnet und fragt nach Bestätigungsberechtigungen und erstellt /.credentials/gdrive/ StoredCredential. Diese Datei kann auf einfache Weise geändert werden - löschen und neu erstellen durch den Browser. Sie können diese Datei zum Ausführen Ihrer Konsolen-App auf einen Host ohne GUI kopieren.