Retrieve a messaging hosted number order
GET
/
messaging_hosted_number_orders
/
{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 messagingHostedNumberOrder = await client.messagingHostedNumberOrders.retrieve('id');
console.log(messagingHostedNumberOrder.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
)
messaging_hosted_number_order = client.messaging_hosted_number_orders.retrieve(
"id",
)
print(messaging_hosted_number_order.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"),
)
messagingHostedNumberOrder, err := client.MessagingHostedNumberOrders.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messagingHostedNumberOrder.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderRetrieveParams;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessagingHostedNumberOrderRetrieveResponse messagingHostedNumberOrder = client.messagingHostedNumberOrders().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
messaging_hosted_number_order = telnyx.messaging_hosted_number_orders.retrieve("id")
puts(messaging_hosted_number_order)<?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 {
$messagingHostedNumberOrder = $client->messagingHostedNumberOrders->retrieve(
'id'
);
var_dump($messagingHostedNumberOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-hosted-number-orders retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"record_type": "messaging_hosted_number_order",
"messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
"status": "pending",
"phone_numbers": [
{
"record_type": "messaging_hosted_number",
"id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
"phone_number": "+18665550001",
"status": "pending"
},
{
"record_type": "messaging_hosted_number",
"id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
"phone_number": "+18665550002",
"status": "pending"
}
]
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifies the type of resource.
Response
Successful response with details about a messaging hosted number order.
Show child attributes
Show child attributes
Example:
{
"id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"record_type": "messaging_hosted_number_order",
"messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
"status": "pending",
"phone_numbers": [
{
"record_type": "messaging_hosted_number",
"id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
"phone_number": "+18665550001",
"status": "pending"
},
{
"record_type": "messaging_hosted_number",
"id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
"phone_number": "+18665550002",
"status": "pending"
}
]
}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 messagingHostedNumberOrder = await client.messagingHostedNumberOrders.retrieve('id');
console.log(messagingHostedNumberOrder.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
)
messaging_hosted_number_order = client.messaging_hosted_number_orders.retrieve(
"id",
)
print(messaging_hosted_number_order.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"),
)
messagingHostedNumberOrder, err := client.MessagingHostedNumberOrders.Get(context.TODO(), "id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", messagingHostedNumberOrder.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderRetrieveParams;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderRetrieveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessagingHostedNumberOrderRetrieveResponse messagingHostedNumberOrder = client.messagingHostedNumberOrders().retrieve("id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
messaging_hosted_number_order = telnyx.messaging_hosted_number_orders.retrieve("id")
puts(messaging_hosted_number_order)<?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 {
$messagingHostedNumberOrder = $client->messagingHostedNumberOrders->retrieve(
'id'
);
var_dump($messagingHostedNumberOrder);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-hosted-number-orders retrieve \
--api-key 'My API Key' \
--id idcurl --request GET \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/{id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"record_type": "messaging_hosted_number_order",
"messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
"status": "pending",
"phone_numbers": [
{
"record_type": "messaging_hosted_number",
"id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
"phone_number": "+18665550001",
"status": "pending"
},
{
"record_type": "messaging_hosted_number",
"id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
"phone_number": "+18665550002",
"status": "pending"
}
]
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}