Skip to main content
GET
/
messaging_hosted_number_orders
JavaScript
import Telnyx from 'telnyx';

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

// Automatically fetches more pages as needed.
for await (const messagingHostedNumberOrder of client.messagingHostedNumberOrders.list()) {
  console.log(messagingHostedNumberOrder.id);
}
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.messaging_hosted_number_orders.list()
page = page.data[0]
print(page.id)
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"),
)
page, err := client.MessagingHostedNumberOrders.List(context.TODO(), telnyx.MessagingHostedNumberOrderListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderListPage;
import com.telnyx.sdk.models.messaginghostednumberorders.MessagingHostedNumberOrderListParams;

public final class Main {
private Main() {}

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

MessagingHostedNumberOrderListPage page = client.messagingHostedNumberOrders().list();
}
}
require "telnyx"

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

page = telnyx.messaging_hosted_number_orders.list

puts(page)
<?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 {
$page = $client->messagingHostedNumberOrders->list(
pageNumber: 0, pageSize: 0
);

var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx messaging-hosted-number-orders list \
--api-key 'My API Key'
curl --request GET \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders \
--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"
        }
      ]
    }
  ],
  "meta": {
    "total_pages": 3,
    "total_results": 55,
    "page_number": 2,
    "page_size": 25
  }
}
{
"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.

Query Parameters

page
object

Consolidated page parameter (deepObject style). Originally: page[number], page[size]

Response

Successful response with a list of messaging hosted number orders.

data
object[]
meta
object