名前空間: microsoft.graph.search
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
qna オブジェクトのプロパティを更新します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
SearchConfiguration.Read.All |
SearchConfiguration.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
SearchConfiguration.Read.All |
SearchConfiguration.ReadWrite.All |
HTTP 要求
PATCH /search/qnas/{qnaId}
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、更新するプロパティの値 のみを 指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
手記: キーワードなど、コレクションのプロパティを更新すると、コレクション全体が置き換えられます。
| プロパティ |
型 |
説明 |
| availabilityEndDateTime |
DateTimeOffset |
QnA が検索結果として表示されなくなった日時。 常に使用可能な null として設定します。 タイムスタンプの種類は、ISO 8601 形式を使用して日付と時刻の情報を表し、常に UTC です。 たとえば、2014 年 1 月 1 日午前 0 時 (UTC) は、2014-01-01T00:00:00Z です。 |
| availabilityStartDateTime |
DateTimeOffset |
QnA が検索結果として表示され始める日時。 常に使用可能な null として設定します。 タイムスタンプの種類は、ISO 8601 形式を使用して日付と時刻の情報を表し、常に UTC です。 たとえば、2014 年 1 月 1 日午前 0 時 (UTC) は、2014-01-01T00:00:00Z です。 |
| 説明 |
String |
検索結果に表示される回答。
searchAnswer から継承されます。 |
| displayName |
文字列 |
検索結果に表示される質問。
searchAnswer から継承されます。 |
| groupIds |
String collection |
この QnA を表示できるセキュリティ グループの一覧。 |
| keywords |
microsoft.graph.search.answerKeyword |
この QnA をトリガーするキーワードが検索結果に表示されます。 |
| languageTags |
String collection |
この QnA を表示できる地理的に固有の言語名の一覧。 各言語タグの値は、パターン {language}-{region}に従います。 たとえば、en-usは、米国で使用される英語です。 使用可能な値の一覧については、「 サポートされている言語タグ」を参照してください。 |
| プラットフォーム |
microsoft.graph.devicePlatformType コレクション |
この QnA を表示できるデバイスとオペレーティング システムの一覧。 使用できる値は、 android、 androidForWork、 ios、 macOS、 windowsPhone81、 windowsPhone81AndLater、 windows10AndLater、 androidWorkProfile、 unknown、 androidASOP、 androidMobileApplicationManagement、 iOSMobileApplicationManagement、 unknownFutureValueです。 |
| state |
microsoft.graph.search.answerState |
QnA の状態。 使用可能な値: published、draft、excluded、unknownFutureValue。 |
| targetedVariations |
microsoft.graph.search.answerVariant コレクション |
国/地域やデバイスごとに QnA のバリエーション。 デバイス、国/地域、またはその両方に基づいてユーザーに異なるコンテンツを表示する必要がある場合に使用します。 日付とグループの設定は、すべてのバリエーションに適用されます。 |
| webUrl |
String |
QnA の URL リンク。 ユーザーが検索結果からこの QnA を選択すると、指定した URL にリダイレクトされます。
searchAnswer から継承されます。 |
応答
成功した場合、このメソッドは 204 No Content 応答コードを返します。
例
要求
次の例は要求を示しています。
PATCH https://graph.microsoft.com/beta/search/qnas/733b26d5-af76-4eea-ac69-1a0ce8716897
Content-Type: application/json
{
"description": "The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend."
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Search;
var requestBody = new Qna
{
Description = "The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend.",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Search.Qnas["{qna-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelssearch "github.com/microsoftgraph/msgraph-beta-sdk-go/models/search"
//other-imports
)
requestBody := graphmodelssearch.NewQna()
description := "The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend."
requestBody.SetDescription(&description)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
qnas, err := graphClient.Search().Qnas().ByQnaId("qna-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.search.Qna qna = new com.microsoft.graph.beta.models.search.Qna();
qna.setDescription("The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend.");
com.microsoft.graph.models.search.Qna result = graphClient.search().qnas().byQnaId("{qna-id}").patch(qna);
const options = {
authProvider,
};
const client = Client.init(options);
const qna = {
description: 'The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend.'
};
await client.api('/search/qnas/733b26d5-af76-4eea-ac69-1a0ce8716897')
.version('beta')
.update(qna);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Search\Qna;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Qna();
$requestBody->setDescription('The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend.');
$result = $graphServiceClient->search()->qnas()->byQnaId('qna-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Search
$params = @{
description = "The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend."
}
Update-MgBetaSearchQna -QnaId $qnaId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.search.qna import Qna
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Qna(
description = "The dates that Contoso offices will be closed to observe holidays. These dates may differ from the actual date of the holiday in cases where the holiday falls on a weekend.",
)
result = await graph_client.search.qnas.by_qna_id('qna-id').patch(request_body)
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content