Skip to main content
GET
/
.well-known
/
oauth-protected-resource
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx();

const response = await client.wellKnown.retrieveProtectedResourceMetadata();

console.log(response.authorization_servers);
from telnyx import Telnyx

client = Telnyx()
response = client.well_known.retrieve_protected_resource_metadata()
print(response.authorization_servers)
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.WellKnown.GetProtectedResourceMetadata(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.AuthorizationServers)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveProtectedResourceMetadataParams;
import com.telnyx.sdk.models.wellknown.WellKnownRetrieveProtectedResourceMetadataResponse;

public final class Main {
private Main() {}

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

WellKnownRetrieveProtectedResourceMetadataResponse response = client.wellKnown().retrieveProtectedResourceMetadata();
}
}
require "telnyx"

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

response = telnyx.well_known.retrieve_protected_resource_metadata

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->wellKnown->retrieveProtectedResourceMetadata();

var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx well-known retrieve-protected-resource-metadata \
--api-key 'My API Key'
curl --request GET \
--url https://api.telnyx.com/.well-known/oauth-protected-resource
{
  "resource": "<string>",
  "authorization_servers": [
    "<string>"
  ]
}
{
"error": "<string>",
"error_description": "<string>"
}
{
"error": "<string>",
"error_description": "<string>"
}

Response

Protected resource metadata

resource
string<uri>

Protected resource URL

authorization_servers
string<uri>[]

List of authorization server URLs