检索声明性代理清单的功能 ID

本文介绍开发人员检索必要的 ID 的方法,以在其声明性代理清单的 部分中包括 Graph 连接器和 SharePoint/OneDrive 文件capabilities。 开发人员可以使用 Microsoft Graph 资源管理器Microsoft Graph PowerShell

智能 Microsoft 365 Copilot 副驾驶®连接器

本部分介绍开发人员如何检索要在清单中 connection_idCopilot 连接器对象的 Connection 对象的 属性中设置的值。

重要

查询以前Microsoft Graph 连接器 (智能 Microsoft 365 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

本部分介绍开发人员如何检索要在 对象的 属性中的以下属性中items_by_sharepoint_ids设置的值OneDriveAndSharePoint

  • 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 替换为要为其获取 ID 的文件或文件夹的 URL。

    {
      "requests": [
        {
          "entityTypes": [
            "driveItem"
          ],
          "query": {
            "queryString": "Path:\"https://yoursharepointsite.com/sites/YourSite/Shared%20Documents/YourFile.docx\""
          },
          "fields": [
            "fileName",
            "listId",
            "webId",
            "siteId",
            "uniqueId"
          ]
        }
      ]
    }
    
  6. 选择 运行查询

  7. 找到所需的文件并复制其 listIdwebIdsiteIduniqueId 属性。

    {
      "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
            }
          ]
        }
      ]
    }