
Three Simple Methods to Invoke the Vidispine API From .NET Code by Vidispine June 15, 2016 Howto
Binagora is on fire and returns with another guest post. We know we have a bunch of developers on .NET, therefore we created a .NET SDK. This post shows how you can invoke the Vidispine API from .NET, using the SDK or using standard .NET classes. All with example code.
The following article describe three simple ways to invoke the Vidispine API from .NET code. Two of them use standard .NET classes, while the last one uses the Vidispine .NET SDK. Code snippets were written using C# but you can of course use another language, such as VB.NET, if you want to.
We'll use the simplest test case possible, and let us retrieve the id of the first available item in the Vidispine library.
First of all, let's see how it's done in Postman. As you may already know, it's just a simple http GET request to the Vidispine API to retrieve an item id.
Notice that we're using two Postman variables for a specific environment:
{{vs}}: this is the Vidispine base address (url + port)
{{credentials}}: this is the username and password in basic http format (:) encoded in base64.
Ok, that was the principle of how to query the Vidispine API for an item id. Now let's do the same thing from code.
Given the following constants:
C#
private const string address = http://xxx.xxx.xxx.xxx:8080/API; private const string userName = admin; private const string password = admin;
1
2
3
private const string address = http://xxx.xxx.xxx.xxx:8080/API;
private const string userName = admin;
private const string password = admin;
Option 1: Using WebRequest class
C#
private static string GetUsingWebRequest(string requestUri) { var request = (HttpWebRequest)WebRequest.Create(requestUri); request.Credentials = new NetworkCredential(userName, password); using(var response = (HttpWebResponse)request.GetResponse()) { var stream = response.GetResponseStream(); var reader = new StreamReader(stream); string result = reader.ReadToEnd(); return result; } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
private static string GetUsingWebRequest(string requestUri)
{
var request = (HttpWebRequest)WebRequest.Create(requestUri);
request.Credentials = new NetworkCredential(userName, password);
using(var response = (HttpWebResponse)request.GetResponse())
{
var stream = response.GetResponseStream();
var reader = new StreamReader(stream);
string result = reader.ReadToEnd();
return result;
}
}
Create a WebRequest, set the credentials and execute the request. Remember to release the request calling the Dispose() method or wrapping the instance into a using statement as we did in the sample.
Notice that in this case, we know the response contains a plain text with an item id. That's why we read the stream, and converts it into a string instead of a specific type.
Option 2: Using HttpClient class
C#
private static string GetUsingHttpClient(string requestUri) { var handler = new HttpClientHandler() { Credentials = new NetworkCredential(userName, password) }; var client = new HttpClient(handler); client.BaseAddress = new Uri(address); string message = client.GetStringAsync(requestUri).Result; return message; }
1
2
3
4
5
6
7
8
9
10
11
12
13
private static string GetUsingHttpClient(string requestUri)
{
var handler = new HttpClientHandler()
{
Credentials = new NetworkCredential(userName, password)
};
var client = new HttpClient(handler);
client.BaseAddress = new Uri(address);
string message = client.GetStringAsync(requestUri).Result;
return message;
}
Similar to previous option, it is just a matter of using another http client from the .NET framework.
In this case, credentials are specified on a client handler, then the http client is created using that handler.
The request is executed asynchronously, which is powerful and could be needed in a real situation.
In this case we're just reading the Result property immediately, but it's important to understand that the request is fired in an independent thread. Once thread is completed, you can execute your own callback.
Option 3: Using Vidispine .NET SDK
C#
private static string GetUsingVidispineSdk() { var rootResource = new VidispineResource(address).Authenticate(userName, password); var itemResource = rootResource.Item; string result = itemResource.SearchPlainGET.Number(1).CallText(); return result; }
1
2
3
4
5
6
7
8
private static string GetUsingVidispineSdk()
{
var rootResource = new VidispineResource(address).Authenticate(userName, password);
var itemResource = rootResource.Item;
string result = itemResource.SearchPlainGET.Number(1).CallText();
return result;
}
Finally the easiest way to do it, just call the SDK. Notice that in this case, the action to be executed is not part of the address. You specify the object and action based on the properties. We may say this is the strongly typed option to do it.
You can find more information about how to download and use the Vidispine .NET SDK in the post Getting Started With the Vidispine .NET SDK. If you want to try out the SDK, you can find the latest versions of the SDK here:
64-bit version of the Vidispine .NET SDK v4.5
32-bit version of the Vidispine .NET SDK v4.5
Running the app will show you the result 3 times, once for each option. In this case first item available is #525 but of course that will depend on your environment.
You can download the full console app code from the following GitHub Gist.
Hope you like it.
This blog post was written by our friends at Binagora. Check them out and see how they can help you with your next Media&Entertainment project.
Most recent headlines
05/01/2027
Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...
07/10/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced the latest Long-Term Supported (LTS) release of Dalet Flex. Build...
06/09/2026
June 9 2026, 23:00 (PDT) Dolby and MagentaTV Bring Fans Closer to the FIFA Worl...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
13/07/2026
The Braves opted to keep production in-house rather than hand it off to MLB...
13/07/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, including new deals, departures, and assignments compiled from press releases and repo...
13/07/2026
Eurovision Sport is making live athletics more accessible to fans than ever befo...
13/07/2026
The Milwaukee Bucks will return to full-season over-the-air television for the 2...
13/07/2026
SMPTE has announced an expanded education pathway for media technology professio...
13/07/2026
Vizrt has announced that its graphics technology was used by broadcast design agency Girraphic for Netflix's debut MVP MMA event, broadcast live from the In...
13/07/2026
ARRI has announced an agreement to sell its global rental activities in Europe, the United Kingdom, and North America to H2 Equity Partners through a management...
13/07/2026
DAZN has announced a partnership with Premier Boxing Champions (PBC) to bring PBC fight nights to DAZN subscribers globally. The partnership begins Saturday, Ju...
13/07/2026
TikTok and WSC Sports have announced a strategic partnership that gives sports r...
13/07/2026
Two new Ross products -Brushback: Full Count and CapGo - are debuting at Citizens Bank Park All-Star festivities...
13/07/2026
MSG Networks' was given exclusive access during the Knicks' unforgettabl...
13/07/2026
LOS ANGELES, July 13, 2026 - Sundance Institute today announced the 10 producers selected to participate in its annual Producers Labs taking place July 13-18 fo...
13/07/2026
Adds new intelligent Mix Assistant feature
With their product range now featuring numerous processors across two distinct line-ups, the M-Series and T-Serie...
13/07/2026
Plug-ins for heavy music
Avalanche Tones is the brainchild of Ava Toton, a 17-year-old musician and developer who says her goal is to make the lives of gui...
13/07/2026
Popular sustain effect overhauled
Latvia-based innovators Gamechanger Audio have just launched a new and improved version of their popular sustainer unit. B...
13/07/2026
Millions tuned in for quarter-finals of the FIFA World Cup 2026 on SBS
13 July, 2026
Media releases
Norway v England attracted a Total TV reach of 3.7 mil...
13/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
13/07/2026
Composer and Producer Andy Dollerson has built a career by blending his electroacoustic training with hands on production work for independent artists and filmm...
13/07/2026
The next release of the widely used video player VLC 3.0.24 will incorporate full support for RIST, including main profile and some support for advanced profile...
13/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
13/07/2026
Providing sound reinforcement for a live televised casting show ranks among the most demanding tasks in event technology: the house sound and the broadcast feed...
13/07/2026
Committed to its fans first guiding principle, the genre-defying Savannah Bananas baseball team has placed Calrec at the heart of its growing broadcast story. A...
13/07/2026
At IBC2026, Intinor will demonstrate its latest developments and present a practical path for broadcasters transitioning to IP workflows. The showcase focuses o...
13/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
13/07/2026
Celebrating Two Decades of ICG and League Football Education This year marks 20 years of working with League Football Education (LFE) the charity responsible ...
13/07/2026
Silver for Arvato Systems at the 2026 Service Provider Award
Award in the AI as a Service Provider category recognizes AI expertise and innovative strength
...
13/07/2026
RT News is pleased to announce the appointment of Joe Mag Raollaigh as the new Managing Editor of Nuacht, the Irish Language News and Current Affairs service a...
12/07/2026
Offers six-channels and built-in effects
Korg's latest release introduces a new analogue mixer that's been designed to act as a hub for live electro...
12/07/2026
COW Jobs: Video Production Specialist, Indie Game - Remote
Brie Clayton July 12, 2026
0 Comments
Video Production Specialist (Indie Game)
May 29, 20...
11/07/2026
(L-R) Bruce McKenzie, Mimi Rogers, Cemre Paksoy, Georgia Bernstein, El onore Hendricks, and Colleen Rose Trundy attend the Night Nurse premiere during the 202...
11/07/2026
Promises a vividness and depth rarely found in software
Switzerland-based Handcrafted Audio's latest creation is an interesting hybrid instrument that...
11/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/07/2026
Boston Conservatory at Berklee Awards Grants to Five Alumni, Supporting Work in ...
11/07/2026
Berklee Alumni and Faculty Recognized with 2026 Emmy Nominations The 27 nominees include Trey Parker (South Park) and seven-time Emmy winner Pablo Mungu a of ...
10/07/2026
In-venue and creative video staffers at the professional and collegiate level ha...
10/07/2026
FUJIFILM North America Corporation has announced the FUJINON GF19-35mmT3.5 PZ OIS WR, a cinema power zoom lens for the GFX System with native G Mount. The lens ...
10/07/2026
Dalet has announced a new Long-Term Supported (LTS) release of Dalet Flex, expanding AI capabilities, workflow automation, and integration with Dalia, Dalet'...
10/07/2026
Blackmagic Design has released Fairlight Live, a free software-based broadcast audio mixer for Mac and Windows, available for download now. Simultaneously, the ...
10/07/2026
FloSports and the USA South Athletic Conference have announced an exclusive medi...
10/07/2026
Daktronics has manufactured and installed an LED video display at Field of Dream...
10/07/2026
Registration is now open for NAB Show New York 2026, taking place October 21-22 ...
10/07/2026
Sphere Entertainment Co. and the Formula 1 Heineken Las Vegas Grand Prix have an...
10/07/2026
CBS Sports and the Asian Football Confederation (AFC) have announced a media rights partnership covering the AFC Asian Cup Saudi Arabia 2027 and the AFC U23 Asi...