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

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

const wirelessBlocklist = await client.wirelessBlocklists.create({
  name: 'My Wireless Blocklist',
  type: 'country',
  values: ['CA', 'US'],
});

console.log(wirelessBlocklist.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
)
wireless_blocklist = client.wireless_blocklists.create(
name="My Wireless Blocklist",
type="country",
values=["CA", "US"],
)
print(wireless_blocklist.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"),
)
wirelessBlocklist, err := client.WirelessBlocklists.New(context.TODO(), telnyx.WirelessBlocklistNewParams{
Name: "My Wireless Blocklist",
Type: telnyx.WirelessBlocklistNewParamsTypeCountry,
Values: []string{"CA", "US"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", wirelessBlocklist.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.wirelessblocklists.WirelessBlocklistCreateParams;
import com.telnyx.sdk.models.wirelessblocklists.WirelessBlocklistCreateResponse;

public final class Main {
private Main() {}

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

WirelessBlocklistCreateParams params = WirelessBlocklistCreateParams.builder()
.name("My Wireless Blocklist")
.type(WirelessBlocklistCreateParams.Type.COUNTRY)
.addValue("CA")
.addValue("US")
.build();
WirelessBlocklistCreateResponse wirelessBlocklist = client.wirelessBlocklists().create(params);
}
}
require "telnyx"

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

wireless_blocklist = telnyx.wireless_blocklists.create(name: "My Wireless Blocklist", type: :country, values: ["CA", "US"])

puts(wireless_blocklist)
<?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 {
$wirelessBlocklist = $client->wirelessBlocklists->create(
name: 'My Wireless Blocklist', type: 'country', values: ['CA', 'US']
);

var_dump($wirelessBlocklist);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx wireless-blocklists create \
--api-key 'My API Key' \
--name 'My Wireless Blocklist' \
--type country \
--value CA \
--value US
curl --request POST \
--url https://api.telnyx.com/v2/wireless_blocklists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Wireless Blocklist",
"type": "country",
"values": [
"CA",
"US"
]
}
'
{
  "data": {
    "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
    "record_type": "wireless_blocklist",
    "created_at": "2018-02-02T22:25:27.521Z",
    "updated_at": "2018-02-02T22:25:27.521Z",
    "name": "North American Wireless Blocklist",
    "type": "country",
    "values": [
      "CA",
      "MX",
      "US"
    ]
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

The name of the Wireless Blocklist.

Example:

"My Wireless Blocklist"

type
enum<string>
required

The type of wireless blocklist.

Available options:
country,
mcc,
plmn
Example:

"country"

values
string[]
required

Values to block. The values here depend on the type of Wireless Blocklist.

ISO 3166-1 Alpha-2 Country Code.

Example:

"US"

Example:
["CA", "US"]

Response

Successful Response

data
object