MK.IO 1.5.0

dotnet add package MK.IO --version 1.5.0
NuGet\Install-Package MK.IO -Version 1.5.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MK.IO" Version="1.5.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MK.IO --version 1.5.0
#r "nuget: MK.IO, 1.5.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MK.IO as a Cake Addin
#addin nuget:?package=MK.IO&version=1.5.0

// Install MK.IO as a Cake Tool
#tool nuget:?package=MK.IO&version=1.5.0

MK.IO Client Library

A client library for MediaKind MK.IO.

Link to MK.IO Nuget package.

Usage (C#, .NET)

MK.IO API Token

You need the MK.IO API token mkiotoken to connect to the API.

To do so,

  1. Open a web browser and log into https://io.mediakind.com (sign in with Microsoft SSO).
  2. Once you are logged in, open a second tab on the same browser and open this link in the new tab: https://api.io.mediakind.com/auth/token/

This should provide you with your user_id and token. Note that this token is valid for 1 year.

Another way to get the token is to use Fiddler when you connect to the MK.IO portal with your browser. It is displayed in the header as x-mkio-token. For example, you should see it on the second REST call to https://api.io.mediakind.com/api/ams/mkiosubscriptionname/stats/.

For more information, please read this article.

Supported operations

In the current version, operations are supported for :

  • Assets
  • Streaming endpoints
  • Streaming locators
  • Storage accounts
  • Content key policies
  • Transforms, including with CVQ presets
  • Jobs
  • Live events
  • Live outputs
  • Asset filters
  • Account filters
  • Streaming policies

Sample code

using MK.IO;
using MK.IO.Models;

// **********************
// MK.IO Client creation
// **********************

var client = new MKIOClient("mkiosubscriptionname", "mkiotoken");

// get user profile info
var profile = client.Account.GetUserProfile();

// Get subscription stats
var stats = client.Account.GetSubscriptionStats();

// *****************
// asset operations
// *****************

// list assets
var mkioAssets = client.Assets.List();

// list assets with pages, 10 assets per page, sorted by creation date
var mkioAssetsResult = client.Assets.ListAsPage("properties/created desc", null, 10);
while (true)
{
    // do stuff here using mkioAssetsResult.Results
    if (mkioAssetsResult.NextPageLink == null) break;
    mkioAssetsResult = client.Assets.ListAsPageNext(mkioAssetsResult.NextPageLink);
}

// get asset
var mkasset = client.Assets.Get("myassetname");

// create asset
var newAssetName = MKIOClient.GenerateUniqueName("asset");
var newasset = client.Assets.CreateOrUpdate(newAssetName, newAssetName, "storagename", "description of my asset");

// create asset and use labels to tag it
newAssetName = MKIOClient.GenerateUniqueName("asset");
newasset = client.Assets.CreateOrUpdate(
    newAssetName,
    newAssetName,
    "storagename",
    "description of asset using labels",
    AssetContainerDeletionPolicyType.Retain,
    null,
    new Dictionary<string, string>() { { "typeAsset", "source" } }
    );

// list assets using labels filtering
var sourceEncodedAssets = client.Assets.List(label: new List<string> { "typeAsset=source" });

// delete asset
client.Assets.Delete(newsasset.Name);

// get streaming locators for asset
var locatorsAsset = client.Assets.ListStreamingLocators("copy-1b510ee166");

// Get tracks and directory of an asset
var tracksAndDir = client.Assets.ListTracksAndDirListing("copy-ef2058b692");


// ******************************
// Streaming endpoint operations
// ******************************

// get streaming endpoint
var mkse = client.StreamingEndpoints.Get("streamingendpoint1");

// list streaming endpoints
var mkses = client.StreamingEndpoints.List();

// create streaming endpoint
var newSe = client.StreamingEndpoints.Create("streamingendpoint2", "francecentral", new StreamingEndpointProperties
            {
                Description = "my description",
                ScaleUnits = 0,
                CdnEnabled = false,
                Sku = new StreamingEndpointsCurrentSku
                {
                    Name = StreamingEndpointSkuType.Standard
                }
            });

// start, stop, delete streaming endpoint
client.StreamingEndpoints.Start("streamingendpoint1");
client.StreamingEndpoints.Stop("streamingendpoint1");
client.StreamingEndpoints.Delete("streamingendpoint1");

Additional samples are available :

Async operations are also supported. For example :


// *****************
// asset operations
// *****************

// Retrieve assets with pages for better performances
var mkioAssetsResult = await client.Assets.ListAsPageAsync("name desc", 10);
        do
        {
            mkioAssetsResult = await client.Assets.ListAsPageNextAsync(mkioAssetsResult.NextPageLink);
            // do stuff
        } while (mkioAssetsResult.NextPageLink != null);


// ******************************
// Streaming endpoint operations
// ******************************

// get streaming endpoint
var mkse = await client.StreamingEndpoints.GetAsync("streamingendpoint1");

// list streaming endpoints
var mkses = await client.StreamingEndpoints.ListAsync();

// create streaming endpoint
var newSe = await client.StreamingEndpoints.CreateAsync("streamingendpoint2", "francecentral", new StreamingEndpointProperties
            {
                Description = "my description",
                ScaleUnits = 0,
                CdnEnabled = false,
                Sku = new StreamingEndpointsCurrentSku
                {
                    Name = "Standard",
                    Capacity = 600
                }
            });

// start, stop, delete streaming endpoint
await client.StreamingEndpoints.StartAsync("streamingendpoint1");
await client.StreamingEndpoints.StopAsync("streamingendpoint1");
await client.StreamingEndpoints.DeleteAsync("streamingendpoint2");

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on MK.IO:

Repository Stars
Azure/Azure-Media-Services-Explorer
Azure Media Services Explorer Tool
Version Downloads Last updated
1.5.0 166 4/22/2024
1.4.0 270 3/25/2024
1.3.0 327 3/18/2024
1.2.2 190 3/8/2024
1.2.1 86 3/7/2024
1.2.0 93 3/6/2024
1.1.0 384 12/21/2023
1.0.14 90 12/20/2023
1.0.14-beta8 73 12/20/2023
1.0.14-beta7 89 12/20/2023
1.0.14-beta6 95 12/20/2023
1.0.14-beta5 76 12/20/2023
1.0.14-beta4 80 12/20/2023
1.0.14-beta3 82 12/20/2023
1.0.14-beta2 79 12/20/2023
1.0.13 107 12/20/2023
1.0.12 88 12/20/2023
1.0.11 106 12/19/2023
1.0.10 101 12/18/2023
1.0.9 214 11/20/2023
1.0.8 95 11/20/2023
1.0.7 131 11/16/2023
1.0.6 106 11/16/2023
1.0.5 142 11/2/2023
1.0.4 128 10/20/2023
1.0.3 138 10/6/2023
1.0.2 135 10/2/2023
1.0.1 112 9/27/2023
1.0.0-alpha7 96 9/26/2023
1.0.0-alpha6 104 9/22/2023
1.0.0-alpha5 118 9/8/2023
1.0.0-alpha4 111 8/31/2023
1.0.0-alpha3 117 8/30/2023
1.0.0-alpha2 102 8/30/2023