選択したサイトの Graph Explorer での指定方法

以下の説明を参照し、アプリがアクセスできるサイトを指定します。

1.   https://developer.microsoft.com/en-us/graph/graph-explorer (英語) に移動して、プロファイル アイコンをクリックしてサインインします。

Clicking the profile icon.

ポップアップ ウィンドウが表示されると、[承諾] をクリックします。

Clicking "Accept".

2.   以下の説明を参照して、提供したキーワードと一致するサイトを検索します。

a.   左ナビゲーションから search for a SharePoint site by keyword をクリックします。

Clicking "search for a SharePoint site by keyword".

b.   Modify permissions タブで、Sites.Read.All または Sites.ReadWrite.All 権限が付与されていることを確認します。付与されていない場合、[Consent] をクリックして権限を付与します。

Configuring permissions under the "Modify permissions" tab.

c.    目的のサイト名で Search= の後ろのテキストを置き換えます。例として以下のスクリーンショットを参照してください。

An example of specifying a site name.

d.   [Run query] をクリックします。応答結果を確認して、以下のスクリーンショットの赤いボックスの位置にあるサイト ID 値をメモします。サイト ID 値は以下の手順で使用されます。

A sample of the site ID value in a response.

3.   特定のサイトにアクセスするには、以下の API 呼び出しを使用して、アプリに対して FullControl 権限を付与します。

a.   リクエスト方法を POST に変更します。

b.   アドレス バーに以下の URL を入力して、前のステップで取得したサイト ID 値で {site-id} を置き換えます。

https://graph.microsoft.com/v1.0/sites/{site-id}/permissions

A sample of the POST request for a specific site.

c.    Request body テキスト ボックスで、以下の JSON を入力して、カスタム アプリのクライアント ID および表示名で {app-id} および {app-name} を置き換えます。

{

    "roles": [

        "fullcontrol"

    ],

    "grantedToIdentities": [

        {

            "application": {

                "id": "{app-id}",

                "displayName": "{app-name}"

            }

        }

    ]

}

A sample of the Request body content.

d.   Modify permissions タブで、Sites.FullControl.All 権限が付与されていることを確認します。付与されていない場合、[Consent] をクリックして権限を付与します。

Configuring permissions under the "Modify permissions" tab.

e.   [Run query] をクリックして、リクエストを実行します。正常に実行すると、特定のサイトにおける操作が完了します。

A sample of a successful execute.