Request access to Google Spreadsheet file

JRevi
New Member

Hello team , I am trying to request access to file via API but fail API returns error as a result: Details: "[{'message': 'File not found: https://docs.google.com/spreadsheets/d/1u...4bcSqdgc/edit#gid=0.', 'domain': 'global', 'reason': 'notFound', 'location': 'fileId', 'locationType': 'parameter'}]"> But if i try to open this link in browser - I see correct message , that you don't have access to file - "please input message and post the access request" I have following API's enabled in Console: Google Drive API BigQuery API BigQuery Migration API BigQuery Storage API Cloud Datastore API Cloud Logging API Cloud Monitoring API Cloud SQL Cloud Storage Cloud Storage API Cloud Trace API Gmail API Google Cloud APIs Google Cloud Storage JSON API Resource Settings API Service Management API Service Usage API Code is as follows: drive_service = build('drive', 'v3', credentials=g.gcreds_scoped) permission_request = { 'role': 'writer', 'type': 'anyone', 'allowFileDiscovery': False } sheets_service = build('sheets', 'v4', credentials=g.gcreds_scoped) request = drive_service.permissions().create(body=permission_request, fileId=file_url, supportsAllDrives=True, fields='id') response = request.execute()

0 0 102
0 REPLIES 0