擷取宣告式代理程式資訊清單的功能識別碼

本文說明如何擷取在宣告式代理程式資訊清單區段中capabilities包含 Copilot 連接器和 SharePoint/OneDrive 檔案所需的識別碼。 您可以使用 Microsoft Graph 總管 或 Microsoft Graph PowerShell。

Copilot 連接器

本節說明如何擷取要在資訊清單中 Copilot 連接器物件的連線物件屬性中connection_id設定的值。

重要

查詢 Copilot 連接器需要系統管理員帳戶。

  1. 瀏覽至 Microsoft Graph 總管 ,然後使用您的系統管理員帳戶登入。

    Graph 總管登入按鈕的螢幕擷取畫面

  2. 選取右上角的使用者虛擬人偶,然後選取 [ 同意權限]。

    Graph 總管中使用者設定檔飛出視窗的螢幕擷取畫面

  3. 搜尋 ExternalConnection.Read.All 並選取 [同意 ] 權限。 依照提示授與同意。

    Graph 總管的權限同意對話方塊螢幕擷取畫面,其中包含 ExternalConnection.Read.All

  4. 輸入 https://graph.microsoft.com/v1.0/external/connections?$select=id,name 要求欄位,然後選取 [執行查詢]。

    Graph 總管的要求欄位與連線查詢的螢幕擷取畫面

  5. 找到您想要的連接器並複製其 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_id
  • list_id
  • web_id
  • unique_id
  1. 瀏覽至 Microsoft Graph 總管 ,然後使用您的系統管理員帳戶登入。

  2. 選取右上角的使用者虛擬人偶,然後選取 [ 同意權限]。

  3. 搜尋 Sites.Read.All 並選取 [同意 ] 權限。 依照提示授與同意。 針對 重複此程序。Files.Read.All

    Graph 總管的權限同意對話方塊與 Sites.Read.All 的螢幕擷取畫面

  4. 將方法下拉式清單變更為 POST ,然後在要求欄位中輸入 https://graph.microsoft.com/v1.0/search/query 。

    含有搜尋查詢的 Graph 總管要求欄位的螢幕擷取畫面

  5. 在 要求內文中新增下列內容,取代 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"
          ]
        }
      ]
    }
    
  6. 選取 執行查詢。

  7. 找出您想要的檔案,然後複製其 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
            }
          ]
        }
      ]
    }