次の方法で共有


接地データを取得する

重要

/beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。

Microsoft 365 Copilot取得 API を使用すると、テナント内で定義されたアクセス制御を尊重しながら、呼び出し元ユーザーがアクセスできる SharePoint、OneDrive、Copilot コネクタのコンテンツから関連するテキスト抽出を取得できます。 検索 API を使用して、コンテキストリコール用に最適化しながら、Microsoft 365 データを使用してジェネレーティブ AI ソリューションを構築します。

この API は、次の国内クラウド展開で使用できます。

グローバル サービス 米国政府機関 L4 米国政府機関 L5 (DOD) 21Vianet が運営する中国

アクセス許可

この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。

アクセス許可の種類 最小特権アクセス許可 より高い特権のアクセス許可
委任 (職場または学校のアカウント) Files.Read.All,Sites.Read.All* ExternalItem.Read.All
委任 (個人用 Microsoft アカウント) サポートされていません。 サポートされていません。
アプリケーション サポートされていません。 サポートされていません。

* SharePoint と OneDrive のコンテンツを取得するには、Files.Read.All と Sites.Read.All の両方のアクセス許可が必要です。

HTTP 要求

POST https://graph.microsoft.com/beta/copilot/retrieval
POST https://graph.microsoft.com/v1.0/copilot/retrieval

要求ヘッダー

名前 説明
Authorization Bearer {token}. 必須です。 認証と認可についての詳細をご覧ください。
Content-Type application/json. 必須。

要求本文

要求本文で、パラメーターの JSON 表現を指定します。

次の表に、このアクションを呼び出すときに使用できる省略可能なパラメーターと必要なパラメーターを示します。

パラメーター 説明
queryString 文字列 関連するテキスト抽出を取得するために使用される自然言語クエリ文字列。 このパラメーターの文字数は 1,500 文字です。 queryStringは 1 つの文にする必要があり、コンテキストが豊富なキーワードのスペル ミスを回避する必要があります。 必須です。
dataSource 文字列 抽出を SharePoint、OneDrive、または Copilot コネクタから取得するかどうかを示します。 許容される値は、 sharePointoneDriveBusiness、および externalItemです。 必須です。
dataSourceConfiguration dataSourceConfiguration 該当するデータ ソースの追加の構成情報が含まれています。 dataSourceConfiguration には、Copilot コネクタの取得を構成できる externalItem というオブジェクトが含まれています。 省略可能。
filterExpression 文字列 クエリを実行する前に取得のスコープを設定するクエリ可能な SharePoint、OneDrive、または Copilot コネクタのプロパティと属性を含むキーワード照会言語 (KQL) 式。 filterExpressionを構築するときに、ANDORNOT、および不等式演算子を使用できます。 フィルター処理でサポートされている SharePoint プロパティと OneDrive プロパティは、 AuthorFileExtensionFilenameFileTypeInformationProtectionLabelIdLastModifiedTimeModifiedByPathSiteIDTitleです。 Copilot コネクタのコンテンツをフィルター処理する場合は、 Copilot コネクタ スキーマでクエリ可能としてマークされた任意のプロパティを使用できます。 目的の Copilot コネクタのスキーマに慣れていない場合、またはクエリ可能とマークされているプロパティがわからない場合は、目的の Copilot コネクタを構成した管理者または開発者に問い合わせてください。 Microsoft では、ここで説明していない SharePoint コネクタと Copilot コネクタのプロパティでのフィルター処理に関する問題は解決されません。 filterExpressionを構築するときに、複数のプロパティと演算子を使用できます。 既定では、スコープは適用されません。 API を呼び出す前に、このパラメーターに正しい KQL 構文があることを確認してください。 それ以外の場合、クエリは filterExpressionがないかのように実行されます。 省略可能。 フィルター処理されたクエリのベスト プラクティスについては、「 ベスト プラクティス」を参照してください。
resourceMetadata String collection 応答内の各項目に対して返されるメタデータ フィールドの一覧。 この一覧には、取得可能なメタデータ プロパティのみを含めることができます。 既定では、メタデータは返されません。 省略可能。
maximumNumberOfResults Int32 応答で返される結果の数。 1 から 25 の間である必要があります。 既定では、最大 25 件の結果が返されます。 省略可能。

応答

成功した場合、このアクションは 200 OK 応答コードと応答本文に 取得Response を返します。

例 1: SharePoint からデータを取得する

次の例は、SharePoint からデータを取得する要求を示しています。 要求は、テキスト抽出の取得元となるアイテムごとに、 titleauthor メタデータを返すように求めます。 応答には、最大 10 個のドキュメントが含まれます。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}
POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "retrievalHits": [
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR/VPNAccess.docx",
      "extracts": [
        {
          "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
          "relevanceScore": 0.8374363553387588
        },
        {
          "text": "You will need to sign in with 2FA to access the corporate VPN.",
          "relevanceScore": 0.7465472642498679
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Access",
        "author": "John Doe"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    },
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR/Corporate_VPN.docx",
      "extracts": [
        {
          "text": "Once you have selected Corporate VPN under the VPN options, log in with your corporate credentials.",
          "relevanceScore": 0.7588038775683956
        },
        {
          "text": "Please contact your IT admin if you are continuing to struggle with accessing the VPN.",
          "relevanceScore": 0.6696818957446697
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "Corporate VPN",
        "author": "Jane Doe"
      },
        "sensitivityLabel": {
        "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    }
  ]
}

例 2: Copilot コネクタからデータを取得する

次の例は、Copilot コネクタからデータを取得する要求を示しています。 要求は、テキスト抽出の取得元となるアイテムごとに、 titleauthor メタデータを返すように求めます。 応答には、最大 10 個のドキュメントが含まれます。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "externalItem",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}
POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "externalItem",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "retrievalHits": [
    {
      "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=2gge30c",
      "extracts": [
        {
          "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
          "relevanceScore": 0.874
        },
        {
          "text": "You will need to sign in with 2FA to access the corporate VPN.",
          "relevanceScore": 0.801
        }
      ],
      "resourceType": "externalItem",
      "resourceMetadata": {
        "title": "VPN Access",
        "author": "John Doe"
      }
    },
    {
      "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=b775c03",
      "extracts": [
        {
          "text": "Once you have selected Corporate VPN under the VPN options, log in with your corporate credentials.",
        },
        {
          "text": "Please contact your IT admin if you are continuing to struggle with accessing the VPN.",
          "relevanceScore": 0.655
        }
      ],
      "resourceType": "externalItem",
      "resourceMetadata": {
        "title": "Corporate VPN"
      }
    }
  ]
}

例 3: 取得 API へのバッチ要求

次の例は、 取得 API への要求をバッチ処理する方法を示しています。 取得 API では、バッチあたり最大 20 個の要求がサポートされます。 id 要求ペイロードには、バッチ内の各要求を一意に識別する文字列を指定する必要があります。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/$batch
Accept: application/json
Content-Type: application/json

{
  "requests": [
    {
      "id": "1",
      "method": "POST",
      "url": "/copilot/retrieval",
      "body": {
        "queryString": "How to setup corporate VPN?",
        "dataSource": "sharePoint"
      },
      "headers": {
        "Content-Type": "application/json"
      }
    },
    {
      "id": "2",
      "method": "POST",
      "url": "/copilot/retrieval",
      "body": {
        "queryString": "How to setup corporate VPN?",
        "dataSource": "externalItem"
      },
      "headers": {
        "Content-Type": "application/json"
      }
    }
  ]
}
POST https://graph.microsoft.com/v1.0/$batch
Accept: application/json
Content-Type: application/json

{
  "requests": [
    {
      "id": "1",
      "method": "POST",
      "url": "/copilot/retrieval",
      "body": {
        "queryString": "How to setup corporate VPN?",
        "dataSource": "sharePoint"
      },
      "headers": {
        "Content-Type": "application/json"
      }
    },
    {
      "id": "2",
      "method": "POST",
      "url": "/copilot/retrieval",
      "body": {
        "queryString": "How to setup corporate VPN?",
        "dataSource": "externalItem"
      },
      "headers": {
        "Content-Type": "application/json"
      }
    }
  ]
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "responses": [
    {
      "id": "1",
      "status": 200,
      "headers": {
        "Content-Type": "application/json; charset=utf-8"
      },
      "body": {
        "retrievalHits": [
          {
            "webUrl": "https://contoso.sharepoint.com/sites/HR/VPNAccess.docx",
            "extracts": [
              {
                "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
                "relevanceScore": 0.8374363553387588
              },
              {
                "text": "You will need to sign in with 2FA to access the corporate VPN.",
                "relevanceScore": 0.7465472642498679
              }
            ],
            "resourceType": "listItem",
            "resourceMetadata": {},
            "sensitivityLabel": {
              "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
              "displayName": "Confidential\\Any User (No Protection)",
              "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
              "priority": 4,
              "color": "#FF8C00"
            }
          },
          {
            "webUrl": "https://contoso.sharepoint.com/sites/HR/Corporate_VPN.docx",
            "extracts": [
              {
                "text": "Once you have selected Corporate VPN under the VPN options, log in with your corporate credentials.",
                "relevanceScore": 0.7588038775683956
              },
              {
                "text": "Please contact your IT admin if you are continuing to struggle with accessing the VPN.",
                "relevanceScore": 0.6696818957446697
              }
            ],
            "resourceType": "listItem",
            "resourceMetadata": {},
            "sensitivityLabel": {
              "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
              "displayName": "Confidential\\Any User (No Protection)",
              "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
              "priority": 4,
              "color": "#FF8C00"
            }
          }
        ]
      }
    },
    {
      "id": "2",
      "status": 200,
      "headers": {
        "Content-Type": "application/json; charset=utf-8"
      },
      "body": {
        "retrievalHits": [
          {
            "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=2gge30c",
            "extracts": [
              {
                "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
                "relevanceScore": 0.874
              },
              {
                "text": "You will need to sign in with 2FA to access the corporate VPN.",
                "relevanceScore": 0.801
              }
            ],
            "resourceType": "externalItem",
            "resourceMetadata": {}
          },
          {
            "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=b775c03",
            "extracts": [
              {
                "text": "Once you have selected Corporate VPN under the VPN options, log in with your corporate credentials.",
                "relevanceScore": 0.772
              },
              {
                "text": "Please contact your IT admin if you are continuing to struggle with accessing the VPN.",
                "relevanceScore": 0.655
              }
            ],
            "resourceType": "externalItem",
            "resourceMetadata": {}
          }
        ]
      }
    }
  ]
}

例 4: 特定の SharePoint サイトからデータを取得する

次の例は、特定の Sharepoint サイトからデータを取得する要求を示しています。 filterExpression パラメーターは、サイトへのパスを指定します。 要求は、テキスト抽出の取得元となるアイテムごとに、 titleauthor メタデータを返すように求めます。 応答には、最大 4 つのドキュメントを含める必要があります。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "filterExpression": "path:\"https://contoso.sharepoint.com/sites/HR1/\"",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "4"
}
POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "filterExpression": "path:\"https://contoso.sharepoint.com/sites/HR1/\"",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "4"
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "retrievalHits": [
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR1/VPNAccess.docx",
      "extracts": [
        {
          "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
          "relevanceScore": 0.8374363553387588
        },
        {
          "text": "You will need to sign in with 2FA to access the corporate VPN.",
          "relevanceScore": 0.7465472642498679
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Access",
        "author": "John Doe"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    },
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR1/VPNInstructions.docx",
      "extracts": [
        {
          "text": "Have your VPN username and password ready prior to starting the configuration.",
          "relevanceScore": 0.6465472642498679
        },
        {
          "text": "There are multiple VPN options available. Make sure to select the option that grants you access to your desired resources.",
          "relevanceScore": 0.7374363553387588
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Instructions",
        "author": "Elisa Mueller"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f0ddcc93-d3c0-4993-b5cc-76b0a283e252",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    }
  ]
}

例 5: 複数の SharePoint サイトからデータを取得する

次の例は、複数の Sharepoint サイトからデータを取得する要求を示しています。 filterExpression パラメーターは、サイトへのパスを指定します。 要求は、テキスト抽出の取得元となるアイテムごとに、 titleauthor メタデータを返すように求めます。 応答には、最大 4 つのドキュメントを含める必要があります。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "filterExpression": "path:\"https://contoso.sharepoint.com/sites/HR1/\" OR path:\"https://contoso.sharepoint.com/sites/HR2\"",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "4"
}
POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "sharePoint",
  "filterExpression": "path:\"https://contoso.sharepoint.com/sites/HR1/\" OR path:\"https://contoso.sharepoint.com/sites/HR2\"",
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "4"
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "retrievalHits": [
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR1/VPNAccess.docx",
      "extracts": [
        {
          "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
          "relevanceScore": 0.8374363553387588
        },
        {
          "text": "You will need to sign in with 2FA to access the corporate VPN.",
          "relevanceScore": 0.7465472642498679
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Access",
        "author": "John Doe"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f71f1f74-bf1f-4e6b-b266-c777ea76e2s8",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    },
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR2/VPNConfig.docx",
      "extracts": [
        {
          "text": "Have your VPN username and password ready prior to starting the configuration.",
          "relevanceScore": 0.6465472642498679
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Config",
        "author": "Elisa Mueller"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f0ddcc93-d3c0-4993-b5cc-76b0a283e252",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    },
    {
      "webUrl": "https://contoso.sharepoint.com/sites/HR1/VPNInstructions.docx",
      "extracts": [
        {
          "text": "Have your VPN username and password ready prior to starting the configuration.",
          "relevanceScore": 0.6465472642498679
        },
        {
          "text": "There are multiple VPN options available. Make sure to select the option that grants you access to your desired resources.",
          "relevanceScore": 0.7374363553387588
        }
      ],
      "resourceType": "listItem",
      "resourceMetadata": {
        "title": "VPN Instructions",
        "author": "Elisa Mueller"
      },
      "sensitivityLabel": {
        "sensitivityLabelId": "f0ddcc93-d3c0-4993-b5cc-76b0a283e252",
        "displayName": "Confidential\\Any User (No Protection)",
        "toolTip": "Data is classified as Confidential but is NOT PROTECTED to allow access by approved NDA business partners. If a higher level of protection is needed, please use the Sensitivity button on the tool bar to change the protection level.",
        "priority": 4,
        "color": "#FF8C00"
      }
    }
  ]
}

例 6: 特定の接続 ID を使用して Copilot コネクタからデータを取得する

次の例は、Copilot コネクタの取得を特定の接続 ID に制限する要求を示しています。 要求は、テキスト抽出の取得元となるアイテムごとに、 titleauthor メタデータを返すように求めます。 応答には、最大 10 個のドキュメントが含まれます。

要求

次の例は要求を示しています。

POST https://graph.microsoft.com/beta/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "externalItem",
  "dataSourceConfiguration": {
    "externalItem": {
      "connections": [
        {
          "connectionId": "ContosoITServiceNowKB"
        },
        {
          "connectionId": "ContosoHRServiceNowKB"
        }
      ]
    }
  },
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}
POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "How to setup corporate VPN?",
  "dataSource": "externalItem",
  "dataSourceConfiguration": {
    "externalItem": {
      "connections": [
        {
          "connectionId": "ContosoITServiceNowKB"
        },
        {
          "connectionId": "ContosoHRServiceNowKB"
        }
      ]
    }
  },
  "resourceMetadata": [
    "title",
    "author"
  ],
  "maximumNumberOfResults": "10"
}

応答

次の例は応答を示しています。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "retrievalHits": [
    {
      "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=2gge30c",
      "extracts": [
        {
          "text": "To configure the VPN, click the Wi-Fi icon on your corporate device and select the VPN option.",
          "relevanceScore": 0.874
        },
        {
          "text": "You will need to sign in with 2FA to access the corporate VPN.",
          "relevanceScore": 0.801
        }
      ],
      "resourceType": "externalItem",
      "resourceMetadata": {
        "title": "VPN Access",
        "author": "John Doe"
      }
    },
    {
      "webUrl": "https://contoso.service-now.com/sp?id=kb_article&sys_id=b775c03",
      "extracts": [
        {
          "text": "Once you have selected Corporate VPN under the VPN options, log in with your corporate credentials.",
          "relevanceScore": 0.772
        },
        {
          "text": "Please contact your IT admin if you are continuing to struggle with accessing the VPN.",
          "relevanceScore": 0.655
        }
      ],
      "resourceType": "externalItem",
      "resourceMetadata": {
        "title": "Corporate VPN"
      }
    }
  ]
}

例 7: フィルター式を使用する

特定のシナリオの filterExpression プロパティで使用できる KQL 式の例を次に示します。

Copilot コネクタのプロパティでフィルター処理する

この例では、 Label_Title は ServiceNow Copilot コネクタ スキーマのクエリ可能なプロパティです。 クエリは、Label_Title プロパティにCorporate VPNを含む項目に対してフィルター処理されます。

"filterExpression": "Label_Title:\"Corporate VPN\""

Author プロパティで SharePoint の結果をフィルター処理する

この例では、作成者として Megan Bowen を使用して項目に対してクエリをフィルター処理します。

"filterExpression": "Author:\"Megan Bowen\""

LastModifiedTime プロパティを使用して特定の日付範囲で SharePoint の結果をフィルター処理する

この例では、2024 年 7 月 22 日から 2025 年 1 月 8 日の間に変更されたアイテムに対してクエリがフィルター処理されます。

"filterExpression": "LastModifiedTime>= 2024-07-22 AND LastModifiedTime<= 2025-01-08"

FileExtension プロパティを使用して SharePoint の結果をフィルター処理する

この例では、クエリは、.docx、.pdf、または .pptx ファイル拡張子を持つファイルに対してフィルター処理されます。

"filterExpression": "FileExtension:\"docx\" OR FileExtension:\"pdf\" OR FileExtension:\"pptx\""

Filename プロパティを使用して SharePoint の結果をフィルター処理する

この例では、クエリは Contoso Mission Statement.docx という名前のファイルでフィルター処理されます。

"filterExpression": "Filename:\"Contoso Mission Statement.docx\""

FileType プロパティを使用して SharePoint の結果をフィルター処理する

この例では、PDF ファイル、PowerPoint プレゼンテーション、ドキュメントWordでクエリがフィルター処理されます。

"filterExpression": "FileType:\"pdf\" OR FileType:\"pptx\" OR FileType:\"docx\""

InformationProtectionLabelId プロパティを使用してフィルター処理して SharePoint の結果の機密性を判断する

この例では、特定の情報保護ラベルを持つ項目に対してクエリがフィルター処理されます。

"filterExpression": "InformationProtectionLabelId:\"f0ddcc93-d3c0-4993-b5cc-76b0a283e252\""

ModifiedBy プロパティを使用して SharePoint の結果をフィルター処理する

この例では、Adele Vance によって変更されたアイテムに対してクエリがフィルター処理されます。

"filterExpression": "ModifiedBy:\"Adele Vance\""

SiteID プロパティを使用して SharePoint の結果をフィルター処理する

この例では、特定の SharePoint サイトのアイテムに対してクエリがフィルター処理されます。

"filterExpression": "SiteID:\"e2cf7e40-d689-41de-99ee-a423811a253c\""

Title プロパティを使用して SharePoint の結果をフィルター処理する

この例では、タイトルに Windows 10 Device がある項目に対してクエリがフィルター処理されます。

"filterExpression": "Title:\"Windows 10 Device\""