Delete a phone number block
Deletes a phone number block.
DELETE
/
porting_orders
/
{porting_order_id}
/
phone_number_blocks
/
{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 phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberBlock.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_block = client.porting_orders.phone_number_blocks.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_block.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"),
)
phoneNumberBlock, err := client.PortingOrders.PhoneNumberBlocks.Delete(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortingOrderPhoneNumberBlockDeleteParams{
PortingOrderID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberBlock.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.phonenumberblocks.PhoneNumberBlockDeleteParams;
import com.telnyx.sdk.models.portingorders.phonenumberblocks.PhoneNumberBlockDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PhoneNumberBlockDeleteParams params = PhoneNumberBlockDeleteParams.builder()
.portingOrderId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build();
PhoneNumberBlockDeleteResponse phoneNumberBlock = client.portingOrders().phoneNumberBlocks().delete(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
phone_number_block = telnyx.porting_orders.phone_number_blocks.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
)
puts(phone_number_block)<?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 {
$phoneNumberBlock = $client->portingOrders->phoneNumberBlocks->delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
portingOrderID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
var_dump($phoneNumberBlock);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders:phone-number-blocks delete \
--api-key 'My API Key' \
--porting-order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request DELETE \
--url https://api.telnyx.com/v2/porting_orders/{porting_order_id}/phone_number_blocks/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "DE",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
],
"record_type": "porting_phone_number_block",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifies the Porting Order associated with the phone number block
Identifies the phone number block to be deleted
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberBlock.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_block = client.porting_orders.phone_number_blocks.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_block.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"),
)
phoneNumberBlock, err := client.PortingOrders.PhoneNumberBlocks.Delete(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortingOrderPhoneNumberBlockDeleteParams{
PortingOrderID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", phoneNumberBlock.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.phonenumberblocks.PhoneNumberBlockDeleteParams;
import com.telnyx.sdk.models.portingorders.phonenumberblocks.PhoneNumberBlockDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PhoneNumberBlockDeleteParams params = PhoneNumberBlockDeleteParams.builder()
.portingOrderId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build();
PhoneNumberBlockDeleteResponse phoneNumberBlock = client.portingOrders().phoneNumberBlocks().delete(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
phone_number_block = telnyx.porting_orders.phone_number_blocks.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
)
puts(phone_number_block)<?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 {
$phoneNumberBlock = $client->portingOrders->phoneNumberBlocks->delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
portingOrderID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
var_dump($phoneNumberBlock);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders:phone-number-blocks delete \
--api-key 'My API Key' \
--porting-order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request DELETE \
--url https://api.telnyx.com/v2/porting_orders/{porting_order_id}/phone_number_blocks/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "DE",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
],
"record_type": "porting_phone_number_block",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
}