Skip to main content
GET
/
media
/
{media_name}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const media = await client.media.retrieve('media_name');

console.log(media.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
)
media = client.media.retrieve(
"media_name",
)
print(media.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"),
)
media, err := client.Media.Get(context.TODO(), "media_name")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", media.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.media.MediaRetrieveParams;
import com.telnyx.sdk.models.media.MediaRetrieveResponse;

public final class Main {
private Main() {}

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

MediaRetrieveResponse media = client.media().retrieve("media_name");
}
}
require "telnyx"

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

media = telnyx.media.retrieve("media_name")

puts(media)
<?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 {
$media = $client->media->retrieve('media_name');

var_dump($media);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx media retrieve \
--api-key 'My API Key' \
--media-name media_name
curl --request GET \
--url https://api.telnyx.com/v2/media/{media_name} \
--header 'Authorization: Bearer <token>'
{
  "data": {
    "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    "expires_at": "2020-01-23T18:10:02.574Z",
    "created_at": "2019-01-23T18:10:02.574Z",
    "updated_at": "2019-01-23T18:10:02.574Z",
    "content_type": "application/xml"
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"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

media_name
string
required

Uniquely identifies a media resource.

Response

A response describing a media resource

data
Media Resource · object
Example:
{
"media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
"expires_at": "2020-01-23T18:10:02.574Z",
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"content_type": "application/xml"
}