0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Drive APIのスコープの選択表まとめ

Posted at

Google Drive API のスコープ

Drive API スコープ

アプリに付与されるアクセスレベルを定義するには、認可スコープを特定して宣言する必要があります。認可スコープは、Google Workspace アプリ名、アクセスするデータの種類、アクセスレベルを含む OAuth 2.0 URI 文字列です。スコープとは、アプリが Google Workspace データ(ユーザーの Google アカウント データなど)を操作するためのリクエストです。

アプリがインストールされると、アプリで使用されるスコープをユーザーが検証するよう求められます。通常は、できるだけ範囲の狭いスコープを選択し、アプリで必要のないスコープはリクエストしないようにします。ユーザーは、明確に記述された制限付きのスコープへのアクセス権を簡単に付与できます。

可能であれば、機密性のないスコープを使用することをおすすめします。ファイルごとのアクセススコープが付与され、アプリに必要な特定の機能へのアクセスが制限されるためです。

スコープコード 説明 用途
https://www.googleapis.com/auth/drive.appdata Google ドライブでアプリの独自の設定データを表示、管理できます。 推奨 機密性なし
https://www.googleapis.com/auth/drive.appfolder Google ドライブでアプリの独自の設定データを表示、管理できます。 推奨 機密性なし
https://www.googleapis.com/auth/drive.install [アプリで開く] または [新規] メニューにオプションとしてアプリを表示することを許可します。 推奨 機密性なし
https://www.googleapis.com/auth/drive.file アプリで開いたファイル、または Google Picker API またはアプリのファイル選択ツールの使用中にユーザーがアプリと共有する新しいドライブファイルを作成する、または既存のファイルを変更する。 推奨 機密性なし
https://www.googleapis.com/auth/drive.apps.readonly ドライブへのアクセスを許可されているアプリを確認する。 デリケートなコンテンツ
https://www.googleapis.com/auth/drive ドライブ内のすべてのファイルを表示、管理できます。 制限付き
https://www.googleapis.com/auth/drive.readonly ドライブ内のすべてのファイルを表示、ダウンロードできます。 制限付き
https://www.googleapis.com/auth/drive.activity ドライブ内のファイルのアクティビティ履歴の表示とアクティビティの追加。 制限付き
https://www.googleapis.com/auth/drive.activity.readonly ドライブ内のファイルのアクティビティ履歴を表示する。 制限付き
https://www.googleapis.com/auth/drive.meet.readonly Google Meet で作成または編集されたドライブファイルの参照。 制限付き
https://www.googleapis.com/auth/drive.metadata ドライブ内のファイルのメタデータを表示、管理する。 制限付き
https://www.googleapis.com/auth/drive.metadata.readonly ドライブ内のファイルのメタデータを表示する。 制限付き
https://www.googleapis.com/auth/drive.scripts Google Apps Script のスクリプトの動作を変更します。 制限付き

上の表の「使用量」列は、次の定義に従って各スコープの機密性を示しています。

  • 推奨 / 機密性なし: これらのスコープは、承認アクセスの最小スコープを提供し、基本的なアプリの確認のみを必要とします。この要件については、適格性確認の要件をご覧ください。

  • 推奨 / 機密: これらのスコープは、アプリについてユーザーによって承認された特定の Google ユーザーデータへのアクセスを提供します。追加のアプリ検証を行う必要があります。この要件については、機密性の高いスコープと制限付きスコープの要件をご覧ください。

  • 制限付き: これらのスコープは Google ユーザーデータへの幅広いアクセスを提供します。制限付きスコープの検証プロセスを実行する必要があります。この要件については、Google API サービスのユーザーデータ ポリシーと特定の API スコープに関する追加要件をご覧ください。制限付きのスコープのデータをサーバーに保存する(または転送する)場合は、セキュリティ評価を受ける必要があります。

アプリが他の Google API へのアクセスを必要とする場合は、それらのスコープも追加できます。Google API スコープの詳細については、OAuth 2.0 を使用した Google API へのアクセスをご覧ください。

特定の OAuth 2.0 スコープの詳細については、Google API の OAuth 2.0 スコープをご覧ください。

Google Drive API

サービス エンドポイント

サービス エンドポイントは、API サービスのネットワーク アドレスを指定するベース URL です。1 つのサービスに複数のサービス エンドポイントが存在することがあります。このサービスには次のサービス エンドポイントがあり、以下のすべての URI がこのサービス エンドポイントに関連しています。

REST リソース: v3.about

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
get GET /drive/v3/about
ユーザーのドライブ、システム機能に関する情報を取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly

REST リソース: v3.apps

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
get GET /drive/v3/apps/{appId}
特定のアプリを取得します。
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.apps.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/apps
ユーザーがインストールしたアプリを一覧表示します。
https://www.googleapis.com/auth/drive.apps.readonly

REST リソース: v3.accessproposals

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
get GET /drive/v3/files/{fileId}/accessproposals/{proposalId}
ID で AccessProposal を取得します。
list GET /drive/v3/files/{fileId}/accessproposals
ファイルの AccessProposals を一覧表示します。
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.readonly
resolve POST /drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve
アクセス提案を承認または拒否するために使用します。
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

REST リソース: v3.changes

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
getStartPageToken GET /drive/v3/changes/startPageToken
将来の変更を一覧表示するための開始 pageToken を取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
list GET /drive/v3/changes
ユーザーまたは共有ドライブに対する変更を一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
watch POST /drive/v3/changes/watch
ユーザーの変更を監視します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly

REST リソース: v3.channels

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
stop POST /drive/v3/channels/stop
このチャンネルのリソースの視聴を停止します。
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.apps
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly

REST リソース: v3.comments

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
create POST /drive/v3/files/{fileId}/comments
ファイルにコメントを作成します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
delete DELETE /drive/v3/files/{fileId}/comments/{commentId}
コメントを削除します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
get GET /drive/v3/files/{fileId}/comments/{commentId}
ID でコメントを取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/files/{fileId}/comments
ファイルのコメントを一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
update PATCH /drive/v3/files/{fileId}/comments/{commentId}
パッチのセマンティクスを含むコメントを更新します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

REST リソース: v3.drives

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
create POST /drive/v3/drives
共有ドライブを作成します。
https://www.googleapis.com/auth/drive
delete DELETE /drive/v3/drives/{driveId}
ユーザーがorganizerの共有ドライブを完全に削除します。
https://www.googleapis.com/auth/drive
get GET /drive/v3/drives/{driveId}
共有ドライブのメタデータをIDで取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
hide POST /drive/v3/drives/{driveId}/hide
共有ドライブをデフォルトビューで非表示にします。
https://www.googleapis.com/auth/drive
list GET /drive/v3/drives
ユーザーの共有ドライブを一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
unhide POST /drive/v3/drives/{driveId}/unhide
共有ドライブをデフォルトのビューに復元します。
https://www.googleapis.com/auth/drive
update PATCH /drive/v3/drives/{driveId}
共有ドライブのメタデータを更新します。
https://www.googleapis.com/auth/drive

REST リソース: v3.files

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
copy POST /drive/v3/files/{fileId}/copy
ファイルのコピーを作成し、パッチでマニフェストを使用して、リクエストされた更新を適用します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.photos.readonly
create POST /drive/v3/files
POST /upload/drive/v3/files
新しいファイルを作成します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
delete DELETE /drive/v3/files/{fileId}
ユーザーが所有するファイルをゴミ箱に移動せずに完全に削除します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
emptyTrash DELETE /drive/v3/files/trash
ユーザーのゴミ箱にあるファイルをすべて削除します。
https://www.googleapis.com/auth/drive
export GET /drive/v3/files/{fileId}/export
Google WorkspaceドキュメントをリクエストされたMIMEタイプにエクスポートし、エクスポートされたバイトコンテンツを返します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
generateIds GET /drive/v3/files/generateIds
作成リクエストまたはコピーリクエストで指定できるファイルIDのセットを生成します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
get GET /drive/v3/files/{fileId}
ファイルのメタデータまたはコンテンツをIDで取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/files
ユーザーのファイルを一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
listLabels GET /drive/v3/files/{fileId}/listLabels
ファイルのラベルを一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.readonly
modifyLabels POST /drive/v3/files/{fileId}/modifyLabels
ファイルに適用されるラベルのセットを変更します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
update PATCH /drive/v3/files/{fileId}
PATCH /upload/drive/v3/files/{fileId}
ファイルのメタデータやコンテンツを更新します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.scripts
watch POST /drive/v3/files/{fileId}/watch
ファイルに対する変更をサブスクライブします。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly

REST リソース: v3.permissions

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
create POST /drive/v3/files/{fileId}/permissions
ファイルまたは共有ドライブの権限を作成します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
delete DELETE /drive/v3/files/{fileId}/permissions/{permissionId}
権限を削除します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
get GET /drive/v3/files/{fileId}/permissions/{permissionId}
IDで権限を取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/files/{fileId}/permissions
ファイルまたは共有ドライブの権限を一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
update PATCH /drive/v3/files/{fileId}/permissions/{permissionId}
パッチセマンティクスを含む権限を更新します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

REST リソース: v3.replies

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
create POST /drive/v3/files/{fileId}/comments/{commentId}/replies
コメントへの返信を作成します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
delete DELETE /drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}
返信を削除します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
get GET /drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}
IDで返信を取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/files/{fileId}/comments/{commentId}/replies
コメントの返信を一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.readonly
update PATCH /drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}
パッチのマニフェストを使用して返信を更新します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

REST リソース: v3.revisions

Methods HTTP メソッドとエンドポイント / 説明 認可スコープ
delete DELETE /drive/v3/files/{fileId}/revisions/{revisionId}
ファイルのリビジョンを完全に削除します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
get GET /drive/v3/files/{fileId}/revisions/{revisionId}
IDにより、リビジョンのメタデータまたはコンテンツを取得します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
list GET /drive/v3/files/{fileId}/revisions
ファイルのリビジョンを一覧表示します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
update PATCH /drive/v3/files/{fileId}/revisions/{revisionId}
パッチセマンティクスを使用してリビジョンを更新します。
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?