Retrieving capabilities IDs for declarative agent manifest

This article describes methods for developers to retrieve the necessary IDs to include Graph connectors and SharePoint/OneDrive files within the capabilities section of their declarative agent manifest. Developers can use Microsoft Graph Explorer or Microsoft Graph PowerShell.

Microsoft Graph connectors

This section describes how developers can retrieve the value to set in the connection_id property of the Connection object in the Microsoft Graph connectors object in the manifest.

Important

Querying for Microsoft Graph connectors requires an admin account.

  1. Browse to Microsoft Graph Explorer and sign in with your admin account.

    A screenshot of the Graph Explorer sign in button

  2. Select your user avatar in the upper right corner and select Consent to permissions.

    A screenshot of the user profile flyout in Graph Explorer

  3. Search for ExternalConnection.Read.All and select Consent for that permission. Follow the prompts to grant consent.

    A screenshot of Graph Explorer's permission consent dialog with ExternalConnection.Read.All

  4. Enter https://graph.microsoft.com/v1.0/external/connections?$select=id,name in the request field and select Run query.

    A screenshot of Graph Explorer's request field with the connections query

  5. Locate the connector you want and copy its id property. For example, to use the GitHub Repos connector in the following response, copy the githubrepos value.

    {
      "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#connections(id,name)",
      "value": [
        {
          "id": "applianceparts",
          "name": "Appliance Parts Inventory"
        },
        {
          "id": "githubrepos",
          "name": "GitHub Repos"
        }
      ]
    }
    

Retrieving SharePoint IDs

This section describes how developers can retrieve the value to set in the following properties within the items_by_sharepoint_ids property of the OneDriveAndSharePoint object:

  • site_id
  • list_id
  • web_id
  • unique_id
  1. Browse to Microsoft Graph Explorer and sign in with your admin account.

  2. Select your user avatar in the upper right corner and select Consent to permissions.

  3. Search for Sites.Read.All and select Consent for that permission. Follow the prompts to grant consent. Repeat this process for Files.Read.All.

    A screenshot of Graph Explorer's permission consent dialog with Sites.Read.All

  4. Change the method dropdown to POST and enter https://graph.microsoft.com/v1.0/search/query in the request field.

    A screenshot of Graph Explorer's request field with a search query

  5. Add the following in the Request body, replacing https://yoursharepointsite.com/sites/YourSite/Shared%20Documents/YourFile.docx with the URL to the file or folder you want to get IDs for.

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

  7. Locate the file you want and copy its listId, webId, siteId, and uniqueId properties.

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