Update stored Dialogflow Connection
Updates the stored Dialogflow connection for the specified connection and returns the updated configuration.
PUT
/
dialogflow_connections
/
{connection_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const dialogflowConnection = await client.dialogflowConnections.update('connection_id', {
service_account: {
type: 'bar',
project_id: 'bar',
private_key_id: 'bar',
private_key: 'bar',
client_email: 'bar',
client_id: 'bar',
auth_uri: 'bar',
token_uri: 'bar',
auth_provider_x509_cert_url: 'bar',
client_x509_cert_url: 'bar',
},
});
console.log(dialogflowConnection.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
dialogflow_connection = client.dialogflow_connections.update(
connection_id="connection_id",
service_account={
"type": "bar",
"project_id": "bar",
"private_key_id": "bar",
"private_key": "bar",
"client_email": "bar",
"client_id": "bar",
"auth_uri": "bar",
"token_uri": "bar",
"auth_provider_x509_cert_url": "bar",
"client_x509_cert_url": "bar",
},
)
print(dialogflow_connection.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
dialogflowConnection, err := client.DialogflowConnections.Update(
context.TODO(),
"connection_id",
telnyx.DialogflowConnectionUpdateParams{
ServiceAccount: map[string]any{
"type": "bar",
"project_id": "bar",
"private_key_id": "bar",
"private_key": "bar",
"client_email": "bar",
"client_id": "bar",
"auth_uri": "bar",
"token_uri": "bar",
"auth_provider_x509_cert_url": "bar",
"client_x509_cert_url": "bar",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", dialogflowConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.core.JsonValue;
import com.telnyx.sdk.models.dialogflowconnections.DialogflowConnectionUpdateParams;
import com.telnyx.sdk.models.dialogflowconnections.DialogflowConnectionUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
DialogflowConnectionUpdateParams params = DialogflowConnectionUpdateParams.builder()
.connectionId("connection_id")
.serviceAccount(DialogflowConnectionUpdateParams.ServiceAccount.builder()
.putAdditionalProperty("type", JsonValue.from("bar"))
.putAdditionalProperty("project_id", JsonValue.from("bar"))
.putAdditionalProperty("private_key_id", JsonValue.from("bar"))
.putAdditionalProperty("private_key", JsonValue.from("bar"))
.putAdditionalProperty("client_email", JsonValue.from("bar"))
.putAdditionalProperty("client_id", JsonValue.from("bar"))
.putAdditionalProperty("auth_uri", JsonValue.from("bar"))
.putAdditionalProperty("token_uri", JsonValue.from("bar"))
.putAdditionalProperty("auth_provider_x509_cert_url", JsonValue.from("bar"))
.putAdditionalProperty("client_x509_cert_url", JsonValue.from("bar"))
.build())
.build();
DialogflowConnectionUpdateResponse dialogflowConnection = client.dialogflowConnections().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
dialogflow_connection = telnyx.dialogflow_connections.update(
"connection_id",
service_account: {
type: "bar",
project_id: "bar",
private_key_id: "bar",
private_key: "bar",
client_email: "bar",
client_id: "bar",
auth_uri: "bar",
token_uri: "bar",
auth_provider_x509_cert_url: "bar",
client_x509_cert_url: "bar"
}
)
puts(dialogflow_connection)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$dialogflowConnection = $client->dialogflowConnections->update(
'connection_id',
serviceAccount: [
'type' => 'bar',
'project_id' => 'bar',
'private_key_id' => 'bar',
'private_key' => 'bar',
'client_email' => 'bar',
'client_id' => 'bar',
'auth_uri' => 'bar',
'token_uri' => 'bar',
'auth_provider_x509_cert_url' => 'bar',
'client_x509_cert_url' => 'bar',
],
conversationProfileID: 'a-VMHLWzTmKjiJw5S6O0-w',
dialogflowAPI: 'cx',
environment: 'development',
location: 'global',
);
var_dump($dialogflowConnection);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dialogflow-connections update \
--api-key 'My API Key' \
--connection-id connection_id \
--service-account '{type: bar, project_id: bar, private_key_id: bar, private_key: bar, client_email: bar, client_id: bar, auth_uri: bar, token_uri: bar, auth_provider_x509_cert_url: bar, client_x509_cert_url: bar}'curl --request PUT \
--url https://api.telnyx.com/v2/dialogflow_connections/{connection_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service_account": {
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "your-private-key",
"private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----",
"client_email": "[email protected]",
"client_id": "your-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/example%40example.iam.gserviceaccount.com"
},
"dialogflow_api": "cx",
"conversation_profile_id": "a-VMHLWzTmKjiJw5S6O0-w",
"location": "global",
"environment": "development"
}
'{
"data": {
"record_type": "dialogflow_connections",
"connection_id": "1234541231",
"conversation_profile_id": "a-VMHLWzTmKjiJw5S6O0-w",
"environment": "development",
"service_account": "****"
}
}Authorizations
Body
application/json
The params expected to create/update a Dialogflow Connection for given connection_id.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const dialogflowConnection = await client.dialogflowConnections.update('connection_id', {
service_account: {
type: 'bar',
project_id: 'bar',
private_key_id: 'bar',
private_key: 'bar',
client_email: 'bar',
client_id: 'bar',
auth_uri: 'bar',
token_uri: 'bar',
auth_provider_x509_cert_url: 'bar',
client_x509_cert_url: 'bar',
},
});
console.log(dialogflowConnection.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
dialogflow_connection = client.dialogflow_connections.update(
connection_id="connection_id",
service_account={
"type": "bar",
"project_id": "bar",
"private_key_id": "bar",
"private_key": "bar",
"client_email": "bar",
"client_id": "bar",
"auth_uri": "bar",
"token_uri": "bar",
"auth_provider_x509_cert_url": "bar",
"client_x509_cert_url": "bar",
},
)
print(dialogflow_connection.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
dialogflowConnection, err := client.DialogflowConnections.Update(
context.TODO(),
"connection_id",
telnyx.DialogflowConnectionUpdateParams{
ServiceAccount: map[string]any{
"type": "bar",
"project_id": "bar",
"private_key_id": "bar",
"private_key": "bar",
"client_email": "bar",
"client_id": "bar",
"auth_uri": "bar",
"token_uri": "bar",
"auth_provider_x509_cert_url": "bar",
"client_x509_cert_url": "bar",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", dialogflowConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.core.JsonValue;
import com.telnyx.sdk.models.dialogflowconnections.DialogflowConnectionUpdateParams;
import com.telnyx.sdk.models.dialogflowconnections.DialogflowConnectionUpdateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
DialogflowConnectionUpdateParams params = DialogflowConnectionUpdateParams.builder()
.connectionId("connection_id")
.serviceAccount(DialogflowConnectionUpdateParams.ServiceAccount.builder()
.putAdditionalProperty("type", JsonValue.from("bar"))
.putAdditionalProperty("project_id", JsonValue.from("bar"))
.putAdditionalProperty("private_key_id", JsonValue.from("bar"))
.putAdditionalProperty("private_key", JsonValue.from("bar"))
.putAdditionalProperty("client_email", JsonValue.from("bar"))
.putAdditionalProperty("client_id", JsonValue.from("bar"))
.putAdditionalProperty("auth_uri", JsonValue.from("bar"))
.putAdditionalProperty("token_uri", JsonValue.from("bar"))
.putAdditionalProperty("auth_provider_x509_cert_url", JsonValue.from("bar"))
.putAdditionalProperty("client_x509_cert_url", JsonValue.from("bar"))
.build())
.build();
DialogflowConnectionUpdateResponse dialogflowConnection = client.dialogflowConnections().update(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
dialogflow_connection = telnyx.dialogflow_connections.update(
"connection_id",
service_account: {
type: "bar",
project_id: "bar",
private_key_id: "bar",
private_key: "bar",
client_email: "bar",
client_id: "bar",
auth_uri: "bar",
token_uri: "bar",
auth_provider_x509_cert_url: "bar",
client_x509_cert_url: "bar"
}
)
puts(dialogflow_connection)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$dialogflowConnection = $client->dialogflowConnections->update(
'connection_id',
serviceAccount: [
'type' => 'bar',
'project_id' => 'bar',
'private_key_id' => 'bar',
'private_key' => 'bar',
'client_email' => 'bar',
'client_id' => 'bar',
'auth_uri' => 'bar',
'token_uri' => 'bar',
'auth_provider_x509_cert_url' => 'bar',
'client_x509_cert_url' => 'bar',
],
conversationProfileID: 'a-VMHLWzTmKjiJw5S6O0-w',
dialogflowAPI: 'cx',
environment: 'development',
location: 'global',
);
var_dump($dialogflowConnection);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dialogflow-connections update \
--api-key 'My API Key' \
--connection-id connection_id \
--service-account '{type: bar, project_id: bar, private_key_id: bar, private_key: bar, client_email: bar, client_id: bar, auth_uri: bar, token_uri: bar, auth_provider_x509_cert_url: bar, client_x509_cert_url: bar}'curl --request PUT \
--url https://api.telnyx.com/v2/dialogflow_connections/{connection_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service_account": {
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "your-private-key",
"private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----",
"client_email": "[email protected]",
"client_id": "your-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/example%40example.iam.gserviceaccount.com"
},
"dialogflow_api": "cx",
"conversation_profile_id": "a-VMHLWzTmKjiJw5S6O0-w",
"location": "global",
"environment": "development"
}
'{
"data": {
"record_type": "dialogflow_connections",
"connection_id": "1234541231",
"conversation_profile_id": "a-VMHLWzTmKjiJw5S6O0-w",
"environment": "development",
"service_account": "****"
}
}