# Conversational Intelligence - Transcript Media Subresource

A Conversational Intelligence Transcript Media subresource represents the recording media associated with a [Conversational Intelligence Transcript resource](/docs/conversational-intelligence/api/transcript-resource). The TranscriptMedia subresource contains a temporary URL for accessing the media in the `media_url` property.

## Transcript Media subresource properties

```json
{"type":"object","refName":"intelligence.v2.transcript.media","modelName":"intelligence_v2_transcript_media","properties":{"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Account."},"media_url":{"type":"string","format":"uri","nullable":true,"description":"Downloadable URL for media, if stored in Twilio AI."},"service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^GA[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Service."},"sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^GT[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Transcript."},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## Fetch a Transcript Media subresource for a specific Transcript

`GET https://intelligence.twilio.com/v2/Transcripts/{Sid}/Media`

If [PII redaction was enabled](/docs/conversational-intelligence/onboarding#redact-pii) at the time the associated Transcript was created, you can retrieve the URL for the redacted or unredacted media file using the `Redacted` query parameter.

* If `Redacted` is `true` (the default value), the redacted file's `media_url` is returned. Silence is inserted into the media file where Conversational Intelligence detected PII.
* If `Redacted` is `false`, the original, unredacted media file's `media_url` is returned.

Fetch a Transcript Media subresource

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchMedia() {
  const media = await client.intelligence.v2
    .transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .media()
    .fetch();

  console.log(media.accountSid);
}

fetchMedia();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

media = (
    client.intelligence.v2.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .media()
    .fetch()
)

print(media.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Intelligence.V2.Transcript;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var media = await MediaResource.FetchAsync(pathSid: "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(media.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.transcript.Media;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Media media = Media.fetcher("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

        System.out.println(media.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	intelligence "github.com/twilio/twilio-go/rest/intelligence/v2"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &intelligence.FetchMediaParams{}

	resp, err := client.IntelligenceV2.FetchMedia("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.AccountSid != nil {
			fmt.Println(*resp.AccountSid)
		} else {
			fmt.Println(resp.AccountSid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$media = $twilio->intelligence->v2
    ->transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->media()
    ->fetch();

print $media->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

media = @client
        .intelligence
        .v2
        .transcripts('GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
        .media
        .fetch

puts media.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:intelligence:v2:transcripts:media:fetch \
   --sid GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "service_sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "media_url": "https://media.server.com/media.wav",
  "url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media"
}
```

### Path parameters

```json
[{"name":"Sid","in":"path","description":"The unique SID identifier of the Transcript.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^GT[0-9a-fA-F]{32}$"},"required":true}]
```

### Query parameters

```json
[{"name":"Redacted","in":"query","description":"Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media.","schema":{"type":"boolean"},"examples":{"fetchParams":{"value":"True"}}}]
```
