如何在 Google REST 查询中获取特定文件 ID 的数据?
How to get data of specific file ID in Google REST query?
我在 OAuth2 操场上试验 GoogleDrive-v3 REST api。因为我试图从文件 ID/filename.
的响应中过滤特定文件信息的字段
{
"mimeType": "image/png",
"kind": "drive#file",
"id": "PuwuUXGsjLaf6gxyrye_g7OmMw",
"name": "google.png"
}
在这里,我粘贴了我的 REST 查询以过滤具有文件 ID "PuwuUXGsjLaf6gxyrye_g7OmMw" 的文件信息。
但是,它不会过滤指定文件 ID 的响应。相反,它会打印 REST 查询的完整响应。
https://www.googleapis.com/drive/v3/files?fields=files&id=PuwuUXGsjLaf6gxyrye_g7OmMw
纠正我在这里遗漏的内容。
提前致谢。
查询参数"q"可用于通过文件ID或文件名检索文件信息。
在这里,我从我的 google 驱动器中检索了文件 "ubuntu_logo.png"。
例如:
https://www.googleapis.com/drive/v3/files?q=name='ubuntu_logo.png'
响应:
{
"incompleteSearch": false,
"files": [
{
"mimeType": "image/png",
"kind": "drive#file",
"id": "11n2avML9mfI3IzS57qxV7aT1_uLxM8Wv",
"name": "ubuntu_logo.png"
}
],
"kind": "drive#fileList"
}
我在 OAuth2 操场上试验 GoogleDrive-v3 REST api。因为我试图从文件 ID/filename.
的响应中过滤特定文件信息的字段{
"mimeType": "image/png",
"kind": "drive#file",
"id": "PuwuUXGsjLaf6gxyrye_g7OmMw",
"name": "google.png"
}
在这里,我粘贴了我的 REST 查询以过滤具有文件 ID "PuwuUXGsjLaf6gxyrye_g7OmMw" 的文件信息。 但是,它不会过滤指定文件 ID 的响应。相反,它会打印 REST 查询的完整响应。
https://www.googleapis.com/drive/v3/files?fields=files&id=PuwuUXGsjLaf6gxyrye_g7OmMw
纠正我在这里遗漏的内容。 提前致谢。
查询参数"q"可用于通过文件ID或文件名检索文件信息。
在这里,我从我的 google 驱动器中检索了文件 "ubuntu_logo.png"。
例如:
https://www.googleapis.com/drive/v3/files?q=name='ubuntu_logo.png'
响应:
{
"incompleteSearch": false,
"files": [
{
"mimeType": "image/png",
"kind": "drive#file",
"id": "11n2avML9mfI3IzS57qxV7aT1_uLxM8Wv",
"name": "ubuntu_logo.png"
}
],
"kind": "drive#fileList"
}