Skip to content

Download asset files

MK.IO does not proxy file transfers. To read a file from an asset, you call getFileAccessInfo to get access details for the asset’s underlying cloud storage, then talk to Azure Blob Storage or AWS S3 directly. Uploads work the same way: you write to your own storage, because there is no upload endpoint on the asset.

You need an asset that already points to stored content, a bearer token, the asset name, and the path of the file you want.

getFileAccessInfo is a POST with no body:

Terminal window
curl -X POST "https://app.mk.io/api/v1/projects/<PROJECT_NAME>/media/assets/<ASSET_NAME>/getFileAccessInfo" \
-H "Authorization: Bearer <YOUR_TOKEN>"

The response carries everything needed to reach the storage directly:

{
"storageAccountName": "mystorageaccount",
"containerName": "mycontainer",
"jwt": "<access_token>",
"url": "<container_url>",
"subPath": "incoming"
}
FieldDescription
urlBase URL of the storage container.
jwtToken to authenticate the follow-up request.
storageAccountNameThe registered storage account or S3 bucket name.
containerNameThe container or bucket holding the asset files.
subPathOptional path prefix. Include it when building the file path.

Combine subPath, if present, with the file name. If subPath is incoming and the file is manifest.mpd, the path is incoming/manifest.mpd. With no subPath, the path is just manifest.mpd.

Use the returned url as the base, append the file path, and pass the jwt as the bearer token:

Terminal window
curl -X GET "<url>/<subPath>/<fileName>" \
-H "Authorization: Bearer <jwt>" \
--output <fileName>

This follows the standard Azure Blob Storage Get Blob pattern for Azure-backed assets.

For S3-backed assets, inspect the returned url. If it is a presigned URL (it contains query parameters such as X-Amz-Signature), the auth is embedded and you do not pass a separate token:

Terminal window
curl -X GET "<url>" --output <fileName>

If it is a plain bucket URL, pass the jwt as the bearer token as in the Azure example.

There is no MK.IO endpoint for uploading into an asset container, and getFileAccessInfo returns read-scoped access intended for download. To upload, write directly to your cloud storage with the credentials on your registered storage instance:

  • Azure: use the Put Blob REST API or the Azure Storage SDK with the SAS token configured on the storage instance.
  • AWS S3: use the PutObject API or the AWS SDK with the credentials configured on the storage instance.
  • getFileAccessInfo fails. The most common cause is an expired storage credential. Rotate it; see Storage.
  • Using the access token to upload. The returned access is read-scoped. Use your own storage credentials for writes.
  • Assets: manage the assets these files belong to.
  • Storage: rotate credentials if access stops working.
© 2026 MediaKind. All rights reserved.