
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 ...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
04/07/2026
April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...
01/06/2026
January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026
Throughout the week, Dolby brings to life the latest innovatio...
22/05/2026
Germany's Magenta TV, which will have 44 exclusive FIFA World Cup match broa...
22/05/2026
DAZN, the world's leading sports entertainment platform, has acquired global broadcast rights to the International Federation of American Football's ( I...
22/05/2026
ATHLOS, the all-women's professional track and field league, has announced i...
22/05/2026
The National Academy of Television Arts & Sciences (NATAS) today announced that the 47th Annual Sports Emmy Awards and the 47th Annual News & Documentary Emmy A...
22/05/2026
Wooden Camera today announced the release of new accessories for the Blackmagic URSA Cine Immersive. The new lineup includes a redesigned Top Plate and Side Rai...
22/05/2026
YES Network and OTT Advisors have announced a sixth consecutive season of their streaming partnership, continuing their collaboration on the Gotham app. OTT Adv...
22/05/2026
NESN, New England's premier sports network, will again turn its camera to Fe...
22/05/2026
Dale Pro Audio is hosting an RF over Fiber Livestream Webinar on May 28 from 1-2:30 pm EST. With major sporting events and large-scale productions putting incre...
22/05/2026
Audio-Technica has announced key leadership appointments designed to further strengthen its sales organization and drive continued growth across the Americas. M...
22/05/2026
After nearly four decades shaping the global combat sports landscape, Scott Coker has announced a powerful return as he looks to build a new international mixed...
22/05/2026
Skyline Communications, the company behind the globally deployed DataMiner xOps platform, today announced the launch of xOps Vanguard Runway, a strategic accele...
22/05/2026
For the fully onsite production, 30 cameras - including a SkyCam and Megalodon - will capture the action in Texas
One of the world's biggest rodeo producti...
22/05/2026
Leading Argentina-based sports media company Torneos y Competencias S.A. has modernized its playout operations, implementing a fully redundant, multichannel env...
22/05/2026
As the 2026 Major League Pickleball season kicks off this weekend in Dallas, it ...
22/05/2026
Shure has become a minority investor in Edge Sound Research, a start-up company that is developing new experiential audio technologies that redefine how many au...
22/05/2026
In advance of this year's Sports Emmy Awards, SVG is taking a deep dive into...
22/05/2026
The National Hockey League (NHL) and Amazon Music announced that GRAMMY Award-winning superstar Jelly Roll will provide the official theme song of the 2026 Stan...
22/05/2026
David Pogue will keynote SVV Summer Camp and discuss Apple at 50: How the World...
22/05/2026
In its second year as rightsholder, FOX Sports goes bigger across the board for ...
22/05/2026
Heading into FOX Sports' second Indianapolis 500, Lead Director Mitch Riggin...
22/05/2026
At our 2026 Investor Day, we shared an inside look at the rebuild of our advertising business. This pivot to our own purpose-built platform is already driving s...
22/05/2026
Podcasting on Spotify continues to grow, and so do the ways listeners engage with it. At Investor Day 2026, we shared how we're building the next chapter of...
22/05/2026
Limited-time collections now available
Restoration experts CEDAR Audio have recently launched a new line of Icons plug-ins that make their powerful processo...
22/05/2026
Three new classics join Model Pass line-up
Boss' PX-1 Plugout Pedal offers an innovative approach to guitar pedals, providing users with a hardware stom...
22/05/2026
At its Meitingen site, SGL Carbon has implemented two key projects to further de...
22/05/2026
Statement regarding 2026 National NAIDOC Lifetime Achievement Award for the late...
22/05/2026
Latest data reveals steady distributor rankings, a seasonal shift toward digital...
22/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
22/05/2026
Amagi Media Labs Limited (NSE: AMAGI, BSE: 544679), a cloud-native SaaS platform providing AI-enabled solutions to global media and entertainment companies, tod...
22/05/2026
An nima Post Relies on Cintel to Revive Classic Mexican Films
Brie Clayton May 22, 2026
0 Comments
Film scanner and DaVinci Resolve Studio help manage...
22/05/2026
Boris FX Sapphire Adds Optical Beauty and Hypnotic Textures
Jessie Electa Petrov May 22, 2026
0 Comments
The 2026.5 release introduces advanced defocu...
22/05/2026
Deployment Preserves Trusted Workflows While Enabling a Path to UHD and SMPTE ST 2110
Leading Argentina-based sports media company Torneos y Competencias S.A....
22/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
22/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
22/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
22/05/2026
Back to All News
Ex-Husband, Current Husband, One Wild Rescue: Korean Action Co...
22/05/2026
Catch the latest in Irish music live from venues such as Whelan's, R is n Du...
21/05/2026
Game Creek Video Columbia and Celtic, NEP Supershooter 8 will house onsite produ...
21/05/2026
Freshly graduated, this upstart producer, director, and camera operator is already working as an AP on videoboard shows for the Philadelphia Phillies
In the li...
21/05/2026
Media Links has announced a channel partnership with Clearcast Asia, a broadcast...
21/05/2026
SiriusXM and NASCAR have announced a multi-year renewal of their broadcasting agreement. SiriusXM will continue to carry live broadcasts of every NASCAR Cup Ser...
21/05/2026
Audio-Technica held a demonstration event at its Technica House location in New ...
21/05/2026
Ateme has announced that RTL Deutschland has selected Ateme's software-based...
21/05/2026
LiveU has announced that BCC Live deployed the LU900Q intelligent production unit for the first time during the 2026 Memorial Hermann IRONMAN Texas North Americ...
21/05/2026
ATSC has announced that Mark Aitken, President of ONE Media and Senior VP of Advanced Technology at Sinclair Broadcast Group, will receive the 2026 Mark Richer ...
21/05/2026
BBright has published a technical analysis of the Media eXchange Layer (MXL), de...