I am using Google Drive API from Google App engine for java. I am searching the google docs with search string
Files.List request = service.files().list().setQ("title contains 'Donation'");
It returns only 2 files with title DonationThankYouLetterData and How to Create Awareness on Blood Donation
I failed to understand why it is not returning other files with title like
DonationThankYou_Anil Kumar _02-Aug-2013
Donation
All files are created by me so owner is same.
It could be a number of reasons...
Is there a nextPage link that you should be following. Drive doesn't guarantee to return all hits in a single response
Do you have the correct scope to access the file. Eg. if the first two files were created by your app, and the third was created in Drive, and your app only has drive.file scope.
To investigate further, you should ...
Go to https://developers.google.com/drive/v2/reference/files/get and retrieve the item for each file. Compare them to see if there is any obvious difference
Run the list without the query to confirm that all three files are indeed being returned
Also look at this answer Drive API files.list query with 'not' parameter returns empty pages which seems to suggest that "contains" is broken, but that doesn't seem to match your symptoms, based on the file names you used in your question.
Related
I've been looking through the Autodesk Forge API a bit but I have not found a way to do the following things:
Query/list files in a whole Fusion 360 team hub, filtering on e. g. filename.
Get a list of the N most recently accessed files (created, opened, saved)
Is this possible? So far I've seen that is possible through recursion, but I want to avoid making a lot of API calls.
Query/list files in a whole Fusion 360 team hub, filtering on e. g. filename.
This can be done using the search endpoint. It traverses all subfolders recursively, and can filter based on different criteria (see https://forge.autodesk.com/en/docs/data/v2/developers_guide/filtering/). I believe it can be used at a project level.
Get a list of the N most recently accessed files (created, opened, saved)
I'm afraid this kind of sorting is not available using these endpoints.
I built a python program with Google web detection function which returns some source links and the best guessed label of the identified object. For next step I want to use the above information to find more details of the identified object. Does Google provides any API can be used to search the details of the object or should I built a web crawler to crawl over the webpages to get the things I want?
For example, after uploaded an image of RTX4090 and it returns "best guess label: "RTX4090"" also with some image source link. For next step, the details of RTX4090 such as it's CUDAcore, frequency , etc. can be returned .
I currently have a lot of files in Google Drive and would like to programmatically find which ones might be available to the web or available to those with the link of a file. I'd like to search which files were set to "Anyone with the link" or "Public on the web". The picture below shows this. Is there a way to easily list this with the Drive v3 API?
You just have to call Files: list and use the search query parameter (q) to list only the files with certain visibility settings. For example, if you want to retrieve both the files shared with anyone with link and anyone on the Internet, you can set q the following way:
q: "visibility='anyoneCanFind' or visibility='anyoneWithLink'"
From the docs:
visibility (=, '!='): The visibility level of the file. Valid values are anyoneCanFind, anyoneWithLink, domainCanFind, domainWithLink, and limited.
Note:
The rest of parameters provided to Files: list will depend on the exact search you want to make (from your Drive, from a shared Drive, etc.). I'm assuming this is not part of your question.
Reference:
Files: list
Search query terms
Using the Google Drive v3 Api, I would like to list all files that have been shared with a certain group.
When I add the following to the qparameter for files.list, an empty set is returned. Can anyone clarify that the {email_address} in writers query only accepts user email addresses and not group email addresses?
Is there any other way to list files shared to a group email using the Google Drive Api?
Edit:
It was working for a while and today it stopped returning results again. It seems that the Google Drive API team has changed something on this?
Google must have pushed a fix to the API, since it just started working...
if I use files.list to generate a list of files for a user will the returned list be identical (ie items and order of items) to a similar call at a later time if no changes/modifications have taken place to the users files?
I'm trying to work out the most efficient way of determining if any changes have taken place to a users google drive contents. I could do this by using the files.list and comparing the file modification date of a particular file with the previous modification date from a saved files.list result. An alternative way would be to compare the actual result of files.list (i.e. a direct comparison of the list rather than the files). Using Python comparing the contents of lists is straightforward but an alternative method would be to shelve the results of files.list, calculate the secure hash of the db file and compare the hash with hash of the most recent files.list result. This will only work if the result of files.list is identical when no changes haven taken place in a users google drive.
Are the results of files.list unchanged if no changes to a users google drive are made?
"Are the results of files.list unchanged if no changes to a users google drive are made?"
Whilst in practice, the answer is yes, you should not rely on this since it is not part of the documented API contract, and so is liable to break in the future. The changes feed https://developers.google.com/drive/v2/reference/changes is a better fit for your needs.