0
votes

According to the Google Drive API v3 the files.get resource should return a full metadata of the file e.g: https://developers.google.com/drive/v3/reference/files

However, I'm getting a simple response of limited file data:

{
 "kind": "drive#file",
 "id": "string",
 "name": "string",
 "mimeType": "application/pdf"
}

If the response is like this, I'll need to use the V2 of this API.

2
research the fields argument where you need to specify the response content, eg fields=* - pinoyyid

2 Answers

1
votes

According to the Google Drive API v3 the 'files.get` resource should return a full metadata of the file

That is not correct.

From API v3 full File Resource is no longer returned. Instead, you should populate the fields query parameter with fields you require in your Response. If left unspecified, only a subset of commonly used fields are returned. You can learn how to request Partial Resources here.

Check out Migrating to API v3 for more important changes and v2 alternatives.

0
votes

This is the major change in google drive apis from v2 to v3.

They have defaulted this partial response when using v3 apis.

If you want to get the same response by using v3 api. Add 'fields=*' query parameter while calling the v3 endpoint.

A piece of advice - in my experience , it is better to use partial response for better api response, you can read more about it here google drive partial response