フィードバックを送信
FieldMask を使用してデータを更新する
API を使用してエージェント データを更新する場合は、データ型全体を上書きするか、データ型の特定のフィールドのみを上書きします。通常、誤ってすべてのデータを上書きしないように、特定のフィールドを上書きすることをおすすめします。特定のフィールドを上書きするには、更新リクエストに FieldMask
を指定します。
次の例では、FieldMask
を指定して Intent
タイプの表示名を更新する方法を示します。Intent API リファレンスに移動
インテント リファレンスのプロトコルとバージョンを選択:
終了
REST とコマンドライン
リクエストのデータを使用する前に、次のように置き換えます。
PROJECT_ID : GCP プロジェクト ID
AGENT_ID : エージェント ID
REGION_ID : リージョン ID INTENT_ID : インテント ID
DISPLAY_NAME : 目的の表示名
HTTP メソッドと URL:
PATCH https://REGION_ID -dialogflow.googleapis.com/v3/projects/PROJECT_ID /locations/REGION_ID /agents/AGENT_ID /intents/INTENT_ID ?updateMask=displayName
JSON 本文のリクエスト:
{
"displayName": "DISPLAY_NAME "
}
リクエストを送信するには、次のいずれかのオプションを展開します。
curl(Linux、macOS、Cloud Shell)
リクエスト本文を request.json
という名前のファイルに保存して、次のコマンドを実行します。
curl -X PATCH \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ -H "Content-Type: application/json; charset=utf-8" \ -d @request.json \ "https://REGION_ID -dialogflow.googleapis.com/v3/projects/PROJECT_ID /locations/REGION_ID /agents/AGENT_ID /intents/INTENT_ID ?updateMask=displayName"
PowerShell(Windows)
リクエスト本文を request.json
という名前のファイルに保存して、次のコマンドを実行します。
$cred = gcloud auth application-default print-access-token $headers = @{ "Authorization" = "Bearer $cred" } Invoke-WebRequest ` -Method PATCH ` -Headers $headers ` -ContentType: "application/json; charset=utf-8" ` -InFile request.json ` -Uri "https://REGION_ID -dialogflow.googleapis.com/v3/projects/PROJECT_ID /locations/REGION_ID /agents/AGENT_ID /intents/INTENT_ID ?updateMask=displayName" | Select-Object -Expand Content
次のような JSON レスポンスが返されます。
{
"name": "projects/your-project-id/locations/us-central1/agents/c2a370ca-158a-4296-a211-d5ab6bb84324/intents/91aa7827-d69b-4077-8b21-7a66b8b59f16",
"displayName": "your-display-name",
...
}
フィードバックを送信
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-02 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"わかりにくい"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"情報またはサンプルコードが不正確"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"必要な情報 / サンプルがない"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻訳に関する問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"その他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"わかりやすい"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"問題の解決に役立った"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"その他"
}]
ご意見をお聞かせください