Retrieve token material.
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 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.TelephonyCredentials.GetTokenMaterial(
context.TODO(),
"id",
)
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;
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 idcurl --request GET \
--url https://api.telnyx.com/v2/telephony_credentials/{id}/token_material \
--header 'Authorization: Bearer <token>'{
"data": {
"kid": "v1",
"tel_token": "rj_ZkkZUOZMxZOfOmLpEUB3siU7u6RjZFeM9s-gb_xCR56WFKFAJiMyF2T6CBRmlh_Sy0i_lfyT9AI8sEif8MTIIszyzSl_aDnG48aO50yaHGuRSYbUbSYm9WIiQ0g==",
"signing_secret": "cCL985ACi7wpbe_2xh1VDF3NabPJ90u1wCKmJCPNpxw"
}
}{
"errors": [
{
"code": "10015",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifies the resource.
Response
Token material for the credential
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
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 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.TelephonyCredentials.GetTokenMaterial(
context.TODO(),
"id",
)
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;
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 idcurl --request GET \
--url https://api.telnyx.com/v2/telephony_credentials/{id}/token_material \
--header 'Authorization: Bearer <token>'{
"data": {
"kid": "v1",
"tel_token": "rj_ZkkZUOZMxZOfOmLpEUB3siU7u6RjZFeM9s-gb_xCR56WFKFAJiMyF2T6CBRmlh_Sy0i_lfyT9AI8sEif8MTIIszyzSl_aDnG48aO50yaHGuRSYbUbSYm9WIiQ0g==",
"signing_secret": "cCL985ACi7wpbe_2xh1VDF3NabPJ90u1wCKmJCPNpxw"
}
}{
"errors": [
{
"code": "10015",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}