When updating agent data with the API,
you can choose to overwrite the entire data type
or to overwrite only specific fields of the data type.
It is usually best to overwrite specific fields,
so you avoid accidentally overwriting all of your data.
To overwrite specific fields,
supply a
FieldMask
to your update request.
The following examples show how to supply a FieldMask
to update the display name for an Intent
type.
Select a protocol and version for the Intent reference:
Protocol | V3 | V3beta1 |
---|---|---|
REST | Intent resource | Intent resource |
RPC | Intent interface | Intent interface |
C++ | IntentsClient | Not available |
C# | IntentsClient | Not available |
Go | IntentsClient | Not available |
Java | IntentsClient | IntentsClient |
Node.js | IntentsClient | IntentsClient |
PHP | Not available | Not available |
Python | IntentsClient | IntentsClient |
Ruby | Not available | Not available |
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: your Google Cloud project ID
- AGENT_ID: your agent ID
- REGION_ID: your region ID
- INTENT_ID: your intent ID
- DISPLAY_NAME: your desired display name
HTTP method and URL:
PATCH https://REGION_ID-dialogflow.googleapis.com/v3/projects/PROJECT_ID/locations/REGION_ID/agents/AGENT_ID/intents/INTENT_ID?updateMask=displayName
Request JSON body:
{ "displayName": "DISPLAY_NAME" }
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_ID/locations/REGION_ID/agents/AGENT_ID/intents/INTENT_ID", "displayName": "DISPLAY_NAME", ... }
Java
To authenticate to Dialogflow, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Dialogflow, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Dialogflow, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.