> This page is for mk.io.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://mediakind.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mediakind.ferndocs.com/_mcp/server.

# Retrieve tracks.

GET https://app.mk.io/api/v1/projects/{project_name}/media/assets/{asset_name}/storage/

The Azure Storage Data Retrieval API is designed to provide restricted information about data stored in Azure Storage containers. 
This API allows users to interact with data in a secure and efficient manner, without directly altering the stored data.

Here are key features and purposes of this API:

List Container Contents: It enumerates the contents of an Azure Storage container. This operation returns both files and folders 
within the specified container, enabling users to navigate through the hierarchical data structure.

View Track Listings: This API will generate available track listings for any media files contained within the specified container. Track listings
are inclusive of video, audio, and text tracks. If available, the API will also return the track's language and bitrate.

Security: This API is scoped only to the configured storage account and is only accessible to users who have access to the subscription in
which the asset resides. It is a readonly API that does not allow for any mutation or creation operations, and which cannot be used to retrieve 
any data from the storage account.

RBAC Capability Required: `ams.asset.get`

Reference: https://mediakind.ferndocs.com/mkio/api/media/assets/retrieve-tracks

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `project_name` (string, required)
- `asset_name` (string, required)

## Response

### 200

Tracks and Files Listing

- `metadata` (AssetStorageDataMetadataSchema, required) — Metadata about the asset.
- `spec` (AssetStorageDataSpecSchema, required) — The storage container data.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 401 Unauthorized Error

Unauthorized

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 403 Forbidden Error

Forbidden

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 404 Not Found Error

Not Found

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 429 Too Many Requests Error

Too Many Requests

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

### 500 Internal Server Error

Internal Server Error

- `error` (ErrorDetail, required) — Pertinent information about the error
- `ref` (string, required) — A reference to the request that caused the error.
- `status` (integer, required) — The HTTP status code

## Types

### AssetStorageDataMetadataSchema

- `id` (string, required) — The unique identifier for the asset.
- `name` (string, required) — The name of the asset.

### AssetStorageDataSpecSchema

- `container` (string, required) — The name of the storage container.
- `files` (list of FileSchema, required) — A list of files in the storage container. This only represents files present at the top-level of the container.
- `folders` (list of FolderSchema, required) — A list of folders in the storage container.
- `formatHint` (string, required) — A hint to the client as to the format of the data. mk.mezz.v0 is MediaKind's mezzanine format and will emit a period element. ams.v0 is Azure Media Services' format and will emit a tracks element.
- `error` (map from string to string, optional) — A dictionary containing error information. This field will be populated in cases where no valid tracks are present.
- `exceptions` (ExceptionsSchema, optional) — A list of exceptions that occurred during the retrieval process. This is a non-critical field and will only be populated if an exception occurs.
- `periods` (map from string to Period, optional) — A map of available content for each eligible file in the storage container. Typically just '0/index/edge'. Periods are extracted from the latest instance of the MediaKind mezzanine representation format available in the container. Tracks or Periods will be available, but not both.
- `tracks` (map from string to TrackSchema, optional) — A map of available content for each eligible file in the storage container. Tracks are extracted from all eligible files within the container and are presented to the client with the filename as the dictionary key. Tracks or Periods will be available, but not both.

### ErrorDetail

- `code` (string, required) — The error code.
- `detail` (string, required) — The error message.
- `extraDetail` (map from string to any, optional) — Extra information regarding this error.

### FileSchema

- `name` (string, required)
- `size` (integer, required)

### FolderSchema

- `name` (string, required)

### ExceptionsSchema

- `additionalProperties` (string, required)

### Period

- `resource_type` (string, required)
- `adaptation_set` (list of AdaptationSet, optional)
- `asset_identifier` (AssetIdentifier, optional)
- `id` (string, optional)
- `start` (string, optional)

### TrackSchema

- `body` (BodySchema, required)
- `head` (HeadSchema, required)

### AdaptationSet

- `accessibility` (list of Accessibility, optional)
- `contentType` (string, optional)
- `id` (string, optional)
- `maxFrameRate` (string, optional)
- `maxHeight` (string, optional)
- `maxWidth` (string, optional)
- `mimeType` (string, optional)
- `par` (string, optional)
- `representation` (list of Representation, optional)
- `role` (list of Role, optional)
- `segmentAlignment` (string, optional)

### AssetIdentifier

- `schemeIdUri` (string, optional)
- `value` (string, optional)

### BodySchema

- `audio` (list of AudioSchema, required)
- `textstream` (list of TextStreamSchema, required)
- `video` (list of VideoSchema, required)

### HeadSchema

- `availabilityStartTime` (datetime, required)
- `clientManifestRelativePath` (string, required)
- `compatVersion` (string, required)
- `extra` (map from string to any, required)
- `formats` (string, required)
- `fragmentsPerHLSSegment` (string, required)

### Accessibility

- `schemeIdUri` (string, optional)
- `value` (string, optional)

### Representation

- `audio_channel_configuration` (list of AudioChannelConfiguration, optional)
- `bandwidth` (string, optional)
- `codecs` (string, optional)
- `frameRate` (string, optional)
- `height` (string, optional)
- `id` (string, optional)
- `mimeType` (string, optional)
- `sar` (string, optional)
- `scanType` (string, optional)
- `startsWithSAP` (string, optional)
- `width` (string, optional)

### Role

- `schemeIdUri` (string, optional)
- `value` (string, optional)

### AudioSchema

- `src` (string, required)
- `systemBitrate` (string, required)
- `systemLanguage` (string, required)
- `trackID` (string, required)
- `trackName` (string, required)

### TextStreamSchema

- `manifestOutput` (string, required)
- `parentTrackName` (string, required)
- `src` (string, required)
- `systemBitrate` (string, required)
- `trackID` (string, required)
- `trackName` (string, required)
- `Scheme` (string, optional)
- `timescale` (string, optional)

### VideoSchema

- `src` (string, required)
- `systemBitrate` (string, required)
- `systemLanguage` (string, required)
- `trackID` (string, required)
- `trackName` (string, required)

### AudioChannelConfiguration

- `schemeIdUri` (string, optional)
- `value` (string, optional)

## Examples

**Response**

```json
{
  "metadata": {
    "id": "string",
    "name": "string"
  },
  "spec": {
    "container": "string",
    "files": [
      {
        "name": "string",
        "size": 1
      }
    ],
    "folders": [
      {
        "name": "string"
      }
    ],
    "formatHint": "string",
    "error": {},
    "exceptions": {
      "additionalProperties": "string"
    },
    "periods": {},
    "tracks": {}
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.mk.io/api/v1/projects/project_name/media/assets/asset_name/storage/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```