Check hosted messaging eligibility
Checks whether the supplied phone numbers are eligible for hosted messaging before an order is created.
POST
/
messaging_hosted_number_orders
/
eligibility_numbers_check
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.messagingHostedNumberOrders.checkEligibility({
phone_numbers: ['string'],
});
console.log(response.phone_numbers);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.messaging_hosted_number_orders.check_eligibility(
phone_numbers=["string"],
)
print(response.phone_numbers)
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"),
)
response, err := client.MessagingHostedNumberOrders.CheckEligibility(context.TODO(), telnyx.MessagingHostedNumberOrderCheckEligibilityParams{
PhoneNumbers: []string{"string"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.PhoneNumbers)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityParams;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessagingHostedNumberOrderCheckEligibilityParams params = MessagingHostedNumberOrderCheckEligibilityParams.builder()
.addPhoneNumber("string")
.build();
MessagingHostedNumberOrderCheckEligibilityResponse response = client.messagingHostedNumberOrders().checkEligibility(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messaging_hosted_number_orders.check_eligibility(phone_numbers: ["string"])
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->messagingHostedNumberOrders->checkEligibility(
phoneNumbers: ['string']
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-hosted-number-orders check-eligibility \
--api-key 'My API Key' \
--phone-number stringcurl --request POST \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/eligibility_numbers_check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"string"
]
}
'{
"phone_numbers": [
{
"detail": "string",
"phone_number": "string",
"eligible": false,
"eligible_status": "NUMBER_CAN_NOT_BE_REPEATED"
}
]
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}Authorizations
Body
application/json
Phone numbers to check eligibility
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.messagingHostedNumberOrders.checkEligibility({
phone_numbers: ['string'],
});
console.log(response.phone_numbers);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.messaging_hosted_number_orders.check_eligibility(
phone_numbers=["string"],
)
print(response.phone_numbers)
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"),
)
response, err := client.MessagingHostedNumberOrders.CheckEligibility(context.TODO(), telnyx.MessagingHostedNumberOrderCheckEligibilityParams{
PhoneNumbers: []string{"string"},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.PhoneNumbers)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityParams;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderCheckEligibilityResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessagingHostedNumberOrderCheckEligibilityParams params = MessagingHostedNumberOrderCheckEligibilityParams.builder()
.addPhoneNumber("string")
.build();
MessagingHostedNumberOrderCheckEligibilityResponse response = client.messagingHostedNumberOrders().checkEligibility(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messaging_hosted_number_orders.check_eligibility(phone_numbers: ["string"])
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->messagingHostedNumberOrders->checkEligibility(
phoneNumbers: ['string']
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-hosted-number-orders check-eligibility \
--api-key 'My API Key' \
--phone-number stringcurl --request POST \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/eligibility_numbers_check \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"string"
]
}
'{
"phone_numbers": [
{
"detail": "string",
"phone_number": "string",
"eligible": false,
"eligible_status": "NUMBER_CAN_NOT_BE_REPEATED"
}
]
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}