I'm using Google spreadsheets api with Python package gspread
I have given read permissions to a spreadsheet by adding service account to spreadsheet invite as viewer.
I'm able to read spreadsheet contents but not able to get lastUpdateTime
I'm seeing following exception,
gspread.exceptions.APIError:
{'errors':
[{'domain': 'usageLimits',
'reason': 'accessNotConfigured',
'message': 'Access Not Configured. Drive API has not been used in project <projct_num> before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=<projct_num> then retry.
But I'm unable to find what exactly needs enabling.
Access Not Configured. Drive API has not been used in project
Means that you are using a method that requires access to the Google drive api. In order to use that method you need to enable that api in your project. You have probably already enabled the google sheets api you just need to enable drive api as well.
Go to google developer console as instructed under library and enable the google drive api. Wait a few minutes and try again.
Related
I have added a non-renewable subscription for one of my projects. We also started implementing the Google play developer API to get the subscription latest status from the Play Store. For that we have done the below steps as per this blog:
Linked the developer account to a new Google Cloud Project.
Enabled the Google Play Developer API for the Google Cloud Project.
Created a service account and created a key for the service account.
I have below clarifications related to this implementation:
I tried to Grant Access for the following permissions: But the corresponding checkmark is not clickable.
View financial data, orders, and cancellation survey responses
Manage orders and subscriptions
The 3rd step as per the blog is to Authorize an API key, but I didn't get a clear idea of that.
We are going to implement this API on the back end side as a corn job, do we need to generate a JWT token for accessing this API? Is this possible to call without a Token? I found 2 types of implementations from this blog, which one is easy and secure?
"Your application can complete these tasks either by using the Google APIs client library for your language or by directly interacting with the OAuth 2.0 system using HTTP."
From where we get the get API path and other details. I found a similar get API from AppStore like this. Is the play store providing a similar kind of get API?
We need the latest purchase status API and for that what parameters do we need to pass?
I am trying to get a date and time when a linked file is opened in a shared link in Google Drive?
you can use the Reports API of the GSuite Admin SDK, with which you'd need to list the Activities, of type Drive Audit Activity Events. without a GSuite Domain, this feature might not be available.
I am currently using below component for a Xamarin app.
https://components.xamarin.com/gettingstarted/googleplayservices-drive
I tried uploading a file to a Google drive that has a full storage using above component and it seems to successfully upload and returns a successful response. When I retrieve all files in the drive's folder it seems to be there for a few seconds then disappears.
In some cases, applications may need to use the Google Drive web service to access additional features or access broader scopes than what is available in the Google Drive Android API.
Google does not expose the user's Drive storage quota within the Android.Gms.Drive api.
You will need to use the Rest APIs using an Auth2 token that has been authorization a Drive scope and call:
https://www.googleapis.com/drive/v3/about
With the Json response, you can access storageQuota:
{
"storageQuota": {
"limit": "16106127360",
"usage": "3115832693",
"usageInDrive": "373280402",
"usageInDriveTrash": "46755721"
}
}
Google Ref: About: get
A bit of an intro from where I am coming from: With as little development effort as possible, I'd like to gain access to Google Drive (scope: https://www.googleapis.com/auth/drive) to permanently delete files presently in the Trash.
On a Windows system, I have Google Drive installed and it's syncing files from a directory folder. As files get deleted, they move to the Trash within Google Drive, but they never get deleted hence causing the account going over quota. The windows service responsible for maintaining the files within the local Windows Google Drive folder structure is written in C# and hence I wanted to leverage it to reach out to Google Drive utilizing the Drive API to permanently delete files within the Trash.
However, when using Google Drive API, I have run into 2 issues:
When requesting the scope "https://www.googleapis.com/auth/drive", I get the following response
"error" : "invalid_scope"
"error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/drive]"
"error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html"
I thought to have found a workaround for issue 1) in that some recommend using scope "https://docs.google.com/feeds" instead. However, when the account owner for Google Drive confirms the user_code, I never get the expected access and refresh tokens. Instead the polling will keep receiving
"error" : "authorization_pending".
Just to complete the story: Since I have no UI for the Windows service, I chose to follow the OAuth 2.0 for Devices instructions for proper authentication. The user receives the URL for authentication as well as the user code per email. So the Windows Service upon submitting client_id and scope will generate an email for the end user, which includes the received verification_url and user_code.
When using scope "https://docs.google.com/feeds", I notice that no app gets added to the authorized apps list on the Google Drive account. However, when using the Google APIs Explorer, it got added to the list. So my hunch is that this scope won't cut it for accessing Google Drive and hence the error "authorization_pending" keeps getting thrown.
So bottom line question: Will Google API simply not get Google Drive access and MUST I use Google Drive SDK instead of Google API? In that case, I guess, I would have to create some web UI capable of communicating with my Windows service - correct?
Really do appreciate any great insight into the details I have been fighting this for a few nights now. Thank you!!!
if Google Drive API will be supported by access to Spreadsheet API
Or it's will be new Spreadsheet API like we have
https://developers.google.com/apis-explorer/#p/
Similar to developers.google.com/google-apps/spreadsheets/
https://code.google.com/p/google-api-javascript-client/
Google Drive API allows you to do CRUD (create,read, update,delete) functions to google drive. This is similar to the Google Documents List API for Google Docs and is the latest evolution. To actually edit or retrieve the contents inside a spreadsheet you must still use the Spreadsheet api which you listed above. The latest versions of the spreadsheet api also use Oath2 just like the Drive api.