0
votes

I'd like to retrieve all the resources (files and folder) via the Files: list API call with the createdTime attribute included.

Standard response doesn't include the createdTime key described in the resource representation so I've added the fields query parameter with the value createdTime (there's an open issue related which says so but referring to API v2 while I'm using API v3).

API call I'm doing is the following:

https://www.googleapis.com/drive/v3/files?fields=createdTime

with proper authentication.

A 400 status code response is returned with the following body:

{
    "error": {
        "errors": [
            {
                "domain": "global",
                "reason": "invalidParameter",
                "message": "Invalid field selection createdTime",
                "locationType": "parameter",
                "location": "fields"
            }
        ],
        "code": 400,
        "message": "Invalid field selection createdTime"
    }
}

What's the correct way of using the fields query parameter?

1
After looking at this issue only way I found was to set the fields query parameter with value . So API call is something like googleapis.com/drive/v3/files?fields= - user3933324

1 Answers

1
votes

If you want to see the full response you can do the following test here

https://www.googleapis.com/drive/v3/files?fields=*

If you just want the create date you can also do test here

https://www.googleapis.com/drive/v3/files?fields=files(createdTime)

You can read more about this in Partial response