Returns the material a server needs to mint login tokens for the credential locally, with no request per token: kid, tel_token and signing_secret. The same material is in the response of POST /telephony_credentials. Treat it like the SIP password.
GET
/
telephony_credentials
/
{id}
/
token_material
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.telephonyCredentials.retrieveTokenMaterial('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.telephony_credentials.retrieve_token_material(
"id",
)
print(response.data)
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.telephonyCredentials().retrieveTokenMaterial("id");
}
}
require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.telephony_credentials.retrieve_token_material("id")
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->telephonyCredentials->retrieveTokenMaterial(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx telephony-credentials retrieve-token-material \
--api-key 'My API Key' \
--id id
What a server needs to mint login tokens for the credential itself, with no request per token (TelephonyCredential#to_jwt in telnyx-ruby 3.1.0 or later). As sensitive as sip_password: keep it on the server.
Show child attributes
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.telephonyCredentials.retrieveTokenMaterial('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.telephony_credentials.retrieve_token_material(
"id",
)
print(response.data)
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.telephonyCredentials().retrieveTokenMaterial("id");
}
}
require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.telephony_credentials.retrieve_token_material("id")
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->telephonyCredentials->retrieveTokenMaterial(
'id',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx telephony-credentials retrieve-token-material \
--api-key 'My API Key' \
--id id