# Retrieve tracks.

> Media API · Assets

```http
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`

## Authentication

- `Authorization` header — Bearer authentication of the form `Bearer <token>`.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_name` | string | Yes | — |
| `asset_name` | string | Yes | — |

## Example request

```bash
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/media/assets/{asset_name}/storage/" \
  -H "Authorization: Bearer <token>"
```

## Responses

### 200 — Tracks and Files Listing

- `metadata` · object · **Required** — Metadata about the asset.
  - `id` · string · **Required** · _format: uuid_ — The unique identifier for the asset.
  - `name` · string · **Required** — The name of the asset.
- `spec` · object · **Required** — The storage container data.
  - `container` · string · **Required** — The name of the storage container.
  - `error` · map from strings to string · Optional — A dictionary containing error information. This field will be populated in cases where no valid tracks are present.
    - `[any key]` · string — map of additional properties
  - `exceptions` · object · 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.
    - `additionalProperties` · string · **Required**
  - `files` · list of objects · **Required** — A list of files in the storage container. This only represents files present at the top-level of the container.
    - Array items (object):
      - `name` · string · **Required**
      - `size` · integer · **Required**
  - `folders` · list of objects · **Required** — A list of folders in the storage container.
    - Array items (object):
      - `name` · string · **Required**
  - `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.
  - `periods` · map from strings to object · 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.
    - `[any key]` · object — map of additional properties
      - `adaptation_set` · list of objects · Optional
        - Array items (object):
          - `accessibility` · list of objects · Optional
            - Array items (object):
              - `schemeIdUri` · string · Optional
              - `value` · string · 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 objects · Optional
            - Array items (object):
              - `audio_channel_configuration` · list of objects · Optional
                - Array items (object):
                  - `schemeIdUri` · string · Optional
                  - `value` · string · 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` · list of objects · Optional
            - Array items (object):
              - `schemeIdUri` · string · Optional
              - `value` · string · Optional
          - `segmentAlignment` · string · Optional
      - `asset_identifier` · object · Optional
        - `schemeIdUri` · string · Optional
        - `value` · string · Optional
      - `id` · string · Optional
      - `resource_type` · string · **Required**
      - `start` · string · Optional
  - `tracks` · map from strings to object · 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.
    - `[any key]` · object — map of additional properties
      - `body` · object · **Required**
        - `audio` · list of objects · **Required**
          - Array items (object):
            - `src` · string · **Required**
            - `systemBitrate` · string · **Required**
            - `systemLanguage` · string · **Required**
            - `trackID` · string · **Required**
            - `trackName` · string · **Required**
        - `textstream` · list of objects · **Required**
          - Array items (object):
            - `Scheme` · string · Optional
            - `manifestOutput` · string · **Required**
            - `parentTrackName` · string · **Required**
            - `src` · string · **Required**
            - `systemBitrate` · string · **Required**
            - `timescale` · string · Optional
            - `trackID` · string · **Required**
            - `trackName` · string · **Required**
        - `video` · list of objects · **Required**
          - Array items (object):
            - `src` · string · **Required**
            - `systemBitrate` · string · **Required**
            - `systemLanguage` · string · **Required**
            - `trackID` · string · **Required**
            - `trackName` · string · **Required**
      - `head` · object · **Required**
        - `availabilityStartTime` · string · **Required** · _format: date-time_
        - `clientManifestRelativePath` · string · **Required**
        - `compatVersion` · string · **Required**
        - `extra` · map from strings to any · **Required**
          - `[any key]` · any — map of additional properties
        - `formats` · string · **Required**
        - `fragmentsPerHLSSegment` · string · **Required**

Example:

```json
{
  "metadata": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string"
  },
  "spec": {
    "container": "string",
    "error": {
      "key": "string"
    },
    "exceptions": {
      "additionalProperties": "string"
    },
    "files": [
      {
        "name": "string",
        "size": 0
      }
    ],
    "folders": [
      {
        "name": "string"
      }
    ],
    "formatHint": "string",
    "periods": {
      "key": {
        "adaptation_set": [
          {
            "accessibility": [
              {
                "schemeIdUri": "string",
                "value": "string"
              }
            ],
            "contentType": "string",
            "id": "string",
            "maxFrameRate": "string",
            "maxHeight": "string",
            "maxWidth": "string",
            "mimeType": "string",
            "par": "string",
            "representation": [
              {
                "audio_channel_configuration": [
                  {
                    "schemeIdUri": "string",
                    "value": "string"
                  }
                ],
                "bandwidth": "string",
                "codecs": "string",
                "frameRate": "string",
                "height": "string",
                "id": "string",
                "mimeType": "string",
                "sar": "string",
                "scanType": "string",
                "startsWithSAP": "string",
                "width": "string"
              }
            ],
            "role": [
              {
                "schemeIdUri": "string",
                "value": "string"
              }
            ],
            "segmentAlignment": "string"
          }
        ],
        "asset_identifier": {
          "schemeIdUri": "string",
          "value": "string"
        },
        "id": "string",
        "resource_type": "string",
        "start": "string"
      }
    },
    "tracks": {
      "key": {
        "body": {
          "audio": [
            {
              "src": "string",
              "systemBitrate": "string",
              "systemLanguage": "string",
              "trackID": "string",
              "trackName": "string"
            }
          ],
          "textstream": [
            {
              "Scheme": "string",
              "manifestOutput": "string",
              "parentTrackName": "string",
              "src": "string",
              "systemBitrate": "string",
              "timescale": "string",
              "trackID": "string",
              "trackName": "string"
            }
          ],
          "video": [
            {
              "src": "string",
              "systemBitrate": "string",
              "systemLanguage": "string",
              "trackID": "string",
              "trackName": "string"
            }
          ]
        },
        "head": {
          "availabilityStartTime": "2024-01-01T00:00:00Z",
          "clientManifestRelativePath": "string",
          "compatVersion": "string",
          "extra": {
            "key": null
          },
          "formats": "string",
          "fragmentsPerHLSSegment": "string"
        }
      }
    }
  }
}
```

### 400 — Bad Request

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 401 — Unauthorized

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 403 — Forbidden

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 404 — Not Found

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 429 — Too Many Requests

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 500 — Internal Server Error

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

---

Source spec: `media-api` · operationId: `[get]_/api/v1/projects/{project_name}/media/assets/{asset_name}/storage/`
