使用Sheets API v4获取与Google帐户关联的所有电子表格的列表 [英] Get the list of all spreadsheets associated with Google account using Sheets API v4

查看:127
本文介绍了使用Sheets API v4获取与Google帐户关联的所有电子表格的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用Google Sheets API v4来获取附加到我的帐户的电子表格列表.我做了很多研究,但没有找到任何解决方案.

Using Google Sheets API v4, I am looking to get the list of spreadsheets attached to my account. I did much research but have not found any solutions for that.

推荐答案

要获取特定类型的所有文件的列表,可以使用驱动器API v3. 下面是一个从经过身份验证的用户的驱动器中获取所有工作表的示例.

To get list of all files of specific type, you can use drive API v3. Below is an example to get all sheets from drive of authenticated user.

drive.files.list({
    q: "mimeType='application/vnd.google-apps.spreadsheet'",
    fields: 'nextPageToken, files(id, name)'
}, (err, response) => {
    //Your code
})

您可以将MIME类型的文件类型作为'q'参数传递.您可以在此处获取驱动器MIME类型的列表.

You can pass file type in MIME type as 'q' parameter. You can get list of drive MIME types here.

来源: https://developers.google.com/sheets/api/指南/迁移#list_spreadsheets_for_the_authenticated_user

这篇关于使用Sheets API v4获取与Google帐户关联的所有电子表格的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆