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.
Get the access details
Section titled “Get the access details”getFileAccessInfo is a POST with no body:
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"}| Field | Description |
|---|---|
url | Base URL of the storage container. |
jwt | Token to authenticate the follow-up request. |
storageAccountName | The registered storage account or S3 bucket name. |
containerName | The container or bucket holding the asset files. |
subPath | Optional path prefix. Include it when building the file path. |
Build the file path
Section titled “Build 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.
Download the file
Section titled “Download the file”Use the returned url as the base, append the file path, and pass the jwt as the bearer token:
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:
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.
Upload files
Section titled “Upload files”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.
What goes wrong
Section titled “What goes wrong”getFileAccessInfofails. 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.