この記事では、開発者が宣言型エージェント マニフェストの capabilities セクション内に Copilot コネクタと SharePoint/OneDrive ファイルを含めるために必要な ID を取得するためのメソッドについて説明します。 開発者は、Microsoft Graph エクスプローラーまたは Microsoft Graph PowerShell を使用できます。
Microsoft 365 Copilot コネクタ
このセクションでは、マニフェストの Copilot コネクタオブジェクトの Connection オブジェクトの connection_id プロパティで設定する値を開発者が取得する方法について説明します。
重要
Microsoft 365 Copilot コネクタのクエリを実行するには、管理者アカウントが必要です。
Microsoft Graph エクスプローラーに移動し、管理者アカウントでサインインします。
右上隅にあるユーザー アバターを選択し、[ アクセス許可に同意する] を選択します。
ExternalConnection.Read.Allを検索し、そのアクセス許可の [同意] を選択します。 プロンプトに従って同意を付与します。
要求フィールドに「
https://graph.microsoft.com/v1.0/external/connections?$select=id,name」と入力し、[ クエリの実行] を選択します。
目的のコネクタを見つけて、その
idプロパティをコピーします。 たとえば、次の応答で GitHub Repos コネクタを使用するには、githubrepos値をコピーします。{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#connections(id,name)", "value": [ { "id": "applianceparts", "name": "Appliance Parts Inventory" }, { "id": "githubrepos", "name": "GitHub Repos" } ] }
SharePoint ID の取得
このセクションでは、開発者が、OneDriveAndSharePoint オブジェクトの items_by_sharepoint_ids プロパティ内の次のプロパティで設定する値を取得する方法について説明します。
site_idlist_idweb_idunique_id
Microsoft Graph エクスプローラーに移動し、管理者アカウントでサインインします。
右上隅にあるユーザー アバターを選択し、[ アクセス許可に同意する] を選択します。
Sites.Read.Allを検索し、そのアクセス許可の [同意] を選択します。 プロンプトに従って同意を付与します。Files.Read.Allに対してこのプロセスを繰り返します。
[メソッド] ドロップダウンを [POST] に変更し、要求フィールドに「
https://graph.microsoft.com/v1.0/search/query」と入力します。
要求本文に次を追加し、
https://yoursharepointsite.com/sites/YourSite/Shared%20Documents/YourFile.docxを ID を取得するファイルまたはフォルダーの URL に置き換えます。{ "requests": [ { "entityTypes": [ "driveItem" ], "query": { "queryString": "Path:\"https://yoursharepointsite.com/sites/YourSite/Shared%20Documents/YourFile.docx\"" }, "fields": [ "fileName", "listId", "webId", "siteId", "uniqueId" ] } ] }[クエリの実行] を選択します。
目的のファイルを見つけて、その
listId、webId、siteId、uniqueIdの各プロパティをコピーします。{ "value": [ { "searchTerms": [], "hitsContainers": [ { "hits": [ { "hitId": "01AJOINAHZHINTBHPESZBISPIPSJG3D5EO", "rank": 1, "summary": "Reorder policy Our reorder policy for suppliers is straightforward and designed to maintain cost-efficiency and inventory control. We kindly request that no order exceeds a total", "resource": { "@odata.type": "#microsoft.graph.driveItem", "listItem": { "@odata.type": "#microsoft.graph.listItem", "id": "301b3af9-e49d-4296-893d-0f924db1f48e", "fields": { "fileName": "YourFile.docx", "listId": "12fde922-4fab-4238-8227-521829cd1099", "webId": "a25fab47-f3b9-4fa3-8ed9-1acb83c12a4f", "siteId": "5863dfa5-b39d-4cd1-92a6-5cf539e04971", "uniqueId": "{301b3af9-e49d-4296-893d-0f924db1f48e}" } } } } ], "total": 1, "moreResultsAvailable": false } ] } ] }