Render the Branded Calling LOA for a DIR
Generate a pre-filled Letter of Authorization (LOA) PDF for a DIR. Enterprise identity (legal name, DBA, address, contact, website, tax id) and the DIR display name are read server-side; the caller supplies the telephone numbers to authorize, an optional Authorized Agent block, and an optional drawn signature.
When signature is omitted the PDF is returned unsigned so the customer can sign it externally and upload it via the Documents API. When signature is present the PDF embeds the supplied image, printed name, and signed-at date.
Returns application/pdf.
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.dir.createLoa('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
phone_numbers: ['+13125550000'],
});
console.log(response);
const content = await response.blob();
console.log(content);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.dir.create_loa(
dir_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
phone_numbers=["+13125550000"],
)
print(response)
content = response.read()
print(content)
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.Dir.NewLoa(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.DirNewLoaParams{
PhoneNumbers: []string{"+13125550000"},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.core.http.HttpResponse;
import com.telnyx.sdk.models.dir.DirCreateLoaParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
DirCreateLoaParams params = DirCreateLoaParams.builder()
.dirId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.addPhoneNumber("+13125550000")
.build();
HttpResponse response = client.dir().createLoa(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.dir.create_loa("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", phone_numbers: ["+13125550000"])
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->dir->createLoa(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
phoneNumbers: ['+13125550000'],
agent: [
'administrativeArea' => 'administrative_area',
'city' => 'city',
'contactEmail' => '[email protected]',
'contactName' => 'contact_name',
'contactPhone' => '+13125550000',
'contactTitle' => 'contact_title',
'country' => 'US',
'legalName' => 'legal_name',
'postalCode' => 'postal_code',
'streetAddress' => 'street_address',
'dba' => 'dba',
'extendedAddress' => 'extended_address',
],
signature: ['imageBase64' => 'x', 'signerName' => 'signer_name'],
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dir create-loa \
--api-key 'My API Key' \
--dir-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--phone-number "'+13125550000'"curl --request POST \
--url https://api.telnyx.com/v2/dir/{dir_id}/loa \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13125550000"
]
}
'"<string>"Authorizations
Telnyx API key. Generate one at https://portal.telnyx.com/#/app/api-keys.
Path Parameters
The DIR id.
Body
Telephone numbers to authorize on the DIR, in +E164 format (+ followed by 10-15 digits). Max 15 per request.
1 - 15 elements^\+[1-9][0-9]{9,14}$Optional. The third-party reseller / partner managing the enterprise's phone numbers. Omit when working directly with Telnyx; the LOA marks the Authorized Agent block as N/A.
Show child attributes
Show child attributes
Optional. When provided the rendered PDF embeds the signature image, printed name, and signed-at date. When absent the PDF is returned unsigned so the customer can sign externally and upload it via the Documents API.
Show child attributes
Show child attributes
Response
The rendered LOA PDF.
The response is of type file.
Was this page helpful?
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.dir.createLoa('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
phone_numbers: ['+13125550000'],
});
console.log(response);
const content = await response.blob();
console.log(content);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.dir.create_loa(
dir_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
phone_numbers=["+13125550000"],
)
print(response)
content = response.read()
print(content)
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.Dir.NewLoa(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.DirNewLoaParams{
PhoneNumbers: []string{"+13125550000"},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.core.http.HttpResponse;
import com.telnyx.sdk.models.dir.DirCreateLoaParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
DirCreateLoaParams params = DirCreateLoaParams.builder()
.dirId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.addPhoneNumber("+13125550000")
.build();
HttpResponse response = client.dir().createLoa(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.dir.create_loa("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", phone_numbers: ["+13125550000"])
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->dir->createLoa(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
phoneNumbers: ['+13125550000'],
agent: [
'administrativeArea' => 'administrative_area',
'city' => 'city',
'contactEmail' => '[email protected]',
'contactName' => 'contact_name',
'contactPhone' => '+13125550000',
'contactTitle' => 'contact_title',
'country' => 'US',
'legalName' => 'legal_name',
'postalCode' => 'postal_code',
'streetAddress' => 'street_address',
'dba' => 'dba',
'extendedAddress' => 'extended_address',
],
signature: ['imageBase64' => 'x', 'signerName' => 'signer_name'],
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dir create-loa \
--api-key 'My API Key' \
--dir-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--phone-number "'+13125550000'"curl --request POST \
--url https://api.telnyx.com/v2/dir/{dir_id}/loa \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_numbers": [
"+13125550000"
]
}
'"<string>"