0
我使用Google Drive API。如何在Google Drive API中显示详细内容?
https://developers.google.com/drive/v3/reference/files
当点击链接,我们使用webViewLink显示的查看页面。
但我想显示详细内容...
请参阅附件图片。
我想显示红色框的一部分。
如何显示在谷歌驱动器的API详细内容?
谢谢。
我使用Google Drive API。如何在Google Drive API中显示详细内容?
https://developers.google.com/drive/v3/reference/files
当点击链接,我们使用webViewLink显示的查看页面。
但我想显示详细内容...
请参阅附件图片。
我想显示红色框的一部分。
如何显示在谷歌驱动器的API详细内容?
谢谢。
如果你想获得的文件的细节,你可以使用方法:
通过ID获取文件的元数据。
下面是JavaScript中的示例代码:
/**
* Print files.
*/
function listFiles() {
gapi.client.drive.files.list({
'pageSize': 10,
'fields': "nextPageToken, files(id, name)"
}).then(function(response) {
appendPre('Files:');
var files = response.result.files;
if (files && files.length > 0) {
for (var i = 0; i < files.length; i++) {
var file = files[i];
appendPre(file.name + ' (' + file.id + ')');
}
} else {
appendPre('No files found.');
}
});
}
请注意,V3,全部资源都默认不再返回。使用fields查询参数来请求返回特定的字段。如果未指定,只返回常用字段的一个子集。
希望这会有所帮助。