Create a Mobile Voice Connection
Creates a new mobile voice connection with the provided configuration and returns the created connection.
POST
/
mobile_voice_connections
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.mobileVoiceConnections.create({
active: true,
});
console.log(response.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
)
response = client.mobile_voice_connections.create(
active=True,
)
print(response.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"),
)
mobileVoiceConnection, err := client.MobileVoiceConnections.New(
context.TODO(),
telnyx.MobileVoiceConnectionNewParams{
Active: telnyx.Bool(true),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobileVoiceConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobileVoiceConnections.MobileVoiceConnectionCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobileVoiceConnectionCreateParams params = MobileVoiceConnectionCreateParams.builder()
.active(true)
.build();
var response = client.mobileVoiceConnections().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.mobile_voice_connections.create(active: true)
puts(response)<?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 {
$response = $client->mobileVoiceConnections->create(
active: true,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-voice-connections create \
--api-key 'My API Key' \
--activecurl --request POST \
--url https://api.telnyx.com/v2/mobile_voice_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"connection_name": "Telnyx Mobile Voice IMS",
"webhook_api_version": "2",
"tags": [
"string"
],
"outbound": {
"channel_limit": 0,
"outbound_voice_profile_id": "string"
},
"inbound": {
"channel_limit": 0
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_voice_connection",
"active": true,
"connection_name": "<string>",
"tags": [
"<string>"
],
"webhook_event_url": "<string>",
"webhook_event_failover_url": "<string>",
"webhook_api_version": "1",
"webhook_timeout_secs": 123,
"outbound": {
"channel_limit": 123,
"outbound_voice_profile_id": "<string>"
},
"inbound": {
"channel_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Body
application/json
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 response = await client.mobileVoiceConnections.create({
active: true,
});
console.log(response.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
)
response = client.mobile_voice_connections.create(
active=True,
)
print(response.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"),
)
mobileVoiceConnection, err := client.MobileVoiceConnections.New(
context.TODO(),
telnyx.MobileVoiceConnectionNewParams{
Active: telnyx.Bool(true),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobileVoiceConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobileVoiceConnections.MobileVoiceConnectionCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobileVoiceConnectionCreateParams params = MobileVoiceConnectionCreateParams.builder()
.active(true)
.build();
var response = client.mobileVoiceConnections().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.mobile_voice_connections.create(active: true)
puts(response)<?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 {
$response = $client->mobileVoiceConnections->create(
active: true,
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-voice-connections create \
--api-key 'My API Key' \
--activecurl --request POST \
--url https://api.telnyx.com/v2/mobile_voice_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"connection_name": "Telnyx Mobile Voice IMS",
"webhook_api_version": "2",
"tags": [
"string"
],
"outbound": {
"channel_limit": 0,
"outbound_voice_profile_id": "string"
},
"inbound": {
"channel_limit": 0
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_voice_connection",
"active": true,
"connection_name": "<string>",
"tags": [
"<string>"
],
"webhook_event_url": "<string>",
"webhook_event_failover_url": "<string>",
"webhook_api_version": "1",
"webhook_timeout_secs": 123,
"outbound": {
"channel_limit": 123,
"outbound_voice_profile_id": "<string>"
},
"inbound": {
"channel_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}