Return specific fields for a file

By default, the server sends back a default set of resource fields specific to the resource being queried. For example, the files.get method might only return the id, name, and mimeType for the files resource. The permissions.get() method returns a different set of default fields for a permissions resource.

To return the exact fields you need, and improve performance, use the fields query parameter in your method call. To determine the fields you can return using the fields parameter, visit the documentation page of the resource you are querying. For example, to see what fields you can return for a file, refer to the files resource documentation.

Fetch the fields of a nested resource

When a field refers to another resource, you can specify which fields of the nested resource should be fetched.

For example, to retrieve the role field (nested resource) of the permissions resource, use any of the following options:

  • permissions.get with fields=role or fields=*.
  • files.get with fields=permissions(role) or fields=permissions/role.
  • files.get with fields=permissions to imply all fields of the nested resource.
  • changes.list with fields=changes(file(permissions(role))).

To retrieve multiple fields, use a comma-separated list. For example, files.list with fields=files(id,name,createdTime,modifiedTime,size).