Retrieve stored media
Returns the information about a stored media file.
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_namecurl --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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Uniquely identifies a media resource.
Response
A response describing a media resource
Show child attributes
Show child attributes
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"
}Was this page helpful?
⌘I
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_namecurl --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": {}
}
]
}