AppMaker Drive.Files.list 属性查询
AppMaker Drive.Files.list query for properties
function searchDrive(teamDriveId) {
var args = {
corpora: 'teamDrive',
includeTeamDriveItems: true,
supportsTeamDrives: true,
teamDriveId: teamDriveId,
q: "properties has { key = 'source' and value = 'internet' }"
};
return Drive.Files.list(args).items;
结果:GoogleJsonResponseException:searchDrive (ServerScript:9) 中的查询无效
我在 API 资源管理器中有 运行 相同的查询并收到了成功的结果。我有 运行 个其他查询 (mimeType='image/jpeg'
) 使用 AppMaker 中的 Drive.Files.list API 并收到了成功的结果。
有人用这个API查询过'properties'吗?有没有人知道我做错了什么?
谢谢
为了进行正确的查询,您需要包括可见性 属性;因此应该是:
function searchDrive(teamDriveId) {
var args = {
corpora: 'teamDrive',
includeTeamDriveItems: true,
supportsTeamDrives: true,
teamDriveId: teamDriveId,
q: "properties has { key = 'source' and value = 'internet' and visibility='PRIVATE' }"
};
return Drive.Files.list(args).items;
}
请注意visibility='PRIVATE'
部分。根据 the documentation.
,可能的值为 PRIVATE and PUBLIC
function searchDrive(teamDriveId) {
var args = {
corpora: 'teamDrive',
includeTeamDriveItems: true,
supportsTeamDrives: true,
teamDriveId: teamDriveId,
q: "properties has { key = 'source' and value = 'internet' }"
};
return Drive.Files.list(args).items;
结果:GoogleJsonResponseException:searchDrive (ServerScript:9) 中的查询无效
我在 API 资源管理器中有 运行 相同的查询并收到了成功的结果。我有 运行 个其他查询 (mimeType='image/jpeg'
) 使用 AppMaker 中的 Drive.Files.list API 并收到了成功的结果。
有人用这个API查询过'properties'吗?有没有人知道我做错了什么?
谢谢
为了进行正确的查询,您需要包括可见性 属性;因此应该是:
function searchDrive(teamDriveId) {
var args = {
corpora: 'teamDrive',
includeTeamDriveItems: true,
supportsTeamDrives: true,
teamDriveId: teamDriveId,
q: "properties has { key = 'source' and value = 'internet' and visibility='PRIVATE' }"
};
return Drive.Files.list(args).items;
}
请注意visibility='PRIVATE'
部分。根据 the documentation.
PRIVATE and PUBLIC