How to Generate URLs to Video Content Using IVA’s OData API

Please note that direct links to Video URLs require a subscription to IVA’s services. Please contact sales for more information.

Option 1: Using local cache for videos available

For optimal performance, IVA recommends caching data about the video availability locally rather than making API calls for every request.
What to cache?
The VideoAsset Entity has a reference to the Encodes Collection. This collection is described in the Data Dictionary. The Encodes collection returns meta data for all of the video formats available for a particular Video Asset.
IVA recommends using the Encodes Collection to generate your own URLs to videos using the Video API. This method enables you to cache the data from the Encodes Collection for a specific Video Asset and generate the video links on the fly programmatic without making an API call.
To include the Encodes collection for a particular Video Asset use the EXPAND option.


This will return meta data for the VideoAsset with PublishedID 178 and include all of the available Encodes. You can then choose the best Encode for your application from the collection of Encodes returned.  Use the Video API to call the video.  The Video API allows you to generate links you can pass to your player.

Option 2: Using the GetEncodes() Method to generate URL

This method is NOT recommended for most implementations.  Consult IVA’s Client Services before implementing this method.  Direct link Video URLs can be generated using IVA OData API using the GetEncodes() method and are counted against your hourly quota. This method performs the same function as written in the Security Document in the Video API for each Encode available for a particular VideoAsset.
This method requires two parameters: PublishedId (int) and ReportTag (string).


PublishedId is the unique ID for the particular video asset you wish to link.

ReportTag is a string used to tag your usage reports inside your Media Manager account.

In order to get working URLs returned from this method, you need to include some information in the HEADER request. These parameters are:

TTL – This is the time when the Video URLs should expire. This time is based on Unix Epoch time which is the number of seconds from midnight on 1/1/1970.  To generate this value, calculate the difference in seconds between 1/1/1970 and the time you want the video to expire.  For more information on this visit:

DeveloperId  is the GUID assigned to you to access the IVA OData API.

Token is an MD5 hash of your secret key (supplied to you in your welcome letter) concatenated with the requesting URL.   This MD5 hash generation method is identical to the one used for the VIDEO API.

If the TTL or Token are omitted from the HEADER or the hash does not match the hash generated in the IVA OData API, the URLs returned will be partial URLs without the necessary CustomerId, e, and h parameters for a working URL.

VB.NET Example Code:

Private Shared Sub OnSendingRequest(ByVal sender As Object, ByVal e As SendingRequestEventArgs)

Dim token As String = ConfigurationManager.AppSettings("secretkey")

Dim url As String = e.Request.RequestUri.ToString

Dim ttl As Long = DateDiff("s", "01/01/1970 00:00:00", DateAdd("n", 10, Date.UtcNow)) 'good for 10 minutes

Dim hash As String = LCase(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(token & url, "MD5"))

e.RequestHeaders.Add("developerid", ConfigurationManager.AppSettings("developerid"))

e.RequestHeaders.Add("ttl", ttl.ToString)

e.RequestHeaders.Add("token", hash)

End Sub

C# Example Code:

private static void OnSendingRequest(object sender, SendingRequestEventArgs e)


// Add an Authorization header

string token = ConfigurationManager.AppSettings("secretkey");

string url = e.Request.RequestUri.ToString;

long ttl = DateDiff("s", "01/01/1970 00:00:00", DateAdd("n", 10, System.DateTime.UtcNow));

//good for 10 minutes

string hash = Strings.LCase(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(token + url, "MD5"));
e.RequestHeaders.Add("developerid", ConfigurationManager.AppSettings("developerid"));

e.RequestHeaders.Add("ttl", ttl.ToString);

e.RequestHeaders.Add("token", hash);