GET/users/{userId}/drive/search
ユーザーがアクセスできるマイドライブ、共有ドライブ、組織/グループフォルダ、共有されたフォルダなどのファイルやフォルダを検索する。
Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。
file
file.read
group.folder
group.folder.read
| Parameter | Type | Description |
|---|---|---|
| userId | string | ユーザーを特定する ID (URL エンコードする)
required example : me |
| Parameter | Type | Description |
|---|---|---|
| query | string | 検索単語 required example : テストファイル |
| queryFilters | string | 検索単語の検索対象とする field をカンマ (,) で区切って指定する。
default : fileName,content example : fileName |
| parentFileId | string | 検索対象とするフォルダのファイル ID example : NzExNTMwMDF8MTQ2NzA1NjAxMDAwMHxGfDA |
| fileTypes | string | 検索対象とするファイルの種類。
example : AUDIO |
| startTime | string | modifiedTime による検索対象の開始日時
example : 2023-06-05T10:54:10%2B09:00 |
| endTime | string | modifiedTime による検索対象の終了日時
example : 2023-06-10T10:54:10%2B09:00 |
| driveTypeFilters | string | 検索対象とするドライブの種類。複数を指定する場合にはカンマ (,) で区切る。
example : MY_DRIVE,SHARE_DRIVE |
| orderBy | string | 並べ替え方法。並べ替え項目と順序を空白(%20)で区切って入力する。
example : modifiedTime%20desc |
| cursor | string | リストのカーソル値 (URL エンコードする) example : JlIBsfJogXpzDGY8OscZziqZpYqCAu3RbZbaFzBb1od6lWQtSdPUd2FIdCuaGgu8DA== allowReserved : false |
| count | integer | 取得数 default : 20 minimum : 1 maximum : 200 example : 20 format : int32 |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
OK
| Property | Type | Description |
|---|---|---|
| files | array (File) | 検索結果ファイルリスト |
| responseMetaData | object (responseMetaData) | 応答のメタデータ |
| Property | Type | Description |
|---|---|---|
| accessedTime | string | アクセス日時 readOnly : true |
| createdTime | string | 作成日時 readOnly : true |
| modifiedTime | string | 更新日時 readOnly : true |
| fileId | string | ファイル ID readOnly : true |
| parentFileId | string | 親ファイル ID readOnly : true |
| fileName | string | ファイル名 readOnly : true |
| fileSize | integer | ファイルサイズ format : int64 readOnly : true |
| filePath | string | ファイルパス readOnly : true |
| fileType | string | ファイルタイプ
Allowed values : AUDIO, DOC, ETC, EXE, FOLDER, IMAGE, VIDEO, ZIP |
| hasPermission | boolean | アクセス権限有りフラグ readOnly : true nullable : false |
| permissionRootFileId | string | アクセス権限ルートファイル ID readOnly : true nullable : true |
| shared | boolean | 共有状態 readOnly : true nullable : false |
| shareRootFileId | string | 共有したフォルダのルートフォルダ ID readOnly : true nullable : true |
| resourceLocation | integer | リソースロケーションコード format : int32 readOnly : true |
| statuses | array (FileStatus) | ファイルステータス Allowed values : LOCKED, MALWARE, PROTECTED, IN_PROGRESS |
| snippet | string | 本文検索時に検索された本文内容 readOnly : true nullable : true |
| driveInfo | object (driveInfo) | File Resource を含むドライブ情報 |
| Property | Type | Description |
|---|---|---|
| FileStatus | string | ファイルステータス
Allowed values : LOCKED, MALWARE, PROTECTED, IN_PROGRESS |
| Property | Type | Description |
|---|---|---|
| driveType | string | ドライブタイプ
Allowed values : MY_DRIVE, SHARED_FOLDER, SHARE_DRIVE, CHANNEL_FOLDER |
| id | string | driveType に応じた値が返る。 readOnly : true nullable : true |
| Property | Type | Description |
|---|---|---|
| nextCursor | string | 次のリスト取得時に使用するカーソル値 readOnly : true |
example
1{2 "files": [3 {4 "fileId": "QDIxMDAwMDAwMDAwMTcwfDExODE1MDg3MzQ0NzJ8RHww",5 "parentFileId": "QDIxMDAwMDAwMDAwMTcwfDExNzgyODY2MjgxMDR8RHww",6 "resourceLocation": 24101,7 "fileSize": 10,8 "fileName": "works.txt",9 "filePath": "/ShareDriveName/works.txt",10 "fileType": "DOC",11 "createdTime": "2020-11-13T18:20:05+09:00",12 "modifiedTime": "2021-04-05T21:14:05+09:00",13 "accessedTime": "2021-04-05T21:14:05+09:00",14 "statuses": [],15 "hasPermission": false,16 "permissionRootFileId": null,17 "snippet": null,18 "driveInfo": {19 "driveType": "SHARE_DRIVE",20 "id": "@248080202002"21 }22 },23 {24 "fileId": "MTU1NzYwMDF8MzQ3MjQ3MTI0MDkxNzYzNTMzN3xEfDA",25 "parentFileId": "MTU1NzYwMDF8MzQ3MjQ3MTI0MDY1MTQxMTcyMHxEfDA",26 "resourceLocation": 24101,27 "fileSize": 0,28 "fileName": "worksFolder",29 "filePath": "/GroupFolderName/worksFolder/",30 "fileType": "FOLDER",31 "createdTime": "2020-11-13T18:20:05+09:00",32 "modifiedTime": "2021-04-05T21:14:05+09:00",33 "accessedTime": "2021-04-05T21:14:05+09:00",34 "statuses": [],35 "hasPermission": false,36 "permissionRootFileId": null,37 "snippet": null,38 "driveInfo": {39 "driveType": "CHANNEL_FOLDER",40 "id": "@93000099002912"41 }42 }43 ],44 "responseMetaData": {45 "nextCursor": "JlIBsfJogXpzDGY8OscZziqZpYqCAu3RbZbaFzBb1od6lWQtSdPUd2FIdCuaGgu8DA=="46 }47}