Skip to main content
POST
/
porting_orders
/
phone_number_configurations
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const phoneNumberConfiguration = await client.portingOrders.phoneNumberConfigurations.create();

console.log(phoneNumberConfiguration.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
)
phone_number_configuration = client.porting_orders.phone_number_configurations.create()
print(phone_number_configuration.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"),
	)
	phoneNumberConfiguration, err := client.PortingOrders.PhoneNumberConfigurations.New(context.TODO(), telnyx.PortingOrderPhoneNumberConfigurationNewParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", phoneNumberConfiguration.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portingorders.phonenumberconfigurations.PhoneNumberConfigurationCreateParams;
import com.telnyx.sdk.models.portingorders.phonenumberconfigurations.PhoneNumberConfigurationCreateResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        TelnyxClient client = TelnyxOkHttpClient.fromEnv();

        PhoneNumberConfigurationCreateResponse phoneNumberConfiguration = client.portingOrders().phoneNumberConfigurations().create();
    }
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

phone_number_configuration = telnyx.porting_orders.phone_number_configurations.create

puts(phone_number_configuration)
<?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 {
  $phoneNumberConfiguration = $client
    ->portingOrders
    ->phoneNumberConfigurations
    ->create(
    phoneNumberConfigurations: [
      [
        'portingPhoneNumberID' => '927f4687-318c-44bc-9f2f-22a5898143a4',
        'userBundleID' => 'ff901545-3e27-462a-ba9d-2b34654cab82',
      ],
    ],
  );

  var_dump($phoneNumberConfiguration);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx porting-orders:phone-number-configurations create \
  --api-key 'My API Key'
curl --request POST \
  --url https://api.telnyx.com/v2/porting_orders/phone_number_configurations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number_configurations": [
    {
      "porting_phone_number_id": "927f4687-318c-44bc-9f2f-22a5898143a4",
      "user_bundle_id": "ff901545-3e27-462a-ba9d-2b34654cab82"
    }
  ]
}
'
{
  "data": [
    {
      "id": "eef3340b-8903-4466-b445-89b697315a3a",
      "user_bundle_id": "daa4308e-742f-4867-97f2-3073db13319a",
      "porting_phone_number_id": "f1486bae-f067-460c-ad43-73a92848f902",
      "record_type": "porting_phone_number_configuration",
      "created_at": "2021-03-19T10:07:15.527000Z",
      "updated_at": "2021-03-19T10:07:15.527000Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

A list of phone number configuration parameters

phone_number_configurations
object[]
Maximum array length: 20

Response

Successful response

data
object[]