Skip to main content
POST
/
messaging_hosted_number_orders
/
{id}
/
actions
/
file_upload
JavaScript
import fs from 'fs';
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.actions.uploadFile('id');

console.log(response.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
)
response = client.messaging_hosted_number_orders.actions.upload_file(
id="id",
)
print(response.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"),
)
response, err := client.MessagingHostedNumberOrders.Actions.UploadFile(
context.TODO(),
"id",
telnyx.MessagingHostedNumberOrderActionUploadFileParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.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.actions.ActionUploadFileParams;
import com.telnyx.sdk.models.messaginghostednumberorders.actions.ActionUploadFileResponse;

public final class Main {
private Main() {}

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

ActionUploadFileResponse response = client.messagingHostedNumberOrders().actions().uploadFile("id");
}
}
require "telnyx"

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

response = telnyx.messaging_hosted_number_orders.actions.upload_file("id")

puts(response)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\FileParam;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$response = $client->messagingHostedNumberOrders->actions->uploadFile(
'id',
bill: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
loa: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)),
);

var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx messaging-hosted-number-orders:actions upload-file \
--api-key 'My API Key' \
--id id
curl --request POST \
--url https://api.telnyx.com/v2/messaging_hosted_number_orders/{id}/actions/file_upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form loa='@example-file' \
--form bill='@example-file'
{
  "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

Authorization
string
header
required

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

Path Parameters

id
string
required

Identifies the type of resource.

Body

multipart/form-data

Message payload

loa
file

Must be a signed LOA for the numbers in the order in PDF format.

bill
file

Must be the last month's bill with proof of ownership of all of the numbers in the order in PDF format.

Response

Successful response with details about a messaging hosted number order.

data
object
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"
}
]
}