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查詢參數來請求返回特定的字段。如果未指定,只返回常用字段的一個子集。
希望這會有所幫助。