Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

modifiedDate and lastViewedByMeDate query not woring in Drive API Java

I have a query that modifiedDate = '2013-09-01T12:00:00' and lastViewedByMeDate = '2013-09-01T12:00:00' those type of queries are not working and throws error as:

com.google.api.client.googleapis.json.GoogleJsonResponseException:
500 Internal Server Error
{
"code" : 500,
"errors" : [ {
"domain" : "global",
"message" : "Internal Error",
"reason" : "internalError"
} ],
"message" : "Internal Error"
}

My Code is

String searchQuery="lastViewedByMeDate = '2013-09-01T12:00:00'";
// String searchQuery="modifiedDate = '2013-09-01T12:00:00'";
Files.List request = this.driveService.files().list();
request.setQ(searchQuery);
FileList files = request.execute();
for (File file : files.getItems()) {
// ...........
}

There is no error in code since this type of queries are not running.

like image 703
ashokramcse Avatar asked Nov 27 '25 16:11

ashokramcse


1 Answers

Looks like a bug.

Using https://developers.google.com/drive/v2/reference/files/list#try-it, your query throws a 500, but changing the comparison operator from '=' to '>=' works OK.

It is a bit unusual to query for a precise date and time anyway (remember that timestamps are often updated asynchronously in Google Drive). So it maybe that you can use a date range to meet your needs.

It may well be that the bug is simply in the documentation, and that '=' is not actually supported.

like image 124
pinoyyid Avatar answered Nov 30 '25 05:11

pinoyyid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!