本文說明如何擷取在宣告式代理程式資訊清單區段中capabilities包含 Copilot 連接器和 SharePoint/OneDrive 檔案所需的識別碼。 您可以使用 Microsoft Graph 總管 或 Microsoft Graph PowerShell。
Copilot 連接器
本節說明如何擷取要在資訊清單中 Copilot 連接器物件的連線物件屬性中connection_id設定的值。
重要
查詢 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為您想要取得其識別碼的檔案或資料夾的 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 } ] } ] }